diff options
| -rw-r--r-- | .github/workflows/build.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 4 | ||||
| -rw-r--r-- | build.gradle | 17 | ||||
| -rw-r--r-- | enigma-cli/build.gradle | 8 | ||||
| -rw-r--r-- | enigma-server/build.gradle | 6 | ||||
| -rw-r--r-- | enigma-swing/build.gradle | 23 | ||||
| -rw-r--r-- | enigma/build.gradle | 10 | ||||
| -rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 61574 -> 63721 bytes | |||
| -rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 3 | ||||
| -rwxr-xr-x | gradlew | 29 | ||||
| -rw-r--r-- | gradlew.bat | 184 |
11 files changed, 154 insertions, 136 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2fbb3a..64108e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml | |||
| @@ -4,13 +4,13 @@ jobs: | |||
| 4 | build: | 4 | build: |
| 5 | strategy: | 5 | strategy: |
| 6 | matrix: | 6 | matrix: |
| 7 | java: [ 17-jdk, 19-jdk ] | 7 | java: [ 17-ubuntu, 21-ubuntu ] |
| 8 | runs-on: ubuntu-22.04 | 8 | runs-on: ubuntu-22.04 |
| 9 | container: | 9 | container: |
| 10 | image: eclipse-temurin:${{ matrix.java }} | 10 | image: mcr.microsoft.com/openjdk/jdk:${{ matrix.java }} |
| 11 | options: --user root | 11 | options: --user root |
| 12 | steps: | 12 | steps: |
| 13 | - uses: actions/checkout@v3 | 13 | - uses: actions/checkout@v4 |
| 14 | - run: ./gradlew build --stacktrace --warning-mode fail | 14 | - run: ./gradlew build --stacktrace --warning-mode fail |
| 15 | - uses: Juuxel/publish-checkstyle-report@v1 | 15 | - uses: Juuxel/publish-checkstyle-report@v1 |
| 16 | if: ${{ failure() }} | 16 | if: ${{ failure() }} |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87fd901..5a5d0b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml | |||
| @@ -4,10 +4,10 @@ jobs: | |||
| 4 | build: | 4 | build: |
| 5 | runs-on: ubuntu-22.04 | 5 | runs-on: ubuntu-22.04 |
| 6 | container: | 6 | container: |
| 7 | image: eclipse-temurin:19-jdk | 7 | image: mcr.microsoft.com/openjdk/jdk:21-ubuntu |
| 8 | options: --user root | 8 | options: --user root |
| 9 | steps: | 9 | steps: |
| 10 | - uses: actions/checkout@v3 | 10 | - uses: actions/checkout@v4 |
| 11 | - run: ./gradlew checkVersion build publish --stacktrace | 11 | - run: ./gradlew checkVersion build publish --stacktrace |
| 12 | env: | 12 | env: |
| 13 | MAVEN_URL: ${{ secrets.MAVEN_URL }} | 13 | MAVEN_URL: ${{ secrets.MAVEN_URL }} |
diff --git a/build.gradle b/build.gradle index 08ccffe..58cb0ba 100644 --- a/build.gradle +++ b/build.gradle | |||
| @@ -1,5 +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 | } | 4 | } |
| 4 | 5 | ||
| 5 | subprojects { | 6 | subprojects { |
| @@ -7,9 +8,6 @@ subprojects { | |||
| 7 | apply plugin: 'maven-publish' | 8 | apply plugin: 'maven-publish' |
| 8 | apply plugin: 'checkstyle' | 9 | apply plugin: 'checkstyle' |
| 9 | 10 | ||
| 10 | sourceCompatibility = JavaVersion.VERSION_17 | ||
| 11 | targetCompatibility = JavaVersion.VERSION_17 | ||
| 12 | |||
| 13 | repositories { | 11 | repositories { |
| 14 | mavenLocal() | 12 | mavenLocal() |
| 15 | mavenCentral() | 13 | mavenCentral() |
| @@ -17,8 +15,8 @@ subprojects { | |||
| 17 | } | 15 | } |
| 18 | 16 | ||
| 19 | dependencies { | 17 | dependencies { |
| 20 | implementation 'com.google.guava:guava:30.1.1-jre' | 18 | implementation 'com.google.guava:guava:32.1.2-jre' |
| 21 | implementation 'com.google.code.gson:gson:2.8.7' | 19 | implementation 'com.google.code.gson:gson:2.10.1' |
| 22 | 20 | ||
| 23 | testImplementation 'junit:junit:4.13.2' | 21 | testImplementation 'junit:junit:4.13.2' |
| 24 | testImplementation 'org.hamcrest:hamcrest:2.2' | 22 | testImplementation 'org.hamcrest:hamcrest:2.2' |
| @@ -29,13 +27,10 @@ subprojects { | |||
| 29 | 27 | ||
| 30 | version = version + (System.getenv("GITHUB_ACTIONS") ? "" : "+local") | 28 | version = version + (System.getenv("GITHUB_ACTIONS") ? "" : "+local") |
| 31 | 29 | ||
| 32 | task sourcesJar(type: Jar, dependsOn: classes) { | ||
| 33 | classifier = 'sources' | ||
| 34 | from sourceSets.main.allSource | ||
| 35 | } | ||
| 36 | |||
| 37 | java { | 30 | java { |
| 38 | withSourcesJar() | 31 | withSourcesJar() |
| 32 | sourceCompatibility = JavaVersion.VERSION_17 | ||
| 33 | targetCompatibility = JavaVersion.VERSION_17 | ||
| 39 | } | 34 | } |
| 40 | 35 | ||
| 41 | tasks.withType(JavaCompile).configureEach { | 36 | tasks.withType(JavaCompile).configureEach { |
| @@ -46,7 +41,7 @@ subprojects { | |||
| 46 | 41 | ||
| 47 | checkstyle { | 42 | checkstyle { |
| 48 | configFile = rootProject.file('checkstyle.xml') | 43 | configFile = rootProject.file('checkstyle.xml') |
| 49 | toolVersion = '10.3.3' | 44 | toolVersion = '10.12.4' |
| 50 | } | 45 | } |
| 51 | 46 | ||
| 52 | publishing { | 47 | publishing { |
diff --git a/enigma-cli/build.gradle b/enigma-cli/build.gradle index 5281e9e..05e644e 100644 --- a/enigma-cli/build.gradle +++ b/enigma-cli/build.gradle | |||
| @@ -1,15 +1,17 @@ | |||
| 1 | plugins { | 1 | plugins { |
| 2 | id 'application' | 2 | id 'application' |
| 3 | id 'com.github.johnrengelman.shadow' version '7.0.0' | 3 | id 'com.github.johnrengelman.shadow' |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | dependencies { | 6 | dependencies { |
| 7 | implementation project(':enigma') | 7 | implementation project(':enigma') |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | mainClassName = 'cuchaz.enigma.command.Main' | 10 | application { |
| 11 | mainClass = 'cuchaz.enigma.command.Main' | ||
| 12 | } | ||
| 11 | 13 | ||
| 12 | jar.manifest.attributes 'Main-Class': mainClassName | 14 | jar.manifest.attributes 'Main-Class': application.mainClass.get() |
| 13 | 15 | ||
| 14 | publishing { | 16 | publishing { |
| 15 | publications { | 17 | publications { |
diff --git a/enigma-server/build.gradle b/enigma-server/build.gradle index 873adb9..0daa490 100644 --- a/enigma-server/build.gradle +++ b/enigma-server/build.gradle | |||
| @@ -7,6 +7,8 @@ dependencies { | |||
| 7 | implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' | 7 | implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | mainClassName = 'cuchaz.enigma.network.DedicatedEnigmaServer' | 10 | application { |
| 11 | mainClass = 'cuchaz.enigma.network.DedicatedEnigmaServer' | ||
| 12 | } | ||
| 11 | 13 | ||
| 12 | jar.manifest.attributes 'Main-Class': mainClassName | 14 | jar.manifest.attributes 'Main-Class': application.mainClass.get() |
diff --git a/enigma-swing/build.gradle b/enigma-swing/build.gradle index fff4daf..452df5e 100644 --- a/enigma-swing/build.gradle +++ b/enigma-swing/build.gradle | |||
| @@ -1,23 +1,36 @@ | |||
| 1 | plugins { | 1 | plugins { |
| 2 | id 'application' | 2 | id 'application' |
| 3 | id 'com.github.johnrengelman.shadow' version '7.0.0' | 3 | id 'com.github.johnrengelman.shadow' |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | def flatLafNatives = [ | ||
| 7 | "windows-arm64@dll", | ||
| 8 | "windows-x86@dll", | ||
| 9 | "windows-x86_64@dll", | ||
| 10 | "linux-x86_64@so", | ||
| 11 | ] | ||
| 12 | |||
| 6 | dependencies { | 13 | dependencies { |
| 7 | implementation project(':enigma') | 14 | implementation project(':enigma') |
| 8 | implementation project(':enigma-server') | 15 | implementation project(':enigma-server') |
| 9 | 16 | ||
| 10 | implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' | 17 | implementation 'net.sf.jopt-simple:jopt-simple:6.0-alpha-3' |
| 11 | implementation 'com.formdev:flatlaf:2.6' | 18 | implementation 'com.formdev:flatlaf:3.2.5' |
| 12 | implementation 'com.formdev:flatlaf-extras:2.6' // for SVG icons | 19 | implementation 'com.formdev:flatlaf-extras:3.2.5' // for SVG icons |
| 13 | implementation 'de.sciss:syntaxpane:1.2.1' | 20 | implementation 'de.sciss:syntaxpane:1.2.1' |
| 14 | implementation 'com.github.lukeu:swing-dpi:0.10' | 21 | implementation 'com.github.lukeu:swing-dpi:0.10' |
| 15 | implementation 'org.drjekyll:fontchooser:2.5.2' | 22 | implementation 'org.drjekyll:fontchooser:2.5.2' |
| 23 | |||
| 24 | flatLafNatives.forEach { | ||
| 25 | implementation 'com.formdev:flatlaf:3.2.5:' + it | ||
| 26 | } | ||
| 16 | } | 27 | } |
| 17 | 28 | ||
| 18 | mainClassName = 'cuchaz.enigma.gui.Main' | 29 | application { |
| 30 | mainClass = 'cuchaz.enigma.gui.Main' | ||
| 31 | } | ||
| 19 | 32 | ||
| 20 | jar.manifest.attributes 'Main-Class': mainClassName | 33 | jar.manifest.attributes 'Main-Class': application.mainClass.get() |
| 21 | 34 | ||
| 22 | publishing { | 35 | publishing { |
| 23 | publications { | 36 | publications { |
diff --git a/enigma/build.gradle b/enigma/build.gradle index 8cbfec2..cabea13 100644 --- a/enigma/build.gradle +++ b/enigma/build.gradle | |||
| @@ -3,15 +3,15 @@ configurations { | |||
| 3 | } | 3 | } |
| 4 | 4 | ||
| 5 | dependencies { | 5 | dependencies { |
| 6 | implementation 'org.ow2.asm:asm:9.4' | 6 | implementation 'org.ow2.asm:asm:9.6' |
| 7 | implementation 'org.ow2.asm:asm-commons:9.4' | 7 | implementation 'org.ow2.asm:asm-commons:9.6' |
| 8 | implementation 'org.ow2.asm:asm-tree:9.4' | 8 | implementation 'org.ow2.asm:asm-tree:9.6' |
| 9 | implementation 'org.ow2.asm:asm-util:9.4' | 9 | implementation 'org.ow2.asm:asm-util:9.6' |
| 10 | 10 | ||
| 11 | implementation 'org.bitbucket.mstrobel:procyon-compilertools:0.6.0' | 11 | implementation 'org.bitbucket.mstrobel:procyon-compilertools:0.6.0' |
| 12 | implementation 'net.fabricmc:cfr:0.2.1' | 12 | implementation 'net.fabricmc:cfr:0.2.1' |
| 13 | 13 | ||
| 14 | proGuard 'com.guardsquare:proguard-base:7.3.0' | 14 | proGuard 'com.guardsquare:proguard-base:7.4.0-beta02' |
| 15 | 15 | ||
| 16 | testImplementation 'com.google.jimfs:jimfs:1.2' | 16 | testImplementation 'com.google.jimfs:jimfs:1.2' |
| 17 | } | 17 | } |
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..7f93135 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 f398c33..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties | |||
| @@ -1,6 +1,7 @@ | |||
| 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-7.6-bin.zip | 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip |
| 4 | networkTimeout=10000 | 4 | networkTimeout=10000 |
| 5 | validateDistributionUrl=true | ||
| 5 | zipStoreBase=GRADLE_USER_HOME | 6 | zipStoreBase=GRADLE_USER_HOME |
| 6 | zipStorePath=wrapper/dists | 7 | zipStorePath=wrapper/dists |
| @@ -83,10 +83,8 @@ done | |||
| 83 | # This is normally unused | 83 | # This is normally unused |
| 84 | # shellcheck disable=SC2034 | 84 | # shellcheck disable=SC2034 |
| 85 | APP_BASE_NAME=${0##*/} | 85 | APP_BASE_NAME=${0##*/} |
| 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit | 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
| 87 | 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit | |
| 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | ||
| 90 | 88 | ||
| 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
| 92 | MAX_FD=maximum | 90 | MAX_FD=maximum |
| @@ -133,10 +131,13 @@ location of your Java installation." | |||
| 133 | fi | 131 | fi |
| 134 | else | 132 | else |
| 135 | JAVACMD=java | 133 | JAVACMD=java |
| 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | 134 | if ! command -v java >/dev/null 2>&1 |
| 135 | then | ||
| 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 137 | 137 | ||
| 138 | Please set the JAVA_HOME variable in your environment to match the | 138 | Please set the JAVA_HOME variable in your environment to match the |
| 139 | location of your Java installation." | 139 | location of your Java installation." |
| 140 | fi | ||
| 140 | fi | 141 | fi |
| 141 | 142 | ||
| 142 | # Increase the maximum file descriptors if we can. | 143 | # Increase the maximum file descriptors if we can. |
| @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |||
| 144 | case $MAX_FD in #( | 145 | case $MAX_FD in #( |
| 145 | max*) | 146 | max*) |
| 146 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. | 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. |
| 147 | # shellcheck disable=SC3045 | 148 | # shellcheck disable=SC2039,SC3045 |
| 148 | MAX_FD=$( ulimit -H -n ) || | 149 | MAX_FD=$( ulimit -H -n ) || |
| 149 | warn "Could not query maximum file descriptor limit" | 150 | warn "Could not query maximum file descriptor limit" |
| 150 | esac | 151 | esac |
| @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |||
| 152 | '' | soft) :;; #( | 153 | '' | soft) :;; #( |
| 153 | *) | 154 | *) |
| 154 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. | 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. |
| 155 | # shellcheck disable=SC3045 | 156 | # shellcheck disable=SC2039,SC3045 |
| 156 | ulimit -n "$MAX_FD" || | 157 | ulimit -n "$MAX_FD" || |
| 157 | warn "Could not set maximum file descriptor limit to $MAX_FD" | 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" |
| 158 | esac | 159 | esac |
| @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then | |||
| 197 | done | 198 | done |
| 198 | fi | 199 | fi |
| 199 | 200 | ||
| 200 | # Collect all arguments for the java command; | 201 | |
| 201 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
| 202 | # shell script including quotes and variable substitutions, so put them in | 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
| 203 | # double quotes to make sure that they get re-expanded; and | 204 | |
| 204 | # * put everything else in single quotes, so that it's not re-expanded. | 205 | # Collect all arguments for the java command: |
| 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, | ||
| 207 | # 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 | ||
| 209 | # treated as '${Hostname}' itself on the command line. | ||
| 205 | 210 | ||
| 206 | set -- \ | 211 | set -- \ |
| 207 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ | 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ |
diff --git a/gradlew.bat b/gradlew.bat index 6689b85..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat | |||
| @@ -1,92 +1,92 @@ | |||
| 1 | @rem | 1 | @rem |
| 2 | @rem Copyright 2015 the original author or authors. | 2 | @rem Copyright 2015 the original author or authors. |
| 3 | @rem | 3 | @rem |
| 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); | 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); |
| 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 https://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, |
| 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 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 | 16 | ||
| 17 | @if "%DEBUG%"=="" @echo off | 17 | @if "%DEBUG%"=="" @echo off |
| 18 | @rem ########################################################################## | 18 | @rem ########################################################################## |
| 19 | @rem | 19 | @rem |
| 20 | @rem Gradle startup script for Windows | 20 | @rem Gradle startup script for Windows |
| 21 | @rem | 21 | @rem |
| 22 | @rem ########################################################################## | 22 | @rem ########################################################################## |
| 23 | 23 | ||
| 24 | @rem Set local scope for the variables with windows NT shell | 24 | @rem Set local scope for the variables with windows NT shell |
| 25 | if "%OS%"=="Windows_NT" setlocal | 25 | if "%OS%"=="Windows_NT" setlocal |
| 26 | 26 | ||
| 27 | set DIRNAME=%~dp0 | 27 | set DIRNAME=%~dp0 |
| 28 | if "%DIRNAME%"=="" set DIRNAME=. | 28 | if "%DIRNAME%"=="" set DIRNAME=. |
| 29 | @rem This is normally unused | 29 | @rem This is normally unused |
| 30 | set APP_BASE_NAME=%~n0 | 30 | set APP_BASE_NAME=%~n0 |
| 31 | set APP_HOME=%DIRNAME% | 31 | set APP_HOME=%DIRNAME% |
| 32 | 32 | ||
| 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. |
| 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi |
| 35 | 35 | ||
| 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
| 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" |
| 38 | 38 | ||
| 39 | @rem Find java.exe | 39 | @rem Find java.exe |
| 40 | if defined JAVA_HOME goto findJavaFromJavaHome | 40 | if defined JAVA_HOME goto findJavaFromJavaHome |
| 41 | 41 | ||
| 42 | set JAVA_EXE=java.exe | 42 | set JAVA_EXE=java.exe |
| 43 | %JAVA_EXE% -version >NUL 2>&1 | 43 | %JAVA_EXE% -version >NUL 2>&1 |
| 44 | if %ERRORLEVEL% equ 0 goto execute | 44 | if %ERRORLEVEL% equ 0 goto execute |
| 45 | 45 | ||
| 46 | echo. | 46 | echo. |
| 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
| 48 | echo. | 48 | echo. |
| 49 | echo Please set the JAVA_HOME variable in your environment to match the | 49 | echo Please set the JAVA_HOME variable in your environment to match the |
| 50 | echo location of your Java installation. | 50 | echo location of your Java installation. |
| 51 | 51 | ||
| 52 | goto fail | 52 | goto fail |
| 53 | 53 | ||
| 54 | :findJavaFromJavaHome | 54 | :findJavaFromJavaHome |
| 55 | set JAVA_HOME=%JAVA_HOME:"=% | 55 | set JAVA_HOME=%JAVA_HOME:"=% |
| 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe | 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe |
| 57 | 57 | ||
| 58 | if exist "%JAVA_EXE%" goto execute | 58 | if exist "%JAVA_EXE%" goto execute |
| 59 | 59 | ||
| 60 | echo. | 60 | echo. |
| 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% |
| 62 | echo. | 62 | echo. |
| 63 | echo Please set the JAVA_HOME variable in your environment to match the | 63 | echo Please set the JAVA_HOME variable in your environment to match the |
| 64 | echo location of your Java installation. | 64 | echo location of your Java installation. |
| 65 | 65 | ||
| 66 | goto fail | 66 | goto fail |
| 67 | 67 | ||
| 68 | :execute | 68 | :execute |
| 69 | @rem Setup the command line | 69 | @rem Setup the command line |
| 70 | 70 | ||
| 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar |
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | @rem Execute Gradle | 74 | @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 %* | 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* |
| 76 | 76 | ||
| 77 | :end | 77 | :end |
| 78 | @rem End local scope for the variables with windows NT shell | 78 | @rem End local scope for the variables with windows NT shell |
| 79 | if %ERRORLEVEL% equ 0 goto mainEnd | 79 | if %ERRORLEVEL% equ 0 goto mainEnd |
| 80 | 80 | ||
| 81 | :fail | 81 | :fail |
| 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of |
| 83 | rem the _cmd.exe /c_ return code! | 83 | rem the _cmd.exe /c_ return code! |
| 84 | set EXIT_CODE=%ERRORLEVEL% | 84 | set EXIT_CODE=%ERRORLEVEL% |
| 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 | 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 |
| 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% | 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% |
| 87 | exit /b %EXIT_CODE% | 87 | exit /b %EXIT_CODE% |
| 88 | 88 | ||
| 89 | :mainEnd | 89 | :mainEnd |
| 90 | if "%OS%"=="Windows_NT" endlocal | 90 | if "%OS%"=="Windows_NT" endlocal |
| 91 | 91 | ||
| 92 | :omega | 92 | :omega |