Skip to content

Commit

Permalink
Merge pull request #3942 from cwisniew/feature-jdk-upgrade
Browse files Browse the repository at this point in the history
Update to Java 20
  • Loading branch information
cwisniew authored Apr 16, 2023
2 parents e5277c6 + 50cf08d commit b224b3b
Show file tree
Hide file tree
Showing 160 changed files with 1,448 additions and 498 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
java: [ '17' ]
java: [ '20' ]
fail-fast: false
steps:
# ____ _ __ __ ___ ____ __
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: "17"
java-version: "20"
- name: spotlessCheck
run: ./gradlew spotlessCheck
build:
Expand All @@ -37,7 +37,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
java: [ '17' ]
java: [ '20' ]
fail-fast: false
steps:
- name: Git checkout
Expand Down
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
plugins {
id "application"
id "org.ajoberstar.grgit" version "5.0.0"
id "com.diffplug.spotless" version "6.16.0"
id "com.diffplug.spotless" version "6.18.0"
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.beryx.runtime' version '1.12.7'
id "com.google.protobuf" version "0.8.19"
Expand All @@ -32,8 +32,8 @@ apply plugin: 'com.google.protobuf'

// Definitions
defaultTasks 'clean', 'build'
sourceCompatibility = 17
targetCompatibility = 17
sourceCompatibility = 20
targetCompatibility = 20


// Used by gradle assemble & run tasks
Expand Down Expand Up @@ -105,7 +105,7 @@ spotless {
toggleOffOn()

// Now using the Google Java style guide
googleJavaFormat("1.11.0")
googleJavaFormat("1.16.0")
}

format 'misc', {
Expand Down Expand Up @@ -230,7 +230,7 @@ runtime {
'--win-upgrade-uuid', winUpgradeUUID
]
targetPlatform('win') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_windows_hotspot_17.0.1_12.zip');
jdkHome = jdkDownload('https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20%2B36/OpenJDK20U-debugimage_x64_windows_hotspot_20_36.zip');
}
}

Expand All @@ -241,7 +241,7 @@ runtime {
'--mac-package-name', project.name + developerRelease
]
targetPlatform('mac') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_mac_hotspot_17.0.1_12.tar.gz');
jdkHome = jdkDownload('https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20%2B36/OpenJDK20U-jdk_x64_mac_hotspot_20_36.tar.gz');
jvmArgs += [ '-Xdock:name=' + project.name + developerRelease ]
}
}
Expand All @@ -267,7 +267,7 @@ runtime {
]
}
targetPlatform('linux') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz');
jdkHome = jdkDownload('https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20%2B36/OpenJDK20U-jre_x64_linux_hotspot_20_36.tar.gz');
}
}
}
Expand Down Expand Up @@ -482,7 +482,7 @@ task uberJar(type: Jar) {
zip64 = true
description = 'Create uber jar for native installers'

baseName project.name + '-' + tagVersion
archiveBaseName = project.name + '-' + tagVersion
destinationDirectory = file("$rootDir/releases")
duplicatesStrategy = DuplicatesStrategy.INCLUDE

Expand Down Expand Up @@ -558,3 +558,4 @@ task createWrapper(type: Wrapper) {

// Configure current release tag in Sentry.io properties
processResources.dependsOn configSentryRelease
configSentryRelease.dependsOn 'spotlessCheck'
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,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# 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"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
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
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
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
*/
package net.rptools.clientserver.simple;

/** @author trevor */
/**
* @author trevor
*/
public interface DisconnectHandler {

public void handleDisconnect(AbstractConnection conn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/** @author drice */
/**
* @author drice
*/
public class SocketServerConnection extends AbstractServerConnection {

private static final Logger log = LogManager.getLogger(SocketServerConnection.class);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/rptools/lib/image/ImageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/** @author trevor */
/**
* @author trevor
*/
public class ImageUtil {
private static final Logger log = LogManager.getLogger();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/rptools/lib/io/PackedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,9 @@ public Set<String> getPaths() throws IOException {
return paths;
}

/** @return Getter for file */
/**
* @return Getter for file
*/
public File getPackedFile() {
return file;
}
Expand Down
48 changes: 36 additions & 12 deletions src/main/java/net/rptools/lib/transferable/TokenTransferData.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,62 +129,86 @@ public class TokenTransferData extends HashMap<String, Object> implements Serial
* Instance Methods
*-------------------------------------------------------------------------------------------*/

/** @return Getter for isVisible */
/**
* @return Getter for isVisible
*/
public boolean isVisible() {
return isVisible;
}

/** @param aIsVisible Setter for isVisible */
/**
* @param aIsVisible Setter for isVisible
*/
public void setVisible(boolean aIsVisible) {
isVisible = aIsVisible;
}

/** @return Getter for name */
/**
* @return Getter for name
*/
public String getName() {
return name;
}

/** @param aName Setter for name */
/**
* @param aName Setter for name
*/
public void setName(String aName) {
name = aName;
}

/** @return Getter for players */
/**
* @return Getter for players
*/
public Set<String> getPlayers() {
return players;
}

/** @param aPlayers Setter for players */
/**
* @param aPlayers Setter for players
*/
public void setPlayers(Set<String> aPlayers) {
players = aPlayers;
}

/** @return Getter for token */
/**
* @return Getter for token
*/
public ImageIcon getToken() {
return token;
}

/** @param aToken Setter for token */
/**
* @param aToken Setter for token
*/
public void setToken(ImageIcon aToken) {
token = aToken;
}

/** @return Getter for facing */
/**
* @return Getter for facing
*/
public Integer getFacing() {
return facing;
}

/** @param aFacing Setter for facing */
/**
* @param aFacing Setter for facing
*/
public void setFacing(Integer aFacing) {
facing = aFacing;
}

/** @return Getter for location */
/**
* @return Getter for location
*/
public Point getLocation() {
return location;
}

/** @param aLocation Setter for location */
/**
* @param aLocation Setter for location
*/
public void setLocation(Point aLocation) {
location = aLocation;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/rptools/maptool/client/AppStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import net.rptools.maptool.client.ui.theme.Borders;
import net.rptools.maptool.client.ui.theme.RessourceManager;

/** @author trevor */
/**
* @author trevor
*/
public class AppStyle {

public static ImageBorder border = RessourceManager.getBorder(Borders.GRAY2);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/rptools/maptool/client/ChatAutoSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/** @author frank */
/**
* @author frank
*/
public class ChatAutoSave {
private static Logger log = LogManager.getLogger(ChatAutoSave.class);
private static final ChatAutoSave self = new ChatAutoSave();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import javax.swing.JMenu;
import javax.swing.JMenuItem;

/** @author tylere */
/**
* @author tylere
*/
public class MRUCampaignManager {
// To increase max mru's need to update mnemonics code
private static final int DEFAULT_MAX_MRU = 9;
Expand Down
Loading

0 comments on commit b224b3b

Please sign in to comment.