fix(build): do not wrap jar in launch4j (#2186)
This commit is contained in:
@@ -24,10 +24,11 @@ jobs:
|
||||
JADX_VERSION="r${JADX_REV}.${GITHUB_SHA:0:7}"
|
||||
echo "JADX_VERSION=$JADX_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Build with Gradle
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
arguments: dist copyExe
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew dist distWin
|
||||
|
||||
- name: Save bundle artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -39,11 +40,12 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
- name: Save exe artifact
|
||||
- name: Save Windows bundle artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ format('jadx-gui-{0}-no-jre-win.exe', env.JADX_VERSION) }}
|
||||
path: build/*.exe
|
||||
name: ${{ format('jadx-gui-{0}-no-jre-win', env.JADX_VERSION) }}
|
||||
# Upload unpacked files for now
|
||||
path: jadx-gui/build/jadx-gui-win/*
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
@@ -70,15 +72,17 @@ jobs:
|
||||
JADX_VERSION="r${JADX_REV}.${GITHUB_SHA:0:7}"
|
||||
echo "JADX_VERSION=$JADX_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Build with Gradle
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
arguments: dist -PbundleJRE=true
|
||||
|
||||
- name: Save exe bundle artifact
|
||||
- name: Build
|
||||
run: ./gradlew dist -PbundleJRE=true
|
||||
|
||||
- name: Save Windows with JRE bundle artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ format('jadx-gui-{0}-with-jre-win', env.JADX_VERSION) }}
|
||||
path: jadx-gui/build/*-with-jre-win/*
|
||||
# Upload unpacked files for now
|
||||
path: jadx-gui/build/jadx-gui-with-jre-win/*
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
@@ -22,7 +22,8 @@ jobs:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
|
||||
- name: Build with Gradle
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
arguments: build dist copyExe
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew build dist distWin
|
||||
|
||||
+17
-24
@@ -103,40 +103,34 @@ val pack by tasks.registering(Zip::class) {
|
||||
destinationDirectory.set(layout.buildDirectory)
|
||||
}
|
||||
|
||||
val copyExe by tasks.registering(Copy::class) {
|
||||
val distWin by tasks.registering(Zip::class) {
|
||||
group = "jadx"
|
||||
description = "Copy exe to build dir"
|
||||
description = "Build Windows bundle"
|
||||
|
||||
// next task dependencies not needed, but gradle throws warning because of same output dir
|
||||
mustRunAfter("jar")
|
||||
mustRunAfter(pack)
|
||||
val guiTask = tasks.getByPath("jadx-gui:copyDistWin")
|
||||
dependsOn(guiTask)
|
||||
from(guiTask.outputs)
|
||||
|
||||
from(tasks.getByPath("jadx-gui:createExe"))
|
||||
include("*.exe")
|
||||
into(layout.buildDirectory)
|
||||
destinationDirectory.set(layout.buildDirectory.dir("distWin"))
|
||||
archiveFileName.set("jadx-gui-$jadxVersion-win.zip")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
val distWinBundle by tasks.registering(Copy::class) {
|
||||
group = "jadx"
|
||||
description = "Copy bundle to build dir"
|
||||
val distWinWithJre by tasks.registering(Zip::class) {
|
||||
description = "Build Windows with JRE bundle"
|
||||
|
||||
dependsOn(tasks.getByPath(":jadx-gui:distWinWithJre"))
|
||||
val guiTask = tasks.getByPath(":jadx-gui:copyDistWinWithJre")
|
||||
dependsOn(guiTask)
|
||||
from(guiTask.outputs)
|
||||
|
||||
// next task dependencies not needed, but gradle throws warning because of same output dir
|
||||
mustRunAfter("jar")
|
||||
mustRunAfter(pack)
|
||||
|
||||
from(tasks.getByPath("jadx-gui:distWinWithJre").outputs) {
|
||||
include("*.zip")
|
||||
}
|
||||
into(layout.buildDirectory)
|
||||
destinationDirectory.set(layout.buildDirectory.dir("distWinWithJre"))
|
||||
archiveFileName.set("jadx-gui-$jadxVersion-with-jre-win.zip")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
val dist by tasks.registering {
|
||||
group = "jadx"
|
||||
description = "Build jadx distribution zip"
|
||||
description = "Build jadx distribution zip bundles"
|
||||
|
||||
dependsOn(pack)
|
||||
|
||||
@@ -144,15 +138,14 @@ val dist by tasks.registering {
|
||||
if (os.isWindows) {
|
||||
if (project.hasProperty("bundleJRE")) {
|
||||
println("Build win bundle with JRE")
|
||||
dependsOn(distWinBundle)
|
||||
dependsOn(distWinWithJre)
|
||||
} else {
|
||||
dependsOn(copyExe)
|
||||
dependsOn(distWin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val cleanBuildDir by tasks.registering(Delete::class) {
|
||||
group = "jadx"
|
||||
delete(layout.buildDirectory)
|
||||
}
|
||||
tasks.getByName("clean").dependsOn(cleanBuildDir)
|
||||
|
||||
+38
-18
@@ -88,7 +88,7 @@ tasks.shadowJar {
|
||||
isZip64 = true
|
||||
mergeServiceFiles()
|
||||
manifest {
|
||||
from(project.tasks.jar.get().manifest)
|
||||
from(tasks.jar.get().manifest)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ tasks.existing(CreateStartScripts::class) {
|
||||
launch4j {
|
||||
mainClassName.set(application.mainClass.get())
|
||||
copyConfigurable.set(listOf<Any>())
|
||||
setJarTask(tasks.shadowJar.get())
|
||||
dontWrapJar.set(true)
|
||||
icon.set("$projectDir/src/main/resources/logos/jadx-logo.ico")
|
||||
outfile.set("jadx-gui-$jadxVersion.exe")
|
||||
copyright.set("Skylot")
|
||||
@@ -118,8 +118,9 @@ launch4j {
|
||||
initialHeapPercent.set(5)
|
||||
maxHeapSize.set(4096)
|
||||
maxHeapPercent.set(70)
|
||||
downloadUrl.set("https://www.oracle.com/java/technologies/downloads/#jdk17-windows")
|
||||
downloadUrl.set("https://www.oracle.com/java/technologies/downloads/#jdk21-windows")
|
||||
bundledJrePath.set(if (project.hasProperty("bundleJRE")) "%EXEDIR%/jre" else "%JAVA_HOME%")
|
||||
classpath.set(tasks.getByName("shadowJar").outputs.files.map { "%EXEDIR%/lib/${it.name}" }.toSortedSet())
|
||||
}
|
||||
|
||||
runtime {
|
||||
@@ -139,33 +140,52 @@ runtime {
|
||||
}
|
||||
}
|
||||
|
||||
val copyDistWinWithJre by tasks.registering(Copy::class) {
|
||||
group = "jadx"
|
||||
dependsOn(tasks.named("runtime"), tasks.named("createExe"))
|
||||
from(runtime.jreDir) {
|
||||
include("**/*")
|
||||
into("jre")
|
||||
val copyDistWin by tasks.registering(Copy::class) {
|
||||
description = "Copy files for Windows bundle"
|
||||
|
||||
val libTask = tasks.getByName("shadowJar")
|
||||
dependsOn(libTask)
|
||||
from(libTask.outputs) {
|
||||
include("*.jar")
|
||||
into("lib")
|
||||
}
|
||||
from(tasks.named("createExe").get().outputs) {
|
||||
val exeTask = tasks.getByName("createExe")
|
||||
dependsOn(exeTask)
|
||||
from(exeTask.outputs) {
|
||||
include("*.exe")
|
||||
}
|
||||
into(layout.buildDirectory.dir("jadx-gui-$jadxVersion-with-jre-win"))
|
||||
into(layout.buildDirectory.dir("jadx-gui-win"))
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
val distWinWithJre by tasks.registering(Zip::class) {
|
||||
group = "jadx"
|
||||
dependsOn(copyDistWinWithJre)
|
||||
archiveFileName.set("jadx-gui-$jadxVersion-with-jre-win.zip")
|
||||
from(copyDistWinWithJre.get().outputs) {
|
||||
val copyDistWinWithJre by tasks.registering(Copy::class) {
|
||||
description = "Copy files for Windows with JRE bundle"
|
||||
|
||||
val jreTask = tasks.runtime.get()
|
||||
dependsOn(jreTask)
|
||||
from(jreTask.jreDir) {
|
||||
include("**/*")
|
||||
into("jre")
|
||||
}
|
||||
into(layout.buildDirectory.asFile)
|
||||
val libTask = tasks.getByName("shadowJar")
|
||||
dependsOn(libTask)
|
||||
from(libTask.outputs) {
|
||||
include("*.jar")
|
||||
into("lib")
|
||||
}
|
||||
val exeTask = tasks.getByName("createExe")
|
||||
dependsOn(exeTask)
|
||||
from(exeTask.outputs) {
|
||||
include("*.exe")
|
||||
}
|
||||
into(layout.buildDirectory.dir("jadx-gui-with-jre-win"))
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
val addNewNLSLines by tasks.registering(JavaExec::class) {
|
||||
group = "jadx"
|
||||
group = "jadx-dev"
|
||||
description = "Utility task to add new/missing translation lines"
|
||||
|
||||
classpath = sourceSets.main.get().runtimeClasspath
|
||||
mainClass.set("jadx.gui.utils.tools.NLSAddNewLines")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user