refactor: create dist tasks

Esse commit está contido em:
Francesco Tescari
2021-10-09 15:40:14 +02:00
commit 7bf3de00ae
10 arquivos alterados com 75 adições e 78 exclusões
+66 -15
Ver Arquivo
@@ -1,17 +1,27 @@
import org.gradle.internal.os.OperatingSystem;
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.9'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'com.github.sherter.google-java-format' version '0.9'
id "com.github.johnrengelman.shadow" version "6.1.0"
id "com.github.johnrengelman.shadow" version "7.1.0"
id 'org.beryx.runtime' version '1.12.6'
}
ext {
XMT_VERSION = "21.10.10"
XMT_NAME = "XiaoMiTool V2"
XMT_DESC = "Unofficial tool for simple Xiaomi modding"
XMT_URL = "https://www.xiaomitool.com"
}
version = XMT_VERSION
repositories {
flatDir {
dirs("lib")
}
mavenCentral()
maven { url "https://jitpack.io" }
}
sourceSets {
@@ -25,26 +35,67 @@ sourceSets {
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
javafx {
version = '11'
version = '17'
modules = ["javafx.controls", "javafx.fxml", "javafx.web", "javafx.swing"]
}
shadowJar {
exclude "LICENSE.txt"
exclude "prebuilt/**"
javafx {
configuration = "shadow"
def currentOs = OperatingSystem.current()
WorkResult copyResources(Object destination, OperatingSystem system) {
return copy {
from "."
include "res/lang/*.xml"
if (system.windows) {
include "res/tools/win/**/*.*"
include "res/driver/**/*.*"
} else if (system.macOsX) {
include "res/tools/mac/**/*.*"
} else {
include "res/tools/lin/**/*.*"
}
into destination
}
minimize()
}
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
noConsole = true
}
jpackage {
imageName = XMT_NAME
installerOptions += ['--description', XMT_DESC]
installerOptions += ['--about-url', XMT_URL]
installerOptions += ['--license-file', 'LICENSE']
if (currentOs.windows) {
installerOptions += ['--win-help-url', XMT_URL]
installerOptions += ['--win-menu']
installerOptions += ['--win-update-url', XMT_URL]
}
tasks.jpackageImage.doLast {
copyResources(imageOutputDirOrDefault.toPath().resolve(imageNameOrDefault).toFile(), currentOs)
}
}
tasks.runtime.doLast {
copyResources(imageDir.asFile, currentOs)
}
}
dependencies {
implementation(files("./lib/apktool_2.4.0.jar"))
implementation 'com.github.iBotPeaches:Apktool:2.4.0'
implementation 'com.google.guava:guava:29.0-jre'
implementation 'com.google.protobuf:protobuf-java:3.7.0'
implementation 'com.mortennobel:java-image-scaling:0.8.6'
@@ -63,8 +114,8 @@ tasks.compileJava {
application {
// Define the main class for the application.
mainClassName = "com.xiaomitool.v2.gui.MainWindow"
mainClass.set("com.xiaomitool.v2.gui.Launcher")
applicationName = XMT_NAME
}
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Arquivo binário não exibido.
Arquivo binário não exibido.
-10
Ver Arquivo
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="highestAvailable" uiAccess="False" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
-26
Ver Arquivo
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>XiaoMiTool.jar</jar>
<outfile>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\XiaoMiTool.exe</outfile>
<errTitle>XiaoMiTool V2 launch error</errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>https://jdk.java.net/</downloadUrl>
<supportUrl>http://www.xiaomitool.com</supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\admin_priviledge.manifest</manifest>
<icon>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\icon.ico</icon>
<jre>
<path>.</path>
<bundledJre64Bit>true</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion></minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>
-26
Ver Arquivo
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>XiaoMiTool.jar</jar>
<outfile>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\XiaoMiTool_32bit.exe</outfile>
<errTitle>XiaoMiTool V2 launch error</errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>https://www.java.com/download/</downloadUrl>
<supportUrl>http://www.xiaomitool.com/V2</supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\admin_priviledge.manifest</manifest>
<icon>C:\Users\Franz\Documents\Java\XiaoMiTool\launch4j\icon.ico</icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.8.0_000</minVersion>
<maxVersion>1.8.0_500</maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>32</runtimeBits>
</jre>
</launch4jConfig>
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 106 KiB

Arquivo binário não exibido.
@@ -0,0 +1,8 @@
package com.xiaomitool.v2.gui;
public class Launcher {
public static void main(String... args) {
MainWindow.main(args);
}
}