Skip to content

Commit

Permalink
Merge pull request #22 from mauritssilvis/update_java
Browse files Browse the repository at this point in the history
Update to Java 21
  • Loading branch information
mauritssilvis authored Oct 12, 2023
2 parents 6452f9a + e350b7e commit 7d1855c
Show file tree
Hide file tree
Showing 44 changed files with 882 additions and 401 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://help.github.com/articles/dealing-with-line-endings/
* text eol=lf

*.bat text eol=crlf
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ To answer these questions, this project presents a computational toolbox going b

`darts` can determine all possible darts checkouts and generate checkout tables for any range of scores.
This toolbox supports several dartboards, including the ‘standard’ London dartboard and the Quadro 240 board.
In addition, several game modes are supported, including modes that require players to start or end with double or triple fields.
In addition, several game modes are supported, including modes that require players to start or end with double or triple scores.
Finally, `darts` can provide output in several formats: easily readable Markdown tables, HTML tables for web pages and JSON objects for computer processing.

Currently, `darts` is available as a Java-based command-line application.
More information about the installation and use of this app can be found in the [Java-based command-line interface](cli/java-darts-cli) readme.
You can also check out those [checkout tables](tables/md-darts-tables).
You can also check out an extensive set of [checkout tables](tables/md-darts-tables) generated using `darts`.

## License

Copyright © 2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the GNU General Public License v3.0, which can be found in the file [LICENSE.md](LICENSE.md), or later.
This source code package is subject to the terms and conditions defined in the [GNU General Public License v3.0](LICENSE.md) or later.
6 changes: 3 additions & 3 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# APIs
# darts APIs

> APIs for the `darts` toolbox
## Introduction

This part of the [darts](https://github.com/mauritssilvis/darts) project provides application programming interfaces (APIs) for `darts`, a computational toolbox aimed at the game of darts.
This part of the [darts](..) project provides application programming interfaces (APIs) for `darts`, a computational toolbox aimed at the game of darts.

## Overview

Expand All @@ -16,4 +16,4 @@ Currently, APIs are available in the following languages:

Copyright © 2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the GNU General Public License v3.0, which can be found in the file [LICENSE.md](../LICENSE.md), or later.
This source code package is subject to the terms and conditions defined in the [GNU General Public License v3.0](../LICENSE.md) or later.
50 changes: 45 additions & 5 deletions api/java-darts-api/.idea/inspectionProfiles/All.xml

Large diffs are not rendered by default.

45 changes: 40 additions & 5 deletions api/java-darts-api/.idea/inspectionProfiles/Selected.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion api/java-darts-api/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions api/java-darts-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@

All notable changes to the [Java darts API](https://github.com/mauritssilvis/darts/tree/main/api/java-darts-api) project are documented in this file.

The file format is based on [keep a changelog](https://keepachangelog.com/en/1.0.0/),
The file format is based on [keep a changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [semantic versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0-RC1] - 2023-10-12

### Changed

#### Documentation

- Improve the project documentation.

#### Dependencies

- Update the Java version from 20 to 21.
- Update the Gradle version from 8.3 to 8.4.
- Update the refreshVersions version from 0.60.0 to 0.60.3.
- Update the Lombok version from 1.18.28 to 1.18.30.

## [0.8.0] - 2023-08-28

### Changed
Expand All @@ -21,7 +36,7 @@ and this project adheres to [semantic versioning](https://semver.org/spec/v2.0.0

- Update the Gradle version from 8.1.1 to 8.3.
- Update the Foojay resolver convention version from 0.4.0 to 0.7.0.
- Update the refreshVersions version from 0.51 to 0.60.
- Update the refreshVersions version from 0.51.0 to 0.60.0.
- Update the Lombok version from 1.18.26 to 1.18.28.

## [0.7.2] - 2023-05-06
Expand Down
4 changes: 2 additions & 2 deletions api/java-darts-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This part of the [darts](https://github.com/mauritssilvis/darts) > [APIs](https://github.com/mauritssilvis/darts/tree/main/api) project provides a Java API for `darts`, a computational toolbox aimed at the game of darts.
This API defines the features of Java implementations of `darts`.

To explore the Java API of `darts`, dive into the code.
To explore the Java API of `darts`, dive into the [code](src).
Alternatively, you can download the latest Java darts API release from https://github.com/mauritssilvis/darts/releases.
The release history of the Java darts API project is contained in the [changelog](CHANGELOG.md).

Expand All @@ -18,4 +18,4 @@ If you would like to explore extensive checkout tables for different types of da

Copyright © 2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the GNU General Public License v3.0, which can be found in the file [LICENSE.md](LICENSE.md), or later.
This source code package is subject to the terms and conditions defined in the [GNU General Public License v3.0](LICENSE.md) or later.
6 changes: 3 additions & 3 deletions api/java-darts-api/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ io-github-gradle-nexus-publish-plugin = { id = "io.github.gradle-nexus.publish-p

[versions]

java-jdk = "20"
java-jdk = "21"

java-darts = "0.8.0"
java-darts = "1.0.0-RC1"

[libraries]

lombok = "org.projectlombok:lombok:1.18.28"
lombok = "org.projectlombok:lombok:1.18.30"
Binary file modified api/java-darts-api/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion api/java-darts-api/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
# TODO: Select a Gradle version that officially supports running on Java 21
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions api/java-darts-api/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
184 changes: 92 additions & 92 deletions api/java-darts-api/gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

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

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

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.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
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.

goto fail

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
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!
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

:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

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

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

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.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
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.

goto fail

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
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!
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

:omega
3 changes: 1 addition & 2 deletions api/java-darts-api/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("de.fayard.refreshVersions") version "0.60.0"
id("de.fayard.refreshVersions") version "0.60.3"
}

rootProject.name = "java-darts-api"

6 changes: 3 additions & 3 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CLIs
# darts CLIs

> Command-line interfaces for the `darts` toolbox
## Introduction

This part of the [darts](https://github.com/mauritssilvis/darts) project provides command-line interfaces (CLIs) for `darts`, a computational toolbox aimed at the game of darts.
This part of the [darts](..) project provides command-line interfaces (CLIs) for `darts`, a computational toolbox aimed at the game of darts.

## Overview

Expand All @@ -16,4 +16,4 @@ Currently, command-line interfaces are available in the following languages:

Copyright © 2023 Maurits Silvis

This source code package is subject to the terms and conditions defined in the GNU General Public License v3.0, which can be found in the file [LICENSE.md](../LICENSE.md), or later.
This source code package is subject to the terms and conditions defined in the [GNU General Public License v3.0](../LICENSE.md) or later.
Loading

0 comments on commit 7d1855c

Please sign in to comment.