diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 399079b49..bd78e8d42 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -21,9 +21,15 @@ jobs: - '8' - '11' - '17' + - '19' os: - ubuntu-latest - macos-latest + exclude: + - os: macos-latest + java: '8' + - os: macos-latest + java: '19' runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 1cd1fb251..8b7a10449 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -32,7 +32,9 @@ Bug Fixes:: Build Improvement:: -* Upgrade build to Gradle 7.5.1 (#1109) +* Upgrade build to Gradle 7.6 (#1563) +* Upgrade Spring Boot test to 3.0.0 (#1563) +* Run tests on Java 19 (#1563) * Fix upstream tests forcing SNAPSHOT on Asciidoctor gem installation (#1123) (@abelsromero) * Fix upstream build removing the explicit plugin repository (#1131) diff --git a/asciidoctorj-springboot-integration-test/build.gradle b/asciidoctorj-springboot-integration-test/build.gradle index 4c23b843c..4e5aaab2d 100644 --- a/asciidoctorj-springboot-integration-test/build.gradle +++ b/asciidoctorj-springboot-integration-test/build.gradle @@ -11,3 +11,8 @@ dependencies { } test.dependsOn(':asciidoctorj-springboot-integration-test:springboot-app:assemble') + +tasks.withType(JavaCompile).configureEach { task -> + task.options.release = 17 +} + diff --git a/asciidoctorj-springboot-integration-test/springboot-app/build.gradle b/asciidoctorj-springboot-integration-test/springboot-app/build.gradle index 7644db849..d2d677950 100644 --- a/asciidoctorj-springboot-integration-test/springboot-app/build.gradle +++ b/asciidoctorj-springboot-integration-test/springboot-app/build.gradle @@ -1,12 +1,11 @@ plugins { - id 'org.springframework.boot' version '2.6.5' - id 'io.spring.dependency-management' version '1.0.11.RELEASE' + id 'org.springframework.boot' version '3.0.0' + id 'io.spring.dependency-management' version '1.1.0' id 'java' } group = 'org.asciidoctor.it' version = '0.0.1-SNAPSHOT' -sourceCompatibility = '1.8' repositories { mavenCentral() @@ -20,6 +19,10 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test' } +tasks.withType(JavaCompile).configureEach { task -> + task.options.release = 17 +} + bootJar { requiresUnpack '**/asciidoctorj-*.jar' } diff --git a/asciidoctorj-springboot-integration-test/springboot-app/src/main/java/org/asciidoctor/it/springboot/AsciidoctorService.java b/asciidoctorj-springboot-integration-test/springboot-app/src/main/java/org/asciidoctor/it/springboot/AsciidoctorService.java index 1aab49cdb..61156242c 100644 --- a/asciidoctorj-springboot-integration-test/springboot-app/src/main/java/org/asciidoctor/it/springboot/AsciidoctorService.java +++ b/asciidoctorj-springboot-integration-test/springboot-app/src/main/java/org/asciidoctor/it/springboot/AsciidoctorService.java @@ -1,7 +1,7 @@ package org.asciidoctor.it.springboot; import org.asciidoctor.Asciidoctor; -import org.asciidoctor.OptionsBuilder; +import org.asciidoctor.Options; import org.asciidoctor.SafeMode; import org.springframework.stereotype.Component; @@ -15,11 +15,12 @@ public String convert(String source) { return asciidoctor.convert(source, defaultOptions()); } - private OptionsBuilder defaultOptions() { - return OptionsBuilder.options() + private Options defaultOptions() { + return Options.builder() .backend("html5") .safe(SafeMode.SAFE) .headerFooter(true) - .toFile(false); + .toFile(false) + .build(); } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f..943f0cbfa 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661ee..f398c33c4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c..65dcd68d6 100755 --- a/gradlew +++ b/gradlew @@ -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/. @@ -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"' @@ -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 diff --git a/gradlew.bat b/gradlew.bat index 53a6b238d..6689b85be 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ 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% diff --git a/settings.gradle b/settings.gradle index 69084fd12..37f40f189 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,9 +7,13 @@ include \ 'asciidoctorj-distribution', 'asciidoctorj-documentation', 'asciidoctorj-wildfly-integration-test', - 'asciidoctorj-springboot-integration-test', - 'asciidoctorj-springboot-integration-test:springboot-app', 'asciidoctorj-test-support' +if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { + include \ + 'asciidoctorj-springboot-integration-test', + 'asciidoctorj-springboot-integration-test:springboot-app' +} + project(':asciidoctorj').projectDir = file('asciidoctorj-core')