Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Grails 6 #580

Merged
merged 3 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
with:
arguments: check -Dgeb.env=chromeHeadless
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Run Build
Expand All @@ -67,6 +68,9 @@ jobs:
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
Expand All @@ -75,6 +79,10 @@ jobs:
id: docs
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: docs:docs
- name: Determine docs target repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Sonatyoe OSSRH
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {
dependencies {
classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2"
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
classpath "gradle.plugin.com.energizedwork.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
classpath 'org.asciidoctor:asciidoctor-gradle-jvm:4.0.0-alpha.1'
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.0"
classpath "org.grails.plugins:views-gradle:2.3.2"
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
}
Expand Down Expand Up @@ -87,7 +87,7 @@ subprojects { project ->
boolean usesGeb = project.name.contains('grails3-hibernate5-mongodb') || project.name.contains('grails3-mongodb') || project.name.contains('grails3-mongodb-database-per-tenant')|| project.name.contains('grails3-rxmongodb')

if (usesGeb) {
apply plugin:"com.energizedwork.webdriver-binaries"
apply plugin:"com.github.erdi.webdriver-binaries"
}

if (project.name == "examples-test-data-service") {
Expand Down
52 changes: 38 additions & 14 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ext {
githubBranch = "master"
githubBranch = "8.0.x"
checkOutDir = "build/checkout"
explicitGormSrc = System.getProperty("gorm.src") ?: (project.hasProperty('gorm.src') ? project.getProperty("gorm.src") : null)
gormSrc = explicitGormSrc ? file(explicitGormSrc).absolutePath : "$checkOutDir/gorm-src"
zipFile = "build/source.zip"

coreProjects = [
Expand All @@ -12,11 +14,15 @@ ext {

version rootProject.version

apply plugin: 'org.asciidoctor.convert'
apply plugin: 'groovy'
apply plugin: 'org.asciidoctor.jvm.convert'

configurations {
documentation
documentation {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, (Bundling) objects.named(Bundling, 'external'))
}
}
}

configurations.all {
Expand All @@ -37,7 +43,8 @@ dependencies {
documentation "org.fusesource.jansi:jansi:$jansiVersion"
documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
documentation "org.codehaus.groovy:groovy-all:$groovyVersion"
documentation "org.codehaus.groovy:groovy:$groovyVersion"
documentation "org.codehaus.groovy:groovy-templates:$groovyVersion"
for(p in coreProjects) {
documentation "org.grails:grails-datastore-$p:$datastoreVersion"
}
Expand Down Expand Up @@ -65,11 +72,13 @@ asciidoctor {
'sourcedir' : "${project.rootDir}"
}

asciidoctorj {
version = '1.5.4'
}

task fetchSource {

onlyIf {
println "GORM SRC=$explicitGormSrc"
return !explicitGormSrc
}

doLast {
ant.mkdir dir: project.buildDir
ant.mkdir dir: checkOutDir
Expand All @@ -79,7 +88,7 @@ task fetchSource {
if (tag) {
ant.get src: "https://github.com/grails/grails-data-mapping/archive/${tag}.zip", dest: zipFile, verbose: true
} else {
ant.get src: "http://github.com/grails/grails-data-mapping/zipball/${githubBranch}", dest: zipFile, verbose: true
ant.get src: "https://github.com/grails/grails-data-mapping/zipball/${githubBranch}", dest: zipFile, verbose: true
}

ant.unzip src: zipFile, dest: checkOutDir, {
Expand Down Expand Up @@ -124,6 +133,16 @@ tasks.withType(Groovydoc) {
classpath += configurations.documentation
}

tasks.withType(org.gradle.api.tasks.javadoc.Groovydoc) {
configure {
access = GroovydocAccess.PRIVATE
processScripts = false
includeMainForScripts = false
includeAuthor = true
groovyClasspath = configurations.documentation
}
}

task copyResources(type:Copy) {
from 'src/docs/resources'
into "${project.buildDir}/docs"
Expand All @@ -132,8 +151,13 @@ task copyResources(type:Copy) {
task docs(dependsOn:[asciidoctor, copyDocs, groovydoc, copyResources] + subprojects.findAll { project -> project.tasks.findByName('groovydoc')}
.collect { project -> project.tasks.groovydoc })

//task assemble(type: Zip, dependsOn:docs) {
// from "${project.buildDir}/docs"
// baseName = "${project.name}-${project.version}"
// destinationDir = project.file("${project.buildDir}/distributions")
//}
task assembleDocsDist(type: Zip) {
dependsOn docs
from "${project.buildDir}/docs"
include '*'
include '*/**'
archiveFileName = "${project.name}-${project.version}.zip"
destinationDirectory = project.layout.buildDirectory.dir('distributions')
}

docs.finalizedBy assembleDocsDist
17 changes: 13 additions & 4 deletions examples/grails3-hibernate5-mongodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,24 @@ dependencies {
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

webdriverBinaries {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
}
//compileGroovy.groovyOptions.forkOptions.jvmArgs = ['-Xdebug','-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']


Expand Down
18 changes: 14 additions & 4 deletions examples/grails3-mongodb-database-per-tenant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@ dependencies {
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

webdriverBinaries {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
}
18 changes: 13 additions & 5 deletions examples/grails3-mongodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,24 @@ dependencies {
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"
}

webdriverBinaries {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
}



14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
assetPipelineVersion=3.3.4
caffeineVersion=2.9.3
chromeDriverVersion=2.44
datastoreVersion=7.3.4
datastoreVersion=8.0.0-M2
gebVersion=2.3
geckodriverVersion=0.23.0
grailsGradlePluginVersion=5.3.0
grailsGradlePluginVersion=6.0.0-M2
groovyVersion=3.0.11
h2Version=1.4.200
hibernateCoreVersion=5.5.7.Final
Expand All @@ -16,7 +14,7 @@ junitJupiterVersion=5.9.3
mongoJavaServerVersion=1.28.0
mongodbDriverVersion=4.5.0
mongodbRxDriverVersion=1.10.0
pluginGrailsVersion=5.2.2
pluginGrailsVersion=6.0.0-M2
projectVersion=8.0.0-SNAPSHOT
seleniumSafariDriverVersion=3.14.0
seleniumVersion=3.14.0
Expand All @@ -30,8 +28,10 @@ org.gradle.parallel=false
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M
# only required by sample apps
fieldsVersion=3.0.0.RC1
grailsVersion=5.1.7
grailsVersion=6.0.0-M2
micrometer.version=1.8.0
scaffolingVersion=4.1.0
testingSupportVersion=2.6.1
testingSupportVersion=3.0.0-M1
micronaut.spring.version=4.0.1
chromeDriverVersion=96.0.4664.45
geckodriverVersion=0.24.0
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-6.9.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.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