From 46aecddee2492c30aefe5011e7001a68f3d3871d Mon Sep 17 00:00:00 2001 From: Skylot Date: Sat, 14 Nov 2020 15:54:02 +0000 Subject: [PATCH] build: bundle JRE with jadx-gui --- build.gradle | 10 ++++++++++ jadx-gui/build.gradle | 43 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index d060c7a3..08ba5f61 100644 --- a/build.gradle +++ b/build.gradle @@ -156,6 +156,16 @@ task dist(dependsOn: [pack, copyExe]) { description = 'Build jadx distribution zip' } +task distWin(type: Copy, dependsOn: 'jadx-gui:distWinWithJre') { + group 'jadx' + description = 'Copy bundle to build dir' + destinationDir buildDir + from(tasks.getByPath('jadx-gui:distWinWithJre').outputs) { + include '*.zip' + } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} + task samples(dependsOn: 'jadx-samples:samples') { group 'jadx' } diff --git a/jadx-gui/build.gradle b/jadx-gui/build.gradle index 11aa5385..d741e879 100644 --- a/jadx-gui/build.gradle +++ b/jadx-gui/build.gradle @@ -1,7 +1,8 @@ plugins { id 'application' - id 'edu.sc.seis.launch4j' version '2.4.8' - id 'com.github.johnrengelman.shadow' version '6.0.0' + id 'edu.sc.seis.launch4j' version '2.4.9' + id 'com.github.johnrengelman.shadow' version '6.1.0' + id 'org.beryx.runtime' version '1.11.4' } dependencies { @@ -71,15 +72,47 @@ launch4j { copyright = 'Skylot' windowTitle = 'jadx' companyName = 'jadx' - jreMinVersion = '1.8.0' + jreMinVersion = '11' jvmOptions = ['-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true', '-XX:+UseG1GC'] jreRuntimeBits = "64" bundledJre64Bit = true initialHeapPercent = 5 maxHeapSize = 4096 maxHeapPercent = 70 - downloadUrl = 'https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot#x64_win' - bundledJrePath = '%JAVA_HOME%' + downloadUrl = 'https://adoptopenjdk.net/releases.html?variant=openjdk14&jvmVariant=hotspot#x64_win' +// bundledJrePath = '%JAVA_HOME%' + bundledJrePath = '%EXEDIR%/jre' // TODO: merge java search paths +} + +runtime { + addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages') + addModules( + 'java.desktop', + 'java.naming', + 'java.sql', // TODO: GSON register adapter for java.sql.Time + 'java.xml', + ) + jpackage { + imageOptions = ['--icon', "${projectDir}/src/main/resources/logos/jadx-logo.ico"] + skipInstaller = true + } + launcher{ + noConsole = true + } +} + +task distWinWithJre(type: Zip, dependsOn: ['runtime', 'createExe']) { + group 'jadx' + destinationDirectory = buildDir + archiveFileName = "jadx-gui-${jadxVersion}-with-jre-win.zip" + from(runtime.jreDir) { + include '**/*' + into 'jre' + } + from(createExe.outputs){ + include '*.exe' + } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } test { -- GitLab