forked from francescotescari/XiaoMiToolV2
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
120 lines (98 loc) · 2.96 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import org.gradle.internal.os.OperatingSystem;
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
//id 'com.github.sherter.google-java-format' version '0.9'
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 {
main {
resources {
srcDir("src/main/java")
includes.add("**/*.*")
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
javafx {
version = '19.0.2.1'
modules = ["javafx.controls", "javafx.fxml", "javafx.web", "javafx.swing"]
}
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
}
}
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 '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'
implementation 'commons-codec:commons-codec:1.11'
implementation 'commons-io:commons-io:2.6'
implementation 'commons-logging:commons-logging:1.2'
implementation 'org.apache.commons:commons-compress:1.17'
implementation 'org.apache.commons:commons-lang3:3.7'
implementation 'org.apache.httpcomponents:httpclient:4.5.5'
implementation 'org.json:json:20180130'
}
tasks.compileJava {
options.encoding = "UTF-8"
}
application {
mainClass.set("com.xiaomitool.v2.gui.Launcher")
applicationName = XMT_NAME
}