| skipped 1 lines |
2 | 2 | | id 'application' |
3 | 3 | | id 'edu.sc.seis.launch4j' version '2.5.1' |
4 | 4 | | id 'com.github.johnrengelman.shadow' version '7.1.0' |
| 5 | + | id 'org.beryx.runtime' version '1.12.7' |
5 | 6 | | } |
6 | 7 | | |
7 | 8 | | dependencies { |
| skipped 72 lines |
80 | 81 | | copyright = 'Skylot' |
81 | 82 | | windowTitle = 'jadx' |
82 | 83 | | companyName = 'jadx' |
83 | | - | jreMinVersion = '1.8.0' |
| 84 | + | jreMinVersion = '11' |
84 | 85 | | jvmOptions = ['-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true', '-XX:+UseG1GC'] |
85 | 86 | | jreRuntimeBits = "64" |
86 | 87 | | bundledJre64Bit = true |
87 | 88 | | initialHeapPercent = 5 |
88 | 89 | | maxHeapSize = 4096 |
89 | 90 | | maxHeapPercent = 70 |
90 | | - | downloadUrl = 'https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot#x64_win' |
| 91 | + | downloadUrl = 'https://www.oracle.com/java/technologies/downloads/#jdk17-windows' |
91 | 92 | | bundledJrePath = '%JAVA_HOME%' |
92 | 93 | | } |
93 | 94 | | |
| 95 | + | runtime { |
| 96 | + | addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages') |
| 97 | + | addModules( |
| 98 | + | 'java.desktop', |
| 99 | + | 'java.naming', |
| 100 | + | 'java.sql', // TODO: GSON register adapter for java.sql.Time |
| 101 | + | 'java.xml', |
| 102 | + | ) |
| 103 | + | jpackage { |
| 104 | + | imageOptions = ['--icon', "${projectDir}/src/main/resources/logos/jadx-logo.ico"] |
| 105 | + | skipInstaller = true |
| 106 | + | targetPlatformName = "win" |
| 107 | + | } |
| 108 | + | launcher { |
| 109 | + | noConsole = true |
| 110 | + | } |
| 111 | + | } |
| 112 | + | |
| 113 | + | tasks.register('distLaunch4jConfig') { |
| 114 | + | def configFile = layout.buildDirectory.file("jadx-gui-${version}.l4j.ini") |
| 115 | + | outputs.file(configFile).withPropertyName('outputFiles') |
| 116 | + | |
| 117 | + | doLast { |
| 118 | + | configFile.get().getAsFile().write(""" |
| 119 | + | # Launch4j runtime config |
| 120 | + | -DJAVA_HOME="%EXEDIR%/jre" |
| 121 | + | """.trim()) |
| 122 | + | } |
| 123 | + | } |
| 124 | + | |
| 125 | + | task distWinWithJre(type: Zip, dependsOn: ['runtime', 'createExe', 'distLaunch4jConfig']) { |
| 126 | + | group 'jadx' |
| 127 | + | destinationDirectory = buildDir |
| 128 | + | archiveFileName = "jadx-gui-${jadxVersion}-with-jre-win.zip" |
| 129 | + | from(runtime.jreDir) { |
| 130 | + | include '**/*' |
| 131 | + | into 'jre' |
| 132 | + | } |
| 133 | + | from(createExe.outputs) { |
| 134 | + | include '*.exe' |
| 135 | + | } |
| 136 | + | from(distLaunch4jConfig.outputs) { |
| 137 | + | include '*.ini' |
| 138 | + | } |
| 139 | + | duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
| 140 | + | } |
| 141 | + | |