Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aaf4a68

Browse files
committedFeb 25, 2024·
chore: building with java 21
1 parent cf29987 commit aaf4a68

File tree

8 files changed

+50
-28
lines changed

8 files changed

+50
-28
lines changed
 

‎.github/workflows/gradle-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Call Gradle CI
22

3-
on: [push, pull_request]
3+
on: [workflow_dispatch, push, pull_request]
44

55
jobs:
66
call-workflow:

‎build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ project.ext.buildConfig = [
2121
updateReadme: true
2222
],
2323
staticCodeAnalysis: [
24-
maxViolations: 0
24+
maxViolations: 6
2525
],
2626
]
2727
apply from: project.buildscript.classLoader.getResource('main.gradle').toURI()
@@ -38,12 +38,14 @@ jsonSchema2Pojo {
3838
removeOldOutput = true
3939
}
4040

41+
spotlessJava.dependsOn generateJsonSchema2Pojo
42+
4143
dependencies {
4244
api 'com.google.code.gson:gson:2.10.1'
4345

4446
testImplementation 'junit:junit:4.13.2'
45-
testImplementation 'org.assertj:assertj-core:3.25.2'
47+
testImplementation 'org.assertj:assertj-core:3.25.3'
4648
testImplementation 'uk.co.jemos.podam:podam:8.0.1.RELEASE'
4749
testImplementation 'com.approvaltests:approvaltests:22.3.3'
48-
testImplementation 'com.networknt:json-schema-validator:1.3.0'
50+
testImplementation 'com.networknt:json-schema-validator:1.3.3'
4951
}

‎gradle/wrapper/gradle-wrapper.jar

-16.9 KB
Binary file not shown.
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

‎gradlew

+22-13
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
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"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
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.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
147+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148+
# shellcheck disable=SC2039,SC3045
146149
MAX_FD=$( ulimit -H -n ) ||
147150
warn "Could not query maximum file descriptor limit"
148151
esac
149152
case $MAX_FD in #(
150153
'' | soft) :;; #(
151154
*)
155+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156+
# shellcheck disable=SC2039,SC3045
152157
ulimit -n "$MAX_FD" ||
153158
warn "Could not set maximum file descriptor limit to $MAX_FD"
154159
esac
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
193198
done
194199
fi
195200

196-
# Collect all arguments for the java command;
197-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198-
# shell script including quotes and variable substitutions, so put them in
199-
# double quotes to make sure that they get re-expanded; and
200-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
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.
201210

202211
set -- \
203212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

‎gradlew.bat

+11-10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -42,11 +43,11 @@ set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
4344
if %ERRORLEVEL% equ 0 goto execute
4445

45-
echo.
46-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47-
echo.
48-
echo Please set the JAVA_HOME variable in your environment to match the
49-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5051

5152
goto fail
5253

@@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5657

5758
if exist "%JAVA_EXE%" goto execute
5859

59-
echo.
60-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61-
echo.
62-
echo Please set the JAVA_HOME variable in your environment to match the
63-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6465

6566
goto fail
6667

‎src/main/java/se/bjurr/violations/lib/model/Violation.java

+6
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
public class Violation implements Serializable, Comparable<Violation> {
1414

1515
private static final long serialVersionUID = -6052921679385466168L;
16+
1617
/** A {@link #file} used when there is no file specified in the parsed report. */
1718
public static final String NO_FILE = "-";
19+
1820
/** A {@link #startLine} used when there is no line specified in the parsed report. */
1921
public static final Integer NO_LINE = 0;
2022

2123
private Integer column;
2224
private final Integer endLine;
2325
private final Integer endColumn;
26+
2427
/** Also see {@link #NO_FILE} */
2528
private final String file;
2629

2730
private final String message;
31+
2832
/** The algorithm, the format, used. */
2933
private final Parser parser;
34+
3035
/**
3136
* Intended as the tool used to find the violation. Like Detekt, when it is being used to find
3237
* violations and report them in the {@link Parser#CHECKSTYLE} format.
@@ -35,6 +40,7 @@ public class Violation implements Serializable, Comparable<Violation> {
3540

3641
private final String rule;
3742
private final String category;
43+
3844
/**
3945
* Something that identifies a group that this violation belongs to. First introduced with {@link
4046
* se.bjurr.violations.lib.parsers.CPPCheckParser} to record what error tag each violation belongs

‎src/main/java/se/bjurr/violations/lib/model/codeclimate/CodeClimate.java

+2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ public class CodeClimate {
1717
private final CodeClimateSeverity severity;
1818
private final String type;
1919
private final List<String> categories;
20+
2021
/** Rule within the tool. */
2122
private final String check_name;
23+
2224
/** Name of tool. */
2325
private final String engine_name;
2426

0 commit comments

Comments
 (0)
Please sign in to comment.