summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorGravatar liach2020-04-02 10:36:27 -0500
committerGravatar GitHub2020-04-02 16:36:27 +0100
commitccccfa1786d783867daf91fbfa522d4a5c55dfdb (patch)
treeb09cbde37e4757c993d59dfd70bfee81fbbd5e63 /build.gradle
parentMerge pull request #203 from Runemoro/fix-cfr (diff)
downloadenigma-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.tar.gz
enigma-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.tar.xz
enigma-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.zip
Support java 9+ and gradle 6+ (#206)
* Support java 9+ and gradle 6+ * Update asm Signed-off-by: liach <liach@users.noreply.github.com> * Use asm 8 and move that to a constant * Bump version * fix version format Co-authored-by: liach <liach@users.noreply.github.com>
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle25
1 files changed, 14 insertions, 11 deletions
diff --git a/build.gradle b/build.gradle
index 7d1e4196..34573cf0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,14 +19,12 @@ apply plugin: 'com.github.johnrengelman.shadow'
19apply plugin: 'maven' 19apply plugin: 'maven'
20 20
21group = 'cuchaz' 21group = 'cuchaz'
22version = '0.15' 22version = '0.15.1'
23 23
24def generatedSourcesDir = "$buildDir/generated-src" 24def generatedSourcesDir = "$buildDir/generated-src"
25 25
26def ENV = System.getenv() 26def ENV = System.getenv()
27if (ENV.BUILD_NUMBER) { 27version = version + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local")
28 version = version + "." + "${System.getenv().BUILD_NUMBER}"
29}
30 28
31sourceCompatibility = 1.8 29sourceCompatibility = 1.8
32targetCompatibility = 1.8 30targetCompatibility = 1.8
@@ -60,6 +58,9 @@ repositories {
60 ivy { 58 ivy {
61 name "darcula" 59 name "darcula"
62 artifactPattern "https://raw.githubusercontent.com/bulenkov/Darcula/master/build/[module].[ext]" 60 artifactPattern "https://raw.githubusercontent.com/bulenkov/Darcula/master/build/[module].[ext]"
61 metadataSources {
62 artifact()
63 }
63 } 64 }
64} 65}
65 66
@@ -73,10 +74,10 @@ configurations {
73dependencies { 74dependencies {
74 compile 'com.google.guava:guava:28.0-jre' 75 compile 'com.google.guava:guava:28.0-jre'
75 compile 'com.google.code.gson:gson:2.8.5' 76 compile 'com.google.code.gson:gson:2.8.5'
76 compile 'org.ow2.asm:asm:7.1' 77 compile 'org.ow2.asm:asm:8.0'
77 compile 'org.ow2.asm:asm-commons:7.1' 78 compile 'org.ow2.asm:asm-commons:8.0'
78 compile 'org.ow2.asm:asm-tree:7.1' 79 compile 'org.ow2.asm:asm-tree:8.0'
79 compile 'org.ow2.asm:asm-util:7.1' 80 compile 'org.ow2.asm:asm-util:8.0'
80 compile 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' 81 compile 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3'
81 82
82 compile 'net.fabricmc:procyon-fabric-compilertools:0.5.35.+' 83 compile 'net.fabricmc:procyon-fabric-compilertools:0.5.35.+'
@@ -88,9 +89,11 @@ dependencies {
88 89
89 testCompile 'junit:junit:4.+' 90 testCompile 'junit:junit:4.+'
90 testCompile 'org.hamcrest:hamcrest-all:1.+' 91 testCompile 'org.hamcrest:hamcrest-all:1.+'
91 proGuard 'net.sf.proguard:proguard-base:5.+' 92 proGuard 'net.sf.proguard:proguard-base:6.+'
92} 93}
93 94
95def libraryJarsArg = JavaVersion.current().java9Compatible ? "<java.home>/jmods": "<java.home>/lib/rt.jar"
96
94// For each set of test inputs, create an output jar and obfuscate it. 97// For each set of test inputs, create an output jar and obfuscate it.
95file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> 98file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile ->
96 if (theFile.directory) { 99 if (theFile.directory) {
@@ -110,8 +113,8 @@ file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile ->
110 classpath configurations.proGuard 113 classpath configurations.proGuard
111 114
112 args '@src/test/resources/proguard-test.conf', '-injars', file('build/test-inputs/' + 115 args '@src/test/resources/proguard-test.conf', '-injars', file('build/test-inputs/' +
113 "${theFile.name}.jar"), '-outjars', file('build/test-obf/' + 116 "${theFile.name}.jar"), '-libraryjars', libraryJarsArg,
114 "${theFile.name}.jar") 117 '-outjars', file('build/test-obf/' + "${theFile.name}.jar")
115 } 118 }
116 119
117 test.dependsOn "${theFile.name}TestObf" 120 test.dependsOn "${theFile.name}TestObf"