build.gradle 3.4 KB
Newer Older
S
Skylot 已提交
1
plugins {
S
Skylot 已提交
2
	id 'application'
S
Skylot 已提交
3
	id 'edu.sc.seis.launch4j' version '2.5.1'
S
Skylot 已提交
4
	id 'com.github.johnrengelman.shadow' version '7.1.1'
S
Skylot 已提交
5
	id 'org.beryx.runtime' version '1.12.7'
S
Skylot 已提交
6 7
}

S
Skylot 已提交
8
dependencies {
9
	implementation(project(':jadx-core'))
S
Skylot 已提交
10

11
	implementation(project(":jadx-cli"))
S
Skylot 已提交
12
	implementation 'com.beust:jcommander:1.81'
S
Skylot 已提交
13
	implementation 'ch.qos.logback:logback-classic:1.2.10'
14

S
Skylot 已提交
15
	implementation 'com.fifesoft:rsyntaxtextarea:3.1.4'
16 17
	implementation files('libs/jfontchooser-1.0.5.jar')
	implementation 'hu.kazocsaba:image-viewer:1.2.3'
18

S
Skylot 已提交
19 20 21 22
	implementation 'com.formdev:flatlaf:1.6.5'
	implementation 'com.formdev:flatlaf-intellij-themes:1.6.5'
	implementation 'com.formdev:flatlaf-extras:1.6.5'
	implementation 'com.formdev:svgSalamander:1.1.3'
23

S
Skylot 已提交
24
	implementation 'com.google.code.gson:gson:2.8.9'
S
Skylot 已提交
25
	implementation 'org.apache.commons:commons-lang3:3.12.0'
S
Skylot 已提交
26
	implementation 'org.apache.commons:commons-text:1.9'
27

S
Skylot 已提交
28
	implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
29
	implementation "com.github.akarnokd:rxjava2-swing:0.3.7"
S
Skylot 已提交
30
	implementation 'com.android.tools.build:apksig:4.2.1'
31
	implementation 'io.github.hqktech:jdwp:1.0'
S
Skylot 已提交
32 33 34
}

application {
S
Skylot 已提交
35
	applicationName = 'jadx-gui'
36
	mainClass.set('jadx.gui.JadxGUI')
S
Skylot 已提交
37 38 39
}

applicationDistribution.with {
S
Skylot 已提交
40 41 42 43 44 45
	into('') {
		from '../'
		include 'README.md'
		include 'NOTICE'
		include 'LICENSE'
	}
S
Skylot 已提交
46 47
}

48
jar {
S
Skylot 已提交
49 50
	manifest {
		attributes(
51
				"Main-Class": application.mainClass.get(),
52
				"Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ')
S
Skylot 已提交
53 54
		)
	}
S
Skylot 已提交
55 56
}

57 58 59
shadow {
	mainClassName = application.mainClass.get()
}
60 61 62 63
shadowJar {
	mergeServiceFiles()
}

S
Skylot 已提交
64
startScripts {
S
Skylot 已提交
65 66 67 68 69 70 71 72
	// The option -XX:+UseG1GC is only relevant for Java 8. Starting with Java 9 G1GC is already the default GC
	defaultJvmOpts = ['-Xms128M', '-Xmx4g', '-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true', '-XX:+UseG1GC']
	doLast {
		def str = windowsScript.text
		str = str.replaceAll('java.exe', 'javaw.exe')
		str = str.replaceAll('"%JAVA_EXE%" %DEFAULT_JVM_OPTS%', 'start "jadx-gui" /B "%JAVA_EXE%" %DEFAULT_JVM_OPTS%')
		windowsScript.text = str
	}
73 74
}

S
Skylot 已提交
75
launch4j {
76
	mainClassName = application.mainClass.get()
S
Skylot 已提交
77
	copyConfigurable = project.tasks.shadowJar.outputs.files
78
	jarTask = project.tasks.shadowJar
S
Skylot 已提交
79 80 81 82 83
	icon = "${projectDir}/src/main/resources/logos/jadx-logo.ico"
	outfile = "jadx-gui-${version}.exe"
	copyright = 'Skylot'
	windowTitle = 'jadx'
	companyName = 'jadx'
S
Skylot 已提交
84
	jreMinVersion = '11'
S
Skylot 已提交
85 86
	jvmOptions = ['-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true', '-XX:+UseG1GC']
	jreRuntimeBits = "64"
87
	bundledJre64Bit = true
S
Skylot 已提交
88 89 90
	initialHeapPercent = 5
	maxHeapSize = 4096
	maxHeapPercent = 70
S
Skylot 已提交
91
	downloadUrl = 'https://www.oracle.com/java/technologies/downloads/#jdk17-windows'
S
Skylot 已提交
92
	bundledJrePath = project.hasProperty("bundleJRE") ? '%EXEDIR%/jre' : '%JAVA_HOME%'
S
Skylot 已提交
93
}
S
Skylot 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

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
		targetPlatformName = "win"
	}
	launcher {
		noConsole = true
	}
}

S
Skylot 已提交
113
task distWinWithJre(type: Zip, dependsOn: ['runtime', 'createExe']) {
S
Skylot 已提交
114 115 116 117 118 119 120 121 122 123 124 125
	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
}