summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml15
-rw-r--r--.github/workflows/release.yml16
-rw-r--r--Jenkinsfile25
-rw-r--r--build.gradle36
-rw-r--r--enigma/build.gradle8
-rw-r--r--enigma/src/main/java/cuchaz/enigma/Enigma.java2
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin55616 -> 58694 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rwxr-xr-xgradlew35
-rw-r--r--gradlew.bat5
10 files changed, 85 insertions, 59 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..5aa1cd4
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,15 @@
1name: Build
2on: [push, pull_request]
3jobs:
4 build:
5 strategy:
6 matrix:
7 java: [8-jdk, 11-jdk]
8 runs-on: ubuntu-20.04
9 container:
10 image: openjdk:${{ matrix.java }}
11 options: --user root
12 steps:
13 - uses: actions/checkout@v1
14 - uses: gradle/wrapper-validation-action@v1
15 - run: ./gradlew build --stacktrace
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..8c221f6
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,16 @@
1name: Release
2on: [workflow_dispatch] # Manual trigger
3jobs:
4 build:
5 runs-on: ubuntu-20.04
6 container:
7 image: openjdk:11-jdk
8 options: --user root
9 steps:
10 - uses: actions/checkout@v1
11 - uses: gradle/wrapper-validation-action@v1
12 - run: ./gradlew checkVersion build publish --stacktrace
13 env:
14 MAVEN_URL: ${{ secrets.MAVEN_URL }}
15 MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
16 MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} \ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index f1d1626..0000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,25 +0,0 @@
1pipeline {
2 agent any
3 stages {
4
5 stage ('Build') {
6 steps {
7 sh "chmod +x gradlew"
8 sh "./gradlew clean build"
9
10 archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true
11 }
12 }
13
14 stage ('Archive artifacts') {
15 //Only publish to maven when on master branch
16 when {
17 branch 'master'
18 }
19 steps {
20 sh "./gradlew publish"
21 }
22 }
23
24 }
25}
diff --git a/build.gradle b/build.gradle
index a2a735b..0e0e4cf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,10 +24,9 @@ subprojects {
24 } 24 }
25 25
26 group = 'cuchaz' 26 group = 'cuchaz'
27 version = '0.21.6' 27 version = '0.21.7'
28 28
29 def buildNumber = System.getenv("BUILD_NUMBER") 29 version = version + (System.getenv("GITHUB_ACTIONS") ? "" : "+local")
30 version = version + "+" + (buildNumber ? "build.$buildNumber" : "local")
31 30
32 task sourcesJar(type: Jar, dependsOn: classes) { 31 task sourcesJar(type: Jar, dependsOn: classes) {
33 classifier = 'sources' 32 classifier = 'sources'
@@ -38,6 +37,14 @@ subprojects {
38 withSourcesJar() 37 withSourcesJar()
39 } 38 }
40 39
40 tasks.withType(JavaCompile).configureEach {
41 it.options.encoding = "UTF-8"
42
43 if (JavaVersion.current().isJava9Compatible()) {
44 it.options.release = 8
45 }
46 }
47
41 publishing { 48 publishing {
42 publications { 49 publications {
43 "$project.name"(MavenPublication) { 50 "$project.name"(MavenPublication) {
@@ -55,15 +62,30 @@ allprojects {
55 repositories { 62 repositories {
56 mavenLocal() 63 mavenLocal()
57 64
58 if (project.hasProperty('mavenPass')) { 65 def ENV = System.getenv()
66 if (ENV.MAVEN_URL) {
59 maven { 67 maven {
60 url = "http://mavenupload.modmuss50.me/" 68 url ENV.MAVEN_URL
61 credentials { 69 credentials {
62 username = "buildslave" 70 username ENV.MAVEN_USERNAME
63 password = project.getProperty('mavenPass') 71 password ENV.MAVEN_PASSWORD
64 } 72 }
65 } 73 }
66 } 74 }
67 } 75 }
68 } 76 }
69} 77}
78
79// A task to ensure that the version being released has not already been released.
80task checkVersion {
81 doFirst {
82 def xml = new URL("https://maven.fabricmc.net/cuchaz/enigma/maven-metadata.xml").text
83 def metadata = new XmlSlurper().parseText(xml)
84 def versions = metadata.versioning.versions.version*.text();
85 if (versions.contains(version)) {
86 throw new RuntimeException("${version} has already been released!")
87 }
88 }
89}
90
91publish.mustRunAfter checkVersion \ No newline at end of file
diff --git a/enigma/build.gradle b/enigma/build.gradle
index 7cebcd1..19f8d16 100644
--- a/enigma/build.gradle
+++ b/enigma/build.gradle
@@ -3,10 +3,10 @@ configurations {
3} 3}
4 4
5dependencies { 5dependencies {
6 implementation 'org.ow2.asm:asm:8.0' 6 implementation 'org.ow2.asm:asm:9.0'
7 implementation 'org.ow2.asm:asm-commons:8.0' 7 implementation 'org.ow2.asm:asm-commons:9.0'
8 implementation 'org.ow2.asm:asm-tree:8.0' 8 implementation 'org.ow2.asm:asm-tree:9.0'
9 implementation 'org.ow2.asm:asm-util:8.0' 9 implementation 'org.ow2.asm:asm-util:9.0'
10 10
11 implementation 'net.fabricmc:procyon-fabric-compilertools:0.5.35.13' 11 implementation 'net.fabricmc:procyon-fabric-compilertools:0.5.35.13'
12 implementation 'net.fabricmc:cfr:0.0.1' 12 implementation 'net.fabricmc:cfr:0.0.1'
diff --git a/enigma/src/main/java/cuchaz/enigma/Enigma.java b/enigma/src/main/java/cuchaz/enigma/Enigma.java
index d100a75..a37f074 100644
--- a/enigma/src/main/java/cuchaz/enigma/Enigma.java
+++ b/enigma/src/main/java/cuchaz/enigma/Enigma.java
@@ -38,7 +38,7 @@ public class Enigma {
38 public static final String NAME = "Enigma"; 38 public static final String NAME = "Enigma";
39 public static final String VERSION; 39 public static final String VERSION;
40 public static final String URL = "https://fabricmc.net"; 40 public static final String URL = "https://fabricmc.net";
41 public static final int ASM_VERSION = Opcodes.ASM8; 41 public static final int ASM_VERSION = Opcodes.ASM9;
42 42
43 private final EnigmaProfile profile; 43 private final EnigmaProfile profile;
44 private final EnigmaServices services; 44 private final EnigmaServices services;
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 5c2d1cf..490fda8 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 6623300..4d9ca16 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
1distributionBase=GRADLE_USER_HOME 1distributionBase=GRADLE_USER_HOME
2distributionPath=wrapper/dists 2distributionPath=wrapper/dists
3distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip 3distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
4zipStoreBase=GRADLE_USER_HOME 4zipStoreBase=GRADLE_USER_HOME
5zipStorePath=wrapper/dists 5zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index b0d6d0a..2fe81a7 100755
--- a/gradlew
+++ b/gradlew
@@ -7,7 +7,7 @@
7# you may not use this file except in compliance with the License. 7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at 8# You may obtain a copy of the License at
9# 9#
10# http://www.apache.org/licenses/LICENSE-2.0 10# https://www.apache.org/licenses/LICENSE-2.0
11# 11#
12# Unless required by applicable law or agreed to in writing, software 12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, 13# distributed under the License is distributed on an "AS IS" BASIS,
@@ -125,8 +125,8 @@ if $darwin; then
125 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 125 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126fi 126fi
127 127
128# For Cygwin, switch paths to Windows format before running java 128# For Cygwin or MSYS, switch paths to Windows format before running java
129if $cygwin ; then 129if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 APP_HOME=`cygpath --path --mixed "$APP_HOME"` 130 APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 131 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 JAVACMD=`cygpath --unix "$JAVACMD"` 132 JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -154,19 +154,19 @@ if $cygwin ; then
154 else 154 else
155 eval `echo args$i`="\"$arg\"" 155 eval `echo args$i`="\"$arg\""
156 fi 156 fi
157 i=$((i+1)) 157 i=`expr $i + 1`
158 done 158 done
159 case $i in 159 case $i in
160 (0) set -- ;; 160 0) set -- ;;
161 (1) set -- "$args0" ;; 161 1) set -- "$args0" ;;
162 (2) set -- "$args0" "$args1" ;; 162 2) set -- "$args0" "$args1" ;;
163 (3) set -- "$args0" "$args1" "$args2" ;; 163 3) set -- "$args0" "$args1" "$args2" ;;
164 (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 164 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 165 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 166 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 167 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 168 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 169 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 esac 170 esac
171fi 171fi
172 172
@@ -175,14 +175,9 @@ save () {
175 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 175 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 echo " " 176 echo " "
177} 177}
178APP_ARGS=$(save "$@") 178APP_ARGS=`save "$@"`
179 179
180# Collect all arguments for the java command, following the shell quoting and substitution rules 180# Collect all arguments for the java command, following the shell quoting and substitution rules
181eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 181eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 182
183# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 cd "$(dirname "$0")"
186fi
187
188exec "$JAVACMD" "$@" 183exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 9991c50..62bd9b9 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -5,7 +5,7 @@
5@rem you may not use this file except in compliance with the License. 5@rem you may not use this file except in compliance with the License.
6@rem You may obtain a copy of the License at 6@rem You may obtain a copy of the License at
7@rem 7@rem
8@rem http://www.apache.org/licenses/LICENSE-2.0 8@rem https://www.apache.org/licenses/LICENSE-2.0
9@rem 9@rem
10@rem Unless required by applicable law or agreed to in writing, software 10@rem Unless required by applicable law or agreed to in writing, software
11@rem distributed under the License is distributed on an "AS IS" BASIS, 11@rem distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
29set APP_BASE_NAME=%~n0 29set APP_BASE_NAME=%~n0
30set APP_HOME=%DIRNAME% 30set APP_HOME=%DIRNAME%
31 31
32@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
32@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 35@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 36set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 37