Skip to content

Commit

Permalink
upgrade Gradle to 8.6, use version catalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Feb 6, 2024
1 parent 6c9b062 commit 94afdc5
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
java=21.0.1-open
gradle=8.4
java=21.0.2-amzn
gradle=8.6
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.gradle.internal.os.OperatingSystem
apply from: 'jpos/libraries.gradle'

evaluate(new File("${project.projectDir}/VERSION"))

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ 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 @@ -202,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
51 changes: 27 additions & 24 deletions jpos/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
plugins {
id "org.gradlex.extra-java-module-info" version "1.4.1"
id "org.gradlex.java-module-dependencies" version "1.4"
id "org.gradlex.java-module-dependencies" version "1.6"
id "org.owasp.dependencycheck" version "8.3.1"

// id 'checkstyle'
}

extraJavaModuleInfo {
failOnMissingModuleInfo.set(false)
def sshdVersion = ((String) libs.sshd.orNull).split(":")[-1] // there has to be a better way to get the version

automaticModule ('org.jdom:jdom2', 'org.jdom2')
automaticModule ('commons-cli:commons-cli', 'org.apache.commons.cli')
Expand Down Expand Up @@ -45,33 +46,35 @@ extraJavaModuleInfo {
}
}

dependencies {
api libraries.jdom
api libraries.javatuples
api libraries.jline
api libraries.beanshell
api libraries.commons_cli
api libraries.bouncycastle
api libraries.slf4j_api
api libraries.hdrhistogram

implementation libraries.yaml;
implementation libraries.jdbm
implementation libraries.sleepycat_je
implementation libraries.micrometer
implementation libraries.sshd
implementation libraries.eddsa

testImplementation libraries.commons_lang3
testImplementation libraries.hamcrest
testImplementation libraries.xmlunit
testImplementation libraries.junit
dependencies {
api libs.jdom
api libs.javatuples
api libs.jline
api libs.beanshell
api libs.bcprov
api libs.bcpg
api libs.commonscli
api libs.slf4japi
api libs.hdrhistogram

implementation libs.yaml;
implementation libs.jdbm
implementation libs.sleepycatje
implementation libs.micrometercore
implementation libs.micrometerprometheus
implementation libs.sshd
implementation libs.eddsa

testImplementation libs.commonslang3
testImplementation libs.hamcrest
testImplementation libs.xmlunit
testImplementation libs.junit
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

testImplementation (libraries.mockito) {
testImplementation (libs.mockito) {
exclude(module: 'hamcrest-core')
}
testImplementation libraries.mockito_jupiter
testImplementation libs.mockitojupiter

// JSONPackager on hold
// compile (libraries.jsonsimple) {
Expand Down
35 changes: 0 additions & 35 deletions jpos/libraries.gradle

This file was deleted.

33 changes: 33 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,36 @@ include 'jpos'

rootProject.name = 'jpos'

dependencyResolutionManagement {
versionCatalogs {
libs {
library('jdom', 'org.jdom', 'jdom2').version('2.0.6.1')
library('jdbm', 'jdbm:jdbm:1.0')

library('sleepycatje', 'com.sleepycat:je:18.3.12')
library('commonscli', 'commons-cli:commons-cli:1.5.0')
library('commonslang3', 'org.apache.commons:commons-lang3:3.12.0')
library('jline', 'org.jline:jline:3.23.0')
library('beanshell', 'org.apache-extras.beanshell:bsh:2.0b6')
library('javatuples', 'org.javatuples:javatuples:1.2')
library('mockito', 'org.mockito:mockito-core:5.4.0')
library('mockitojupiter', 'org.mockito:mockito-junit-jupiter:5.4.0')
library('xmlunit', 'xmlunit:xmlunit:1.6')
library('junit', 'org.junit.jupiter:junit-jupiter:5.9.2')

library('bcprov', "org.bouncycastle:bcprov-lts8on:2.73.2")
library('bcpg', "org.bouncycastle:bcpg-lts8on:2.73.2")

library('hamcrest', 'org.hamcrest:hamcrest:2.2')
library('sshd', 'org.apache.sshd', 'sshd-core').version('2.10.0')
library('eddsa', 'net.i2p.crypto:eddsa:0.3.0')
library('slf4japi', 'org.slf4j:slf4j-api:1.7.36')
library('slf4jnop', 'org.slf4j:slf4j-nop:1.7.36')
library('hdrhistogram', 'org.hdrhistogram:HdrHistogram:2.1.12')
library('yaml', 'org.yaml:snakeyaml:2.0')
library('micrometercore', 'io.micrometer:micrometer-core:1.11.2')
library('micrometerprometheus', 'io.micrometer:micrometer-registry-prometheus:1.11.2')
}
}
}

0 comments on commit 94afdc5

Please sign in to comment.