-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
115 lines (101 loc) · 3.52 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
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.beryx.jlink' version '3.0.1'
id "org.javamodularity.moduleplugin" version "1.8.15"
}
group 'net.cassite'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.8.2'
}
sourceCompatibility = '21'
targetCompatibility = '21'
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs += '--enable-preview'
}
tasks.withType(JavaExec) {
jvmArgs += '--enable-preview'
jvmArgs += '--enable-native-access=ALL-UNNAMED'
jvmArgs += '--enable-native-access=io.vproxy.pni'
jvmArgs += '--enable-native-access=io.vproxy.windivert'
}
application {
mainModule = 'net.cassite.hottapcassistant'
mainClass = 'net.cassite.hottapcassistant.Main'
}
javafx {
version = '21'
modules = ['javafx.controls', 'javafx.swing', 'javafx.media']
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'com.github.kwhat:jnativehook:2.2.2'
implementation group: 'io.vproxy', name: 'vjson', version: '1.5.4-jdk9'
implementation group: 'io.vproxy', name: 'vfx', version: '1.3.5'
implementation group: 'net.cassite', name: 'xboxrelay-ui', version: '1.0.0'
implementation group: 'net.java.dev.jna', name: 'jna', version: '5.12.1'
implementation group: 'net.java.dev.jna', name: 'jna-platform', version: '5.12.1'
implementation group: 'io.vertx', name: 'vertx-core', version: '4.3.7'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36'
implementation group: 'io.projectreactor.tools', name: 'blockhound', version: '1.0.6.RELEASE'
implementation group: 'net.cassite', name: 'tof-pcap-java', version: '1.0.0'
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.1.2'
implementation group: 'io.vproxy', name: 'commons', version: '1.3.4'
implementation group: 'io.vproxy', name: 'divert-java-core', version: '1.0.4'
implementation group: 'io.vproxy', name: 'divert-java-hostsmanager', version: '1.0.2'
}
test {
useJUnitPlatform()
}
jlink {
imageZip = project.file("${buildDir}/distributions/幻塔PC助手-${javafx.platform.classifier}.zip")
options = ['--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
jvmArgs = ['-Xmx320m', '-Djava.library.path=%TEMP%', '-Dio.vproxy.vfx.logLevel=INFO',
'--enable-preview', '--enable-native-access=ALL-UNNAMED',
'--enable-native-access=io.vproxy.pni',
'--enable-native-access=io.vproxy.windivert',
]
noConsole = true
}
mergedModule {
additive = true
uses 'io.vertx.core.spi.VertxServiceProvider'
uses 'io.vertx.core.spi.VerticleFactory'
uses 'io.vertx.core.spi.JsonFactory'
uses 'io.vertx.core.spi.launcher.CommandFactory'
forceMerge 'kotlin'
forceMerge 'slf4j'
}
}
tasks.jlinkZip.doFirst {
copy {
from("docs") {
include "如何运行-How-to-Run.txt"
}
from("misc") {
include "launch.bat"
include "launch-with-pwsh.bat"
}
into "${buildDir}/image/"
}
}
jlinkZip {
group = 'distribution'
}
task runTest(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "net.cassite.hottapcassistant.test.TestMain"
systemProperty("IsDebug", System.getProperty("IsDebug", "false"))
args = ["net.cassite.hottapcassistant.test." + System.getProperty("TestClass")]
}