mirror of
https://github.com/skylot/jadx.git
synced 2025-02-17 03:30:06 +00:00
fix: use shadow jar in app bundle to reduce jars count (#1868)
This commit is contained in:
parent
ae1b1ce99e
commit
ed4c5a3a17
18
build.gradle
18
build.gradle
@ -107,8 +107,22 @@ allprojects {
|
||||
}
|
||||
|
||||
task copyArtifacts(type: Copy) {
|
||||
from tasks.getByPath(":jadx-cli:installDist")
|
||||
from tasks.getByPath(":jadx-gui:installDist")
|
||||
from(tasks.getByPath(":jadx-cli:installShadowDist")) {
|
||||
exclude '**/*.jar'
|
||||
filter { line ->
|
||||
line.replaceAll('jadx-cli-(.*)-all.jar', 'jadx-$1-all.jar')
|
||||
.replace('-jar "\\"$CLASSPATH\\""', '-cp "\\"$CLASSPATH\\"" jadx.cli.JadxCLI')
|
||||
.replace('-jar "%CLASSPATH%"', '-cp "%CLASSPATH%" jadx.cli.JadxCLI')
|
||||
}
|
||||
}
|
||||
from(tasks.getByPath(":jadx-gui:installShadowDist")) {
|
||||
exclude '**/*.jar'
|
||||
filter { line -> line.replaceAll('jadx-gui-(.*)-all.jar', 'jadx-$1-all.jar') }
|
||||
}
|
||||
from(tasks.getByPath(":jadx-gui:installShadowDist")) {
|
||||
include '**/*.jar'
|
||||
rename 'jadx-gui-(.*)-all.jar', 'jadx-$1-all.jar'
|
||||
}
|
||||
into layout.buildDirectory.dir("jadx")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
plugins {
|
||||
id 'application'
|
||||
|
||||
// use shadow only for application scripts, jar will be copied from jadx-gui
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -22,6 +25,13 @@ application {
|
||||
mainClass.set('jadx.cli.JadxCLI')
|
||||
applicationDefaultJvmArgs = ['-Xms128M', '-XX:MaxRAMPercentage=70.0', '-XX:+UseG1GC']
|
||||
}
|
||||
shadow {
|
||||
mainClassName = application.mainClass.get()
|
||||
}
|
||||
shadowJar {
|
||||
// shadow jar not needed
|
||||
configurations = []
|
||||
}
|
||||
|
||||
applicationDistribution.with {
|
||||
into('') {
|
||||
|
@ -74,6 +74,8 @@ public class JCommanderWrapper<T> {
|
||||
}
|
||||
|
||||
public void printUsage() {
|
||||
LogHelper.setLogLevel(LogHelper.LogLevelEnum.ERROR); // mute logger while printing help
|
||||
|
||||
// print usage in not sorted fields order (by default sorted by description)
|
||||
PrintStream out = System.out;
|
||||
out.println();
|
||||
|
@ -51,6 +51,11 @@ public class LogHelper {
|
||||
return args.logLevel;
|
||||
}
|
||||
|
||||
public static void setLogLevel(LogLevelEnum newLogLevel) {
|
||||
logLevelValue = newLogLevel;
|
||||
applyLogLevel(logLevelValue);
|
||||
}
|
||||
|
||||
public static void setLogLevelsForLoadingStage() {
|
||||
if (logLevelValue == null) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user