Skip to content

Commit

Permalink
Upgrade dependencies (#134)
Browse files Browse the repository at this point in the history
* Upgrade dependencies.

* Fix Github Actions Java version identifier.
  • Loading branch information
mfl28 authored Jul 13, 2024
1 parent bfe45a8 commit 9ff6ea9
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- master

env:
JAVA_VERSION: '17.0.8+7'
JAVA_VERSION: '21.0.3+9.0.LTS'
JAVA_DISTRIBUTION: 'temurin'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- master

env:
JAVA_VERSION: '17.0.8+7'
JAVA_VERSION: '21.0.3+9.0.LTS'
JAVA_DISTRIBUTION: 'temurin'
TEST_SCREEN_WIDTH: '1920'
TEST_SCREEN_HEIGHT: '1080'
Expand Down
56 changes: 30 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'com.github.ben-manes.versions' version '0.49.0'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.beryx.jlink' version '3.0.1'
id 'jacoco'
id 'net.ltgt.errorprone' version '3.1.0'
id 'org.sonarqube' version '4.4.1.3373'
id 'net.ltgt.errorprone' version '4.0.1'
id 'org.sonarqube' version '5.1.0.4882'
id 'org.ysb33r.cloudci' version '4.0.0'
id 'com.github.hierynomus.license' version '0.16.1'
id 'io.miret.etienne.sass' version '1.5.0'
id "com.ryandens.javaagent-test" version "0.5.1"
}

group 'com.github.mfl28'
Expand All @@ -39,15 +40,16 @@ repositories {

dependencies {
// Junit (Unit testing)
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// TestFx UI TesTing // https://mvnrepository.com/artifact/org.testfx/testfx-junit5
testImplementation('org.testfx:testfx-junit5:4.0.17') {
testImplementation('org.testfx:testfx-junit5:4.0.18') {
exclude group: 'org.hamcrest'
}

// https://mvnrepository.com/artifact/nl.jqno.equalsverifier/equalsverifier
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.15.2'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.16.1'

// Hamcrest https://mvnrepository.com/artifact/org.hamcrest/hamcrest
testImplementation 'org.hamcrest:hamcrest:2.2'
Expand All @@ -56,65 +58,67 @@ dependencies {
testImplementation 'org.mockito:mockito-inline:5.2.0'

// Mockito-Junit https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testImplementation 'org.mockito:mockito-junit-jupiter:5.6.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.12.0'

testImplementation 'com.google.jimfs:jimfs:1.3.0'

testJavaagent "net.bytebuddy:byte-buddy-agent:1.14.18"

// Commons Collections https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
implementation 'org.apache.commons:commons-collections4:4.4'

// Commons Lang https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'org.apache.commons:commons-lang3:3.14.0'

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.15.0'
implementation 'commons-io:commons-io:2.16.1'

// ControlsFX https://mvnrepository.com/artifact/org.controlsfx/controlsfx
implementation('org.controlsfx:controlsfx:11.1.2') {
implementation('org.controlsfx:controlsfx:11.2.1') {
exclude group: 'org.openjfx'
}

// Caffeine https://mvnrepository.com/artifact/com.github.ben-manes.caffeine/caffeine
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'

// Gradle plugin to use the error-prone compiler https://github.com/tbroyer/gradle-errorprone-plugin
errorprone 'com.google.errorprone:error_prone_core:2.23.0'
errorprone 'com.google.errorprone:error_prone_core:2.28.0'

// Google GSON https://github.com/google/gson
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.code.gson:gson:2.11.0'

// Jersey REST client https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client
implementation 'org.glassfish.jersey.core:jersey-client:3.1.3'
implementation 'org.glassfish.jersey.core:jersey-client:3.1.7'

// HK2 InjectionManager https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-hk2
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.3'
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.7'

// Jersey Multipart https://mvnrepository.com/artifact/org.glassfish.jersey.media/jersey-media-multipart
implementation 'org.glassfish.jersey.media:jersey-media-multipart:3.1.3'
implementation 'org.glassfish.jersey.media:jersey-media-multipart:3.1.7'

// Jaxb runtime https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.4'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'

// Mimepull https://mvnrepository.com/artifact/org.jvnet.mimepull/mimepull
implementation 'org.jvnet.mimepull:mimepull:1.10.0'

// Xml bind https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'

// https://mvnrepository.com/artifact/jakarta.ws.rs/jakarta.ws.rs-api
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:3.1.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:4.0.0'

// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
implementation 'org.locationtech.jts:jts-core:1.19.0'

// https://mvnrepository.com/artifact/com.drewnoakes/metadata-extractor
implementation 'com.drewnoakes:metadata-extractor:2.18.0'
implementation 'com.drewnoakes:metadata-extractor:2.19.0'

implementation 'com.opencsv:opencsv:5.9'
}

javafx {
version = '21.0.1'
version = '22.0.1'
modules = ['javafx.base', 'javafx.graphics', 'javafx.controls', 'javafx.swing']
}

Expand Down Expand Up @@ -168,7 +172,7 @@ tasks.named("dependencyUpdates").configure {
}

compileSass {
outputDir = project.file ("${buildDir}/resources/main/stylesheets/css")
outputDir = layout.buildDirectory.file ("resources/main/stylesheets/css").get().asFile
destPath = "."
sourceDir = project.file ("${projectDir}/src/main/resources/stylesheets/scss")
style = expanded
Expand Down Expand Up @@ -199,12 +203,12 @@ application {
java {
modularity.inferModulePath = false
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
options = ['--strip-debug', '--compress', 'zip-6', '--no-header-files', '--no-man-pages']
launcher {
name = 'BoundingBoxEditor'
jvmArgs = ['-Dprism.forceGPU=true', '-Djava.net.preferIPv6Addresses=system']
Expand All @@ -218,7 +222,7 @@ jlink {
uses 'jakarta.ws.rs.ext.RuntimeDelegate'
}

imageZip = project.file("${buildDir}/distributions/boundingboxeditor-${javafx.platform.classifier}.zip")
imageZip = layout.buildDirectory.file("distributions/boundingboxeditor-${javafx.platform.classifier}.zip")

jpackage {
installerOptions += [
Expand Down Expand Up @@ -258,7 +262,7 @@ jlink {
}
}

task dist {
tasks.register('dist') {
dependsOn clean, jlinkZip
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -133,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 @@ -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" \
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.io.Serial;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;

/**
Expand Down Expand Up @@ -195,7 +196,7 @@ private static ImageDimensions readImageDimensionsFromFile(File imageFile) throw
try {
reader.setInput(imageStream);

final String imageFormatName = reader.getFormatName().toLowerCase();
final String imageFormatName = reader.getFormatName().toLowerCase(Locale.ENGLISH);

if(!supportedImageFormats.contains(imageFormatName)) {
throw new UnsupportedImageFileException(UNSUPPORTED_IMAGE_FORMAT_ERROR_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private void parseBoundingShapeDataTag(Element tagElement, BoundingShapeDataPars
String poseValue = tagElement.getTextContent();

if(poseValue != null && !poseValue.equalsIgnoreCase("unspecified")) {
boxDataParseResult.getTags().add("pose: " + poseValue.toLowerCase());
boxDataParseResult.getTags().add("pose: " + poseValue.toLowerCase(Locale.ENGLISH));
}

break;
Expand Down Expand Up @@ -458,18 +458,10 @@ public List<String> getTags() {
return tags;
}

public void setTags(List<String> tags) {
this.tags = tags;
}

public List<BoundingShapeData> getParts() {
return parts;
}

public void setParts(List<BoundingShapeData> parts) {
this.parts = parts;
}

public List<Double> getPoints() {
return points;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private Element createXmlElementFromBoundingShapeData(final Document document, S
List<String> actionTags = new ArrayList<>();

for(String tag : boundingShapeData.getTags()) {
String lowerCaseTag = tag.toLowerCase();
String lowerCaseTag = tag.toLowerCase(Locale.ENGLISH);

if(lowerCaseTag.startsWith("pose:")) {
poseString = StringUtils.capitalize(lowerCaseTag.substring(5).stripLeading());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import javafx.scene.paint.Color;

import java.util.Locale;
import java.util.Random;

/***
Expand Down Expand Up @@ -49,7 +50,7 @@ public static Color createRandomColor() {
*/
public static String colorToHexString(Color color) {
return "#" + (format(color.getRed()) + format(color.getGreen()) + format(color.getBlue()))
.toUpperCase();
.toUpperCase(Locale.ENGLISH);
}

/**
Expand Down

0 comments on commit 9ff6ea9

Please sign in to comment.