summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle14
-rw-r--r--enigma-cli/build.gradle10
-rw-r--r--enigma-swing/build.gradle10
-rw-r--r--enigma/build.gradle23
-rw-r--r--gradle.properties1
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin63721 -> 45457 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rwxr-xr-xgradlew14
-rw-r--r--gradlew.bat26
9 files changed, 48 insertions, 52 deletions
diff --git a/build.gradle b/build.gradle
index 9f311844..caf78f1c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
1plugins { 1plugins {
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.
92task checkVersion { 92tasks.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 05e644e1..7bffb216 100644
--- a/enigma-cli/build.gradle
+++ b/enigma-cli/build.gradle
@@ -1,6 +1,6 @@
1plugins { 1plugins {
2 id 'application' 2 id 'application'
3 id 'com.github.johnrengelman.shadow' 3 id 'com.gradleup.shadow'
4} 4}
5 5
6dependencies { 6dependencies {
@@ -13,10 +13,4 @@ application {
13 13
14jar.manifest.attributes 'Main-Class': application.mainClass.get() 14jar.manifest.attributes 'Main-Class': application.mainClass.get()
15 15
16publishing { 16test.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 452df5e7..8a8d6793 100644
--- a/enigma-swing/build.gradle
+++ b/enigma-swing/build.gradle
@@ -1,6 +1,6 @@
1plugins { 1plugins {
2 id 'application' 2 id 'application'
3 id 'com.github.johnrengelman.shadow' 3 id 'com.gradleup.shadow'
4} 4}
5 5
6def flatLafNatives = [ 6def flatLafNatives = [
@@ -31,11 +31,3 @@ application {
31} 31}
32 32
33jar.manifest.attributes 'Main-Class': application.mainClass.get() 33jar.manifest.attributes 'Main-Class': application.mainClass.get()
34
35publishing {
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 6bbb200f..e92052f4 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
22ext.genOutputDir = file("$buildDir/generated-resources") 22def genOutputDir = layout.buildDirectory.dir('generated-resources').get().asFile
23 23
24task generateResources { 24tasks.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
46file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> 51file('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 00000000..5ad69748
--- /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 7f93135c..8bdaf60c 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 3fa8f862..2a84e188 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
1distributionBase=GRADLE_USER_HOME 1distributionBase=GRADLE_USER_HOME
2distributionPath=wrapper/dists 2distributionPath=wrapper/dists
3distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 3distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4networkTimeout=10000 4networkTimeout=10000
5validateDistributionUrl=true 5validateDistributionUrl=true
6zipStoreBase=GRADLE_USER_HOME 6zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index 1aa94a42..ef07e016 100755
--- a/gradlew
+++ b/gradlew
@@ -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
85APP_BASE_NAME=${0##*/} 87APP_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)
87APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 89APP_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.
90MAX_FD=maximum 92MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
112 NONSTOP* ) nonstop=true ;; 114 NONSTOP* ) nonstop=true ;;
113esac 115esac
114 116
115CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 117CLASSPATH="\\\"\\\""
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
203DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 205DEFAULT_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"'
211set -- \ 213set -- \
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 93e3f59f..db3a6ac2 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
44if %ERRORLEVEL% equ 0 goto execute 46if %ERRORLEVEL% equ 0 goto execute
45 47
46echo. 48echo. 1>&2
47echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 49echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48echo. 50echo. 1>&2
49echo Please set the JAVA_HOME variable in your environment to match the 51echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50echo location of your Java installation. 52echo location of your Java installation. 1>&2
51 53
52goto fail 54goto fail
53 55
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 59
58if exist "%JAVA_EXE%" goto execute 60if exist "%JAVA_EXE%" goto execute
59 61
60echo. 62echo. 1>&2
61echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 63echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62echo. 64echo. 1>&2
63echo Please set the JAVA_HOME variable in your environment to match the 65echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64echo location of your Java installation. 66echo location of your Java installation. 1>&2
65 67
66goto fail 68goto fail
67 69
68:execute 70:execute
69@rem Setup the command line 71@rem Setup the command line
70 72
71set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73set 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