diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6239af6..ea0125d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: true matrix: - java: [ 17, 21 ] + java: [ 21, 25 ] steps: - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: - name: "☕️ Setup JDK" uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: liberica - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c9fd80..cf5bb45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: types: [ published ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JAVA_VERSION: '17.0.15' # this must be a specific version for reproducible builds + JAVA_VERSION: '21.0.12' # this must be a specific version for reproducible builds RELEASE_TAG_PREFIX: 'v' jobs: publish: diff --git a/README.md b/README.md index 8916861..0d259bc 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ Install To install just add to the dependency block in the `build.gradle` +For Grails 8.x (Java 21+) +```groovy +implementation 'io.github.gpc:rendering:8.0.0' +``` + For Grails 7.x ```groovy implementation 'io.github.gpc:rendering:7.0.1' diff --git a/build.gradle b/build.gradle index 9e66cba..9f3577e 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } repositories { mavenCentral() - maven { url "https://repo.grails.org/grails/restricted" } + maven { url = "https://repo.grails.org/grails/restricted" } maven { url = 'https://repository.apache.org/content/groups/snapshots' content { @@ -44,7 +44,7 @@ ext { repositories { mavenCentral() - maven { url "https://repo.grails.org/grails/restricted" } + maven { url = "https://repo.grails.org/grails/restricted" } maven { url = 'https://repository.apache.org/content/groups/snapshots' content { @@ -58,7 +58,7 @@ dependencies { compileOnly platform("org.apache.grails:grails-bom:$grailsVersion") compileOnly 'org.apache.grails:grails-dependencies-starter-web' - api('org.xhtmlrenderer:flying-saucer-pdf:9.9.5') + api('org.xhtmlrenderer:flying-saucer-pdf:10.6.0') api("org.apache.pdfbox:pdfbox:3.0.8") testImplementation platform("org.apache.grails:grails-bom:$grailsVersion") @@ -69,8 +69,6 @@ dependencies { } -compileJava.options.release = 17 - jar { exclude "RenderingController**" exclude "application.groovy" @@ -112,6 +110,11 @@ grailsPublish { ] } +java { + sourceCompatibility = JavaVersion.toVersion(javaVersion) + targetCompatibility = JavaVersion.toVersion(javaVersion) +} + compileJava.options.release = javaVersion.toInteger() apply from: layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/example/build.gradle b/example/build.gradle index 4facb35..8dca947 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -63,8 +63,8 @@ dependencies { runtimeOnly "cloud.wondrify:asset-pipeline-grails" runtimeOnly "com.h2database:h2" runtimeOnly "com.zaxxer:HikariCP" - runtimeOnly "org.fusesource.jansi:jansi" integrationTestImplementation testFixtures("org.apache.grails:grails-geb") + integrationTestImplementation testFixtures("org.apache.grails.web:grails-web-common") testImplementation "org.apache.grails:grails-testing-support-datamapping" testImplementation "org.apache.grails:grails-testing-support-web" testImplementation "org.spockframework:spock-core" @@ -73,7 +73,12 @@ dependencies { } -compileJava.options.release = 17 +java { + sourceCompatibility = JavaVersion.toVersion(javaVersion) + targetCompatibility = JavaVersion.toVersion(javaVersion) +} + +compileJava.options.release = javaVersion.toInteger() tasks.withType(Test).configureEach { useJUnitPlatform() diff --git a/example/gradle.properties b/example/gradle.properties index 45241de..40d30c9 100644 --- a/example/gradle.properties +++ b/example/gradle.properties @@ -1,4 +1,4 @@ -grailsVersion=7.0.17 +grailsVersion=8.0.0 version=0.1 org.gradle.caching=true org.gradle.daemon=true diff --git a/example/gradle/wrapper/gradle-wrapper.jar b/example/gradle/wrapper/gradle-wrapper.jar index 1b33c55..5097068 100644 Binary files a/example/gradle/wrapper/gradle-wrapper.jar and b/example/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example/gradle/wrapper/gradle-wrapper.properties b/example/gradle/wrapper/gradle-wrapper.properties index 4f5eb9d..9b7cb4a 100644 --- a/example/gradle/wrapper/gradle-wrapper.properties +++ b/example/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/example/gradlew b/example/gradlew index 23d15a9..249efbb 100755 --- a/example/gradlew +++ b/example/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/example/gradlew.bat b/example/gradlew.bat index db3a6ac..3185a43 100644 --- a/example/gradlew.bat +++ b/example/gradlew.bat @@ -19,12 +19,39 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -45,13 +72,14 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -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 +1>&2 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. -goto fail +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -59,36 +87,26 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -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 +1>&2 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. -goto fail +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :execute @rem Setup the command line -set CLASSPATH= -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel -: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 This label must not be changed. We rely on old scripts being able to jump to this point. +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/example/grails-app/assets/images/red.png b/example/grails-app/assets/images/red.png new file mode 100644 index 0000000..78946d0 Binary files /dev/null and b/example/grails-app/assets/images/red.png differ diff --git a/example/grails-app/assets/javascripts/application.js b/example/grails-app/assets/javascripts/application.js index c290381..aa89cd8 100644 --- a/example/grails-app/assets/javascripts/application.js +++ b/example/grails-app/assets/javascripts/application.js @@ -5,8 +5,8 @@ // You're free to add application-wide JavaScript to this file, but it's generally better // to create separate JavaScript files as needed. // -//= require webjars/jquery/3.7.1/dist/jquery.js -//= require webjars/bootstrap/5.3.7/dist/js/bootstrap.bundle +//= require webjars/jquery/4.0.0/dist/jquery.js +//= require webjars/bootstrap/5.3.8/dist/js/bootstrap.bundle //= require_self if (typeof jQuery !== 'undefined') { diff --git a/example/grails-app/assets/stylesheets/application.css b/example/grails-app/assets/stylesheets/application.css index ec60949..8325f50 100644 --- a/example/grails-app/assets/stylesheets/application.css +++ b/example/grails-app/assets/stylesheets/application.css @@ -7,7 +7,7 @@ * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * -*= require webjars/bootstrap/5.3.7/dist/css/bootstrap +*= require webjars/bootstrap/5.3.8/dist/css/bootstrap *= require webjars/bootstrap-icons/1.13.1/font/bootstrap-icons *= require grails *= require_self diff --git a/example/grails-app/conf/application.yml b/example/grails-app/conf/application.yml index 00e7eb3..5025502 100644 --- a/example/grails-app/conf/application.yml +++ b/example/grails-app/conf/application.yml @@ -79,4 +79,8 @@ server: servlet: context-path: /rendering grails: - serverURL: http://localhost:8080/rendering \ No newline at end of file + serverURL: http://localhost:8080/rendering + +logging: + level: + root: ERROR \ No newline at end of file diff --git a/example/grails-app/conf/logback-spring.xml b/example/grails-app/conf/logback-spring.xml deleted file mode 100644 index 2f198ed..0000000 --- a/example/grails-app/conf/logback-spring.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - true - - ${CONSOLE_LOG_THRESHOLD} - - - ${CONSOLE_LOG_PATTERN} - ${CONSOLE_LOG_CHARSET} - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/grails-app/views/_relative-css.gsp b/example/grails-app/views/_relative-css.gsp new file mode 100644 index 0000000..88f7bfb --- /dev/null +++ b/example/grails-app/views/_relative-css.gsp @@ -0,0 +1,8 @@ + + + + +

x

+ diff --git a/example/grails-app/views/layouts/main.gsp b/example/grails-app/views/layouts/main.gsp index f83ec1c..679d1b3 100644 --- a/example/grails-app/views/layouts/main.gsp +++ b/example/grails-app/views/layouts/main.gsp @@ -16,7 +16,7 @@