diff options
| -rw-r--r-- | build.gradle | 14 | ||||
| -rw-r--r-- | enigma-cli/build.gradle | 10 | ||||
| -rw-r--r-- | enigma-swing/build.gradle | 10 | ||||
| -rw-r--r-- | enigma/build.gradle | 23 | ||||
| -rw-r--r-- | gradle.properties | 1 | ||||
| -rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 63721 -> 45457 bytes | |||
| -rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 | ||||
| -rwxr-xr-x | gradlew | 14 | ||||
| -rw-r--r-- | gradlew.bat | 26 |
9 files changed, 48 insertions, 52 deletions
diff --git a/build.gradle b/build.gradle index 9f31184..caf78f1 100644 --- a/build.gradle +++ b/build.gradle | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | plugins { | 1 | plugins { |
| 2 | id 'maven-publish' | 2 | id 'maven-publish' |
| 3 | id 'com.github.johnrengelman.shadow' version '8.1.1' apply false | 3 | id 'com.gradleup.shadow' version '8.3.9' apply false |
| 4 | id 'com.diffplug.spotless' version '7.2.1' | 4 | id 'com.diffplug.spotless' version '7.2.1' |
| 5 | } | 5 | } |
| 6 | 6 | ||
| @@ -13,7 +13,7 @@ subprojects { | |||
| 13 | repositories { | 13 | repositories { |
| 14 | mavenLocal() | 14 | mavenLocal() |
| 15 | mavenCentral() | 15 | mavenCentral() |
| 16 | maven { url 'https://maven.fabricmc.net/' } | 16 | maven { url = 'https://maven.fabricmc.net/' } |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | dependencies { | 19 | dependencies { |
| @@ -60,9 +60,9 @@ subprojects { | |||
| 60 | publishing { | 60 | publishing { |
| 61 | publications { | 61 | publications { |
| 62 | "$project.name"(MavenPublication) { | 62 | "$project.name"(MavenPublication) { |
| 63 | groupId project.group | 63 | groupId = project.group |
| 64 | artifactId project.name | 64 | artifactId = project.name |
| 65 | version project.version | 65 | version = project.version |
| 66 | from components.java | 66 | from components.java |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| @@ -89,10 +89,10 @@ allprojects { | |||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | // A task to ensure that the version being released has not already been released. | 91 | // A task to ensure that the version being released has not already been released. |
| 92 | task checkVersion { | 92 | tasks.register('checkVersion') { |
| 93 | doFirst { | 93 | doFirst { |
| 94 | def xml = new URL("https://maven.fabricmc.net/cuchaz/enigma/maven-metadata.xml").text | 94 | def xml = new URL("https://maven.fabricmc.net/cuchaz/enigma/maven-metadata.xml").text |
| 95 | def metadata = new XmlSlurper().parseText(xml) | 95 | def metadata = new groovy.xml.XmlSlurper().parseText(xml) |
| 96 | def versions = metadata.versioning.versions.version*.text(); | 96 | def versions = metadata.versioning.versions.version*.text(); |
| 97 | if (versions.contains(version)) { | 97 | if (versions.contains(version)) { |
| 98 | throw new RuntimeException("${version} has already been released!") | 98 | throw new RuntimeException("${version} has already been released!") |
diff --git a/enigma-cli/build.gradle b/enigma-cli/build.gradle index 05e644e..7bffb21 100644 --- a/enigma-cli/build.gradle +++ b/enigma-cli/build.gradle | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | plugins { | 1 | plugins { |
| 2 | id 'application' | 2 | id 'application' |
| 3 | id 'com.github.johnrengelman.shadow' | 3 | id 'com.gradleup.shadow' |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | dependencies { | 6 | dependencies { |
| @@ -13,10 +13,4 @@ application { | |||
| 13 | 13 | ||
| 14 | jar.manifest.attributes 'Main-Class': application.mainClass.get() | 14 | jar.manifest.attributes 'Main-Class': application.mainClass.get() |
| 15 | 15 | ||
| 16 | publishing { | 16 | test.dependsOn project(':enigma').tasks.named('packageAccessTestObf') |
| 17 | publications { | ||
| 18 | shadow(MavenPublication) { publication -> | ||
| 19 | project.shadow.component publication | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
diff --git a/enigma-swing/build.gradle b/enigma-swing/build.gradle index 452df5e..8a8d679 100644 --- a/enigma-swing/build.gradle +++ b/enigma-swing/build.gradle | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | plugins { | 1 | plugins { |
| 2 | id 'application' | 2 | id 'application' |
| 3 | id 'com.github.johnrengelman.shadow' | 3 | id 'com.gradleup.shadow' |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | def flatLafNatives = [ | 6 | def flatLafNatives = [ |
| @@ -31,11 +31,3 @@ application { | |||
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | jar.manifest.attributes 'Main-Class': application.mainClass.get() | 33 | jar.manifest.attributes 'Main-Class': application.mainClass.get() |
| 34 | |||
| 35 | publishing { | ||
| 36 | publications { | ||
| 37 | shadow(MavenPublication) { publication -> | ||
| 38 | publication.from components.java | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } \ No newline at end of file | ||
diff --git a/enigma/build.gradle b/enigma/build.gradle index 6bbb200..e92052f 100644 --- a/enigma/build.gradle +++ b/enigma/build.gradle | |||
| @@ -19,15 +19,20 @@ dependencies { | |||
| 19 | 19 | ||
| 20 | // Generate "version.txt" file | 20 | // Generate "version.txt" file |
| 21 | 21 | ||
| 22 | ext.genOutputDir = file("$buildDir/generated-resources") | 22 | def genOutputDir = layout.buildDirectory.dir('generated-resources').get().asFile |
| 23 | 23 | ||
| 24 | task generateResources { | 24 | tasks.register('generateResources') { |
| 25 | ext.versionFile = file("$genOutputDir/version.txt") | 25 | def langDir = file('src/main/resources/lang') |
| 26 | ext.langsFile = file("$genOutputDir/lang/index.txt") | 26 | inputs.dir(langDir) |
| 27 | inputs.property 'version', project.version | ||
| 28 | |||
| 29 | def versionFile = file("$genOutputDir/version.txt") | ||
| 30 | def langsFile = file("$genOutputDir/lang/index.txt") | ||
| 27 | outputs.files(versionFile, langsFile) | 31 | outputs.files(versionFile, langsFile) |
| 32 | |||
| 28 | doLast { | 33 | doLast { |
| 29 | versionFile.text = "${project.version}" | 34 | versionFile.text = inputs.properties.version |
| 30 | langsFile.text = file("$projectDir/src/main/resources/lang") | 35 | langsFile.text = langDir |
| 31 | .listFiles() | 36 | .listFiles() |
| 32 | .collect { it.name } | 37 | .collect { it.name } |
| 33 | .findAll { it.endsWith(".json") } | 38 | .findAll { it.endsWith(".json") } |
| @@ -45,7 +50,7 @@ def libraryJarsArg = "<java.home>/jmods" | |||
| 45 | // If your test fails for class file version problem with proguard, run gradle with -Dorg.gradle.java.home="<older jdk>" flag | 50 | // If your test fails for class file version problem with proguard, run gradle with -Dorg.gradle.java.home="<older jdk>" flag |
| 46 | file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> | 51 | file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> |
| 47 | if (theFile.directory) { | 52 | if (theFile.directory) { |
| 48 | task("${theFile.name}TestJar", type: Jar) { | 53 | tasks.register("${theFile.name}TestJar", Jar) { |
| 49 | from(sourceSets.test.output) { | 54 | from(sourceSets.test.output) { |
| 50 | include "cuchaz/enigma/inputs/$theFile.name/**/*.class" | 55 | include "cuchaz/enigma/inputs/$theFile.name/**/*.class" |
| 51 | include 'cuchaz/enigma/inputs/Keep.class' | 56 | include 'cuchaz/enigma/inputs/Keep.class' |
| @@ -55,8 +60,8 @@ file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> | |||
| 55 | destinationDirectory = file('build/test-inputs') | 60 | destinationDirectory = file('build/test-inputs') |
| 56 | } | 61 | } |
| 57 | 62 | ||
| 58 | task("${theFile.name}TestObf", type: JavaExec, | 63 | tasks.register("${theFile.name}TestObf", JavaExec) { |
| 59 | dependsOn: "${theFile.name}TestJar") { | 64 | dependsOn "${theFile.name}TestJar" |
| 60 | mainClass = 'proguard.ProGuard' | 65 | mainClass = 'proguard.ProGuard' |
| 61 | classpath configurations.proGuard | 66 | classpath configurations.proGuard |
| 62 | 67 | ||
diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..5ad6974 --- /dev/null +++ b/gradle.properties | |||
| @@ -0,0 +1 @@ | |||
| org.gradle.configuration-cache=true | |||
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..8bdaf60 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 3fa8f86..2a84e18 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | distributionBase=GRADLE_USER_HOME | 1 | distributionBase=GRADLE_USER_HOME |
| 2 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
| 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip |
| 4 | networkTimeout=10000 | 4 | networkTimeout=10000 |
| 5 | validateDistributionUrl=true | 5 | validateDistributionUrl=true |
| 6 | zipStoreBase=GRADLE_USER_HOME | 6 | zipStoreBase=GRADLE_USER_HOME |
| @@ -1,7 +1,7 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # | 3 | # |
| 4 | # Copyright © 2015-2021 the original authors. | 4 | # Copyright © 2015 the original authors. |
| 5 | # | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 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. |
| @@ -15,6 +15,8 @@ | |||
| 15 | # See the License for the specific language governing permissions and | 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. | 16 | # limitations under the License. |
| 17 | # | 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 | ||
| 19 | # | ||
| 18 | 20 | ||
| 19 | ############################################################################## | 21 | ############################################################################## |
| 20 | # | 22 | # |
| @@ -55,7 +57,7 @@ | |||
| 55 | # Darwin, MinGW, and NonStop. | 57 | # Darwin, MinGW, and NonStop. |
| 56 | # | 58 | # |
| 57 | # (3) This script is generated from the Groovy template | 59 | # (3) This script is generated from the Groovy template |
| 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
| 59 | # within the Gradle project. | 61 | # within the Gradle project. |
| 60 | # | 62 | # |
| 61 | # You can find Gradle at https://github.com/gradle/gradle/. | 63 | # You can find Gradle at https://github.com/gradle/gradle/. |
| @@ -84,7 +86,7 @@ done | |||
| 84 | # shellcheck disable=SC2034 | 86 | # shellcheck disable=SC2034 |
| 85 | APP_BASE_NAME=${0##*/} | 87 | APP_BASE_NAME=${0##*/} |
| 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) | 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
| 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit | 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit |
| 88 | 90 | ||
| 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
| 90 | MAX_FD=maximum | 92 | MAX_FD=maximum |
| @@ -112,7 +114,7 @@ case "$( uname )" in #( | |||
| 112 | NONSTOP* ) nonstop=true ;; | 114 | NONSTOP* ) nonstop=true ;; |
| 113 | esac | 115 | esac |
| 114 | 116 | ||
| 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | 117 | CLASSPATH="\\\"\\\"" |
| 116 | 118 | ||
| 117 | 119 | ||
| 118 | # Determine the Java command to use to start the JVM. | 120 | # Determine the Java command to use to start the JVM. |
| @@ -203,7 +205,7 @@ fi | |||
| 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | 205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
| 204 | 206 | ||
| 205 | # Collect all arguments for the java command: | 207 | # Collect all arguments for the java command: |
| 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, | 208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, |
| 207 | # and any embedded shellness will be escaped. | 209 | # and any embedded shellness will be escaped. |
| 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be | 210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be |
| 209 | # treated as '${Hostname}' itself on the command line. | 211 | # treated as '${Hostname}' itself on the command line. |
| @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | |||
| 211 | set -- \ | 213 | set -- \ |
| 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ | 214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ |
| 213 | -classpath "$CLASSPATH" \ | 215 | -classpath "$CLASSPATH" \ |
| 214 | org.gradle.wrapper.GradleWrapperMain \ | 216 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ |
| 215 | "$@" | 217 | "$@" |
| 216 | 218 | ||
| 217 | # Stop when "xargs" is not available. | 219 | # Stop when "xargs" is not available. |
diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..db3a6ac 100644 --- a/gradlew.bat +++ b/gradlew.bat | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | @rem See the License for the specific language governing permissions and | 13 | @rem See the License for the specific language governing permissions and |
| 14 | @rem limitations under the License. | 14 | @rem limitations under the License. |
| 15 | @rem | 15 | @rem |
| 16 | @rem SPDX-License-Identifier: Apache-2.0 | ||
| 17 | @rem | ||
| 16 | 18 | ||
| 17 | @if "%DEBUG%"=="" @echo off | 19 | @if "%DEBUG%"=="" @echo off |
| 18 | @rem ########################################################################## | 20 | @rem ########################################################################## |
| @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe | |||
| 43 | %JAVA_EXE% -version >NUL 2>&1 | 45 | %JAVA_EXE% -version >NUL 2>&1 |
| 44 | if %ERRORLEVEL% equ 0 goto execute | 46 | if %ERRORLEVEL% equ 0 goto execute |
| 45 | 47 | ||
| 46 | echo. | 48 | echo. 1>&2 |
| 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 |
| 48 | echo. | 50 | echo. 1>&2 |
| 49 | echo Please set the JAVA_HOME variable in your environment to match the | 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 |
| 50 | echo location of your Java installation. | 52 | echo location of your Java installation. 1>&2 |
| 51 | 53 | ||
| 52 | goto fail | 54 | goto fail |
| 53 | 55 | ||
| @@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe | |||
| 57 | 59 | ||
| 58 | if exist "%JAVA_EXE%" goto execute | 60 | if exist "%JAVA_EXE%" goto execute |
| 59 | 61 | ||
| 60 | echo. | 62 | echo. 1>&2 |
| 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 |
| 62 | echo. | 64 | echo. 1>&2 |
| 63 | echo Please set the JAVA_HOME variable in your environment to match the | 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 |
| 64 | echo location of your Java installation. | 66 | echo location of your Java installation. 1>&2 |
| 65 | 67 | ||
| 66 | goto fail | 68 | goto fail |
| 67 | 69 | ||
| 68 | :execute | 70 | :execute |
| 69 | @rem Setup the command line | 71 | @rem Setup the command line |
| 70 | 72 | ||
| 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | 73 | set CLASSPATH= |
| 72 | 74 | ||
| 73 | 75 | ||
| 74 | @rem Execute Gradle | 76 | @rem Execute Gradle |
| 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* | 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* |
| 76 | 78 | ||
| 77 | :end | 79 | :end |
| 78 | @rem End local scope for the variables with windows NT shell | 80 | @rem End local scope for the variables with windows NT shell |