Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: java21 upgrade #786

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: ./gradlew build

Expand Down Expand Up @@ -55,12 +52,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run Tests
run: ./gradlew test

Expand Down Expand Up @@ -97,7 +91,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Install asciidoctor and pandoc
Expand Down Expand Up @@ -129,7 +123,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Prepare distribution
Expand All @@ -147,7 +141,7 @@ jobs:

- name: Build and install the package
run: |
sudo npm install --location=global jdeploy@4.0.22
sudo npm install --location=global jdeploy@4.0.43
npm install
jdeploy install

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run static analysis
run: ./gradlew build staticAnalysis -P staticAnalysisMarker

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Install asciidoctor and pandoc
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Generate autocomplete script
run: |
./gradlew shadowJar
Expand Down Expand Up @@ -87,7 +84,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 21
cache: 'gradle'

- name: Generate autocomplete script
Expand All @@ -110,7 +107,7 @@ jobs:

- name: Build and install the package
run: |
sudo npm install --location=global jdeploy@4.0.22
sudo npm install --location=global jdeploy@4.0.43
npm install
jdeploy install
mv build/libs/crowdin_completion jdeploy-bundle/crowdin_completion
Expand Down Expand Up @@ -187,7 +184,7 @@ jobs:

- name: install local package
run: |
choco install jdk8
choco install temurin
choco install crowdin-cli -s . -y

- name: Choco publish
Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import static de.fayard.refreshVersions.core.Versions.versionFor

plugins {
id 'java'
id 'com.github.johnrengelman.shadow'
id 'io.github.goooler.shadow' //TODO find alternative
id 'jacoco'
id 'com.github.spotbugs'
id 'org.asciidoctor.jvm.convert'
Expand All @@ -12,7 +12,7 @@ plugins {
group 'com.crowdin'
version '3.19.2'

sourceCompatibility = 1.8
sourceCompatibility = '21'

if (!hasProperty('mainClass')) {
ext.mainClass = 'com.crowdin.cli.Cli'
Expand Down Expand Up @@ -62,6 +62,10 @@ dependencies {
annotationProcessor "info.picocli:picocli-codegen:_"
}

wrapper {
gradleVersion = '8.5'
}

jar {
manifest {
attributes 'Implementation-Title': 'Crowdin CLI',
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# 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
Expand Down Expand Up @@ -130,26 +131,29 @@ 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.
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
case $MAX_FD in #(
'' | 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
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# 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, 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.
# 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" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ 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.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ 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.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"crowdin": "jdeploy-bundle/jdeploy.js"
},
"jdeploy": {
"jar": "dist/crowdin-cli.jar"
"jar": "dist/crowdin-cli.jar",
"javaVersion": "21"
},
"dependencies": {
"command-exists-promise": "^2.0.2",
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
// See https://jmfayard.github.io/refreshVersions
id 'de.fayard.refreshVersions' version '0.51.0'
// See https://splitties.github.io/refreshVersions
id 'de.fayard.refreshVersions' version '0.60.5'
}

rootProject.name = 'cli'
28 changes: 14 additions & 14 deletions versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.51.0
#### Generated by `./gradlew refreshVersions` version 0.60.5
####
#### Don't manually edit or split the comments that start with four hashtags (####),
#### they will be overwritten by refreshVersions.
Expand All @@ -9,47 +9,47 @@

version.org.yaml..snakeyaml=2.2

version.org.projectlombok..lombok=1.18.30
version.org.projectlombok..lombok=1.18.32

version.org.json..json=20231013
version.org.json..json=20240303

version.org.apache.logging.log4j..log4j-core=2.21.0
version.org.apache.logging.log4j..log4j-core=2.23.1

version.org.apache.logging.log4j..log4j-api=2.21.0
version.org.apache.logging.log4j..log4j-api=2.23.1

version.org.apache.httpcomponents..httpclient=4.5.14

version.org.apache.commons..commons-lang3=3.13.0
version.org.apache.commons..commons-lang3=3.14.0

version.net.ricecode..string-similarity=1.0.0

version.net.lingala.zip4j..zip4j=2.11.5

version.mockito=3.12.4

version.junit.jupiter=5.10.0
version.junit.jupiter=5.10.2

version.javax.activation..activation=1.1.1

version.io.github.cdimascio..dotenv-java=2.3.2

version.info.picocli..picocli-codegen=4.7.5
version.info.picocli..picocli-codegen=4.7.6

version.info.picocli..picocli=4.7.5
version.info.picocli..picocli=4.7.6

version.hamcrest=2.2

version.commons-io..commons-io=2.14.0
version.commons-io..commons-io=2.16.1

version.commons-cli..commons-cli=1.5.0
version.commons-cli..commons-cli=1.7.0

version.com.github.crowdin..crowdin-api-client-java=1.16.0
version.com.github.crowdin..crowdin-api-client-java=1.17.0

plugin.org.asciidoctor.jvm.convert=3.3.2

plugin.com.github.spotbugs=5.2.4
plugin.com.github.spotbugs=5.2.5

plugin.com.github.johnrengelman.shadow=7.1.2
plugin.io.github.goooler.shadow=8.1.7

## Jacoco Version needs manual update
version.jacoco=0.8.10
4 changes: 4 additions & 0 deletions website/docs/releases/migration-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,7 @@ Removed backward compatibility for file numeric id in the [`task add`](/commands
## Command output updates

In this release, we've also reviewed and improved the output of many commands to make them more informative and user-friendly. Changes include `list`, `add`, `upload`, `download`, `delete`, and other commands for various resources.

## Java version upgrade

Within this release Java was also upgraded to latest LTS version 21.
Loading