From c675acfff352e37bf7dec102437b47d3c8c5a52d Mon Sep 17 00:00:00 2001 From: modmuss Date: Sun, 19 Nov 2023 14:43:06 +0000 Subject: Update deps (#535) --- .github/workflows/build.yml | 6 +- .github/workflows/release.yml | 4 +- build.gradle | 17 +-- enigma-cli/build.gradle | 8 +- enigma-server/build.gradle | 6 +- enigma-swing/build.gradle | 23 +++- enigma/build.gradle | 10 +- gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 63721 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 29 +++-- gradlew.bat | 184 +++++++++++++++---------------- 11 files changed, 154 insertions(+), 136 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2fbb3a6..64108e6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,13 +4,13 @@ jobs: build: strategy: matrix: - java: [ 17-jdk, 19-jdk ] + java: [ 17-ubuntu, 21-ubuntu ] runs-on: ubuntu-22.04 container: - image: eclipse-temurin:${{ matrix.java }} + image: mcr.microsoft.com/openjdk/jdk:${{ matrix.java }} options: --user root steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: ./gradlew build --stacktrace --warning-mode fail - uses: Juuxel/publish-checkstyle-report@v1 if: ${{ failure() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87fd901a..5a5d0b4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,10 +4,10 @@ jobs: build: runs-on: ubuntu-22.04 container: - image: eclipse-temurin:19-jdk + image: mcr.microsoft.com/openjdk/jdk:21-ubuntu options: --user root steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: ./gradlew checkVersion build publish --stacktrace env: MAVEN_URL: ${{ secrets.MAVEN_URL }} diff --git a/build.gradle b/build.gradle index 08ccffe8..58cb0bad 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'maven-publish' + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false } subprojects { @@ -7,9 +8,6 @@ subprojects { apply plugin: 'maven-publish' apply plugin: 'checkstyle' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - repositories { mavenLocal() mavenCentral() @@ -17,8 +15,8 @@ subprojects { } dependencies { - implementation 'com.google.guava:guava:30.1.1-jre' - implementation 'com.google.code.gson:gson:2.8.7' + implementation 'com.google.guava:guava:32.1.2-jre' + implementation 'com.google.code.gson:gson:2.10.1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.hamcrest:hamcrest:2.2' @@ -29,13 +27,10 @@ subprojects { version = version + (System.getenv("GITHUB_ACTIONS") ? "" : "+local") - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource - } - java { withSourcesJar() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks.withType(JavaCompile).configureEach { @@ -46,7 +41,7 @@ subprojects { checkstyle { configFile = rootProject.file('checkstyle.xml') - toolVersion = '10.3.3' + toolVersion = '10.12.4' } publishing { diff --git a/enigma-cli/build.gradle b/enigma-cli/build.gradle index 5281e9e6..05e644e1 100644 --- a/enigma-cli/build.gradle +++ b/enigma-cli/build.gradle @@ -1,15 +1,17 @@ plugins { id 'application' - id 'com.github.johnrengelman.shadow' version '7.0.0' + id 'com.github.johnrengelman.shadow' } dependencies { implementation project(':enigma') } -mainClassName = 'cuchaz.enigma.command.Main' +application { + mainClass = 'cuchaz.enigma.command.Main' +} -jar.manifest.attributes 'Main-Class': mainClassName +jar.manifest.attributes 'Main-Class': application.mainClass.get() publishing { publications { diff --git a/enigma-server/build.gradle b/enigma-server/build.gradle index 873adb90..0daa490e 100644 --- a/enigma-server/build.gradle +++ b/enigma-server/build.gradle @@ -7,6 +7,8 @@ dependencies { implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' } -mainClassName = 'cuchaz.enigma.network.DedicatedEnigmaServer' +application { + mainClass = 'cuchaz.enigma.network.DedicatedEnigmaServer' +} -jar.manifest.attributes 'Main-Class': mainClassName +jar.manifest.attributes 'Main-Class': application.mainClass.get() diff --git a/enigma-swing/build.gradle b/enigma-swing/build.gradle index fff4dafe..452df5e7 100644 --- a/enigma-swing/build.gradle +++ b/enigma-swing/build.gradle @@ -1,23 +1,36 @@ plugins { id 'application' - id 'com.github.johnrengelman.shadow' version '7.0.0' + id 'com.github.johnrengelman.shadow' } +def flatLafNatives = [ + "windows-arm64@dll", + "windows-x86@dll", + "windows-x86_64@dll", + "linux-x86_64@so", +] + dependencies { implementation project(':enigma') implementation project(':enigma-server') implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' - implementation 'com.formdev:flatlaf:2.6' - implementation 'com.formdev:flatlaf-extras:2.6' // for SVG icons + implementation 'com.formdev:flatlaf:3.2.5' + implementation 'com.formdev:flatlaf-extras:3.2.5' // for SVG icons implementation 'de.sciss:syntaxpane:1.2.1' implementation 'com.github.lukeu:swing-dpi:0.10' implementation 'org.drjekyll:fontchooser:2.5.2' + + flatLafNatives.forEach { + implementation 'com.formdev:flatlaf:3.2.5:' + it + } } -mainClassName = 'cuchaz.enigma.gui.Main' +application { + mainClass = 'cuchaz.enigma.gui.Main' +} -jar.manifest.attributes 'Main-Class': mainClassName +jar.manifest.attributes 'Main-Class': application.mainClass.get() publishing { publications { diff --git a/enigma/build.gradle b/enigma/build.gradle index 8cbfec28..cabea135 100644 --- a/enigma/build.gradle +++ b/enigma/build.gradle @@ -3,15 +3,15 @@ configurations { } dependencies { - implementation 'org.ow2.asm:asm:9.4' - implementation 'org.ow2.asm:asm-commons:9.4' - implementation 'org.ow2.asm:asm-tree:9.4' - implementation 'org.ow2.asm:asm-util:9.4' + implementation 'org.ow2.asm:asm:9.6' + implementation 'org.ow2.asm:asm-commons:9.6' + implementation 'org.ow2.asm:asm-tree:9.6' + implementation 'org.ow2.asm:asm-util:9.6' implementation 'org.bitbucket.mstrobel:procyon-compilertools:0.6.0' implementation 'net.fabricmc:cfr:0.2.1' - proGuard 'com.guardsquare:proguard-base:7.3.0' + proGuard 'com.guardsquare:proguard-base:7.4.0-beta02' testImplementation 'com.google.jimfs:jimfs:1.2' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbf..7f93135c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c..3fa8f862 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..93e3f59f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega -- cgit v1.2.3