mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
extract Java modules to a variable and reuse
This commit is contained in:
parent
6304db05a9
commit
f4331a2ccb
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -7,4 +7,4 @@
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
14
build.gradle
14
build.gradle
@ -32,6 +32,8 @@ version = exec("git describe --tags", ".", false) ?: "unknown"
|
||||
sourceCompatibility = 11
|
||||
targetCompatibility = 11
|
||||
|
||||
def javaModules = ["java.base", "java.desktop", "java.prefs", "java.logging"]
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java { srcDirs "src", "ext/rocksaw/src", "ext/vserv-tcpip/src/java" }
|
||||
@ -147,11 +149,9 @@ def minimizeTask(String platform, Closure doMore) {
|
||||
return tasks.create("${platform}.min", proguard.gradle.ProGuardTask) {
|
||||
injars "build/libs/ipscan-${platform}-${version}.jar"
|
||||
outjars "build/libs/ipscan-${platform}-${version}.min.jar"
|
||||
libraryjars System.getProperty('java.home') + "/jmods/java.base.jmod"
|
||||
libraryjars System.getProperty('java.home') + "/jmods/java.desktop.jmod"
|
||||
libraryjars System.getProperty('java.home') + "/jmods/java.logging.jmod"
|
||||
libraryjars System.getProperty('java.home') + "/jmods/java.net.http.jmod"
|
||||
libraryjars System.getProperty('java.home') + "/jmods/java.prefs.jmod"
|
||||
javaModules.each {
|
||||
libraryjars System.getProperty('java.home') + "/jmods/${it}.jmod"
|
||||
}
|
||||
dontobfuscate
|
||||
dontoptimize
|
||||
dontnote '**'
|
||||
@ -293,7 +293,7 @@ task 'win-installer'(dependsOn: ['win32', 'win64']) {
|
||||
def jrePath = "AppFiles/jre"
|
||||
if (!new File(installerDir, jrePath).exists()) {
|
||||
exec("jlink --output $jrePath --vm=client --compress=2 --no-header-files --no-man-pages --strip-debug " +
|
||||
"--add-modules java.base,java.desktop,java.prefs,java.logging")
|
||||
"--add-modules " + javaModules.join(","))
|
||||
}
|
||||
ant.copy(file: "build/libs/${project.name}-win64-${version}.exe", tofile:"${installerDir}/AppFiles/ipscan.exe")
|
||||
if (platform.startsWith('win')) {
|
||||
@ -303,7 +303,7 @@ task 'win-installer'(dependsOn: ['win32', 'win64']) {
|
||||
println("Building of Windows Installer is not supported on other platforms")
|
||||
exec("wine $nsis/makensis.exe Installer/Installer.nsi", installerDir)
|
||||
}
|
||||
ant.move(file: "${installerDir}/ipscan-*-setup.exe", todir: "build/libs")
|
||||
ant.move(file: "${installerDir}/ipscan-$version-setup.exe", todir: "build/libs")
|
||||
exec("git checkout ${installerDir}/InstallerConfig.nsh")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user