diff --git a/build.gradle b/build.gradle index 8d345d3777..f153dc00b9 100644 --- a/build.gradle +++ b/build.gradle @@ -6,12 +6,11 @@ buildscript { dependencies { classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2" classpath "io.github.gradle-nexus:publish-plugin:1.3.0" - classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' classpath "io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1" classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" classpath "org.grails.plugins:views-gradle:2.3.2" classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1' - classpath "gradle.plugin.com.energizedwork.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" + classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.0" classpath "org.gradle:test-retry-gradle-plugin:1.5.2" } } @@ -88,7 +87,7 @@ subprojects { Project subproject -> if (subproject.name != "examples-grails-data-service") { apply plugin:"org.grails.grails-web" apply plugin:"org.grails.grails-gsp" - apply plugin:"com.energizedwork.webdriver-binaries" + apply plugin:"com.github.erdi.webdriver-binaries" } } @@ -201,11 +200,6 @@ subprojects { Project subproject -> } else { apply plugin:"groovy" - apply plugin: 'com.bmuschko.nexus' - - modifyPom { - delegate.project pomInfo - } } apply plugin: 'java-library' @@ -216,6 +210,11 @@ subprojects { Project subproject -> sourceCompatibility = "1.11" targetCompatibility = "1.11" + java { + withJavadocJar() + withSourcesJar() + } + dependencies { documentation "org.fusesource.jansi:jansi:$jansiVersion" documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion" @@ -269,25 +268,46 @@ subprojects { Project subproject -> publications { maven(MavenPublication) { + + pom { + name = projectInfo.projectName + description = projectInfo.projectDescription + url = projectInfo.projectURL + + licenses { + license { + name = 'The Apache Software License, Version 2.0' + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' + } + } + + scm { + url = 'scm:git@github.com:grails/gorm-hibernate5.git' + connection = 'scm:git@github.com:grails/gorm-hibernate5.git' + developerConnection = 'scm:git@github.com:grails/gorm-hibernate5.git' + } + + developers { + developer { + id = 'puneetbehl' + name = 'Puneet Behl' + email = 'behlp@objectcomputing.com' + } + } + } + artifactId projectInfo.projectArtifactId from components.java - afterEvaluate { - artifact source: sourcesJar, classifier: "sources" - artifact source: javadocJar, classifier: "javadoc" + afterEvaluate { if(isGrails3PluginProject) { artifact source:"${sourceSets.main.groovy.outputDir}/META-INF/grails-plugin.xml", classifier:"plugin", extension:'xml' } } - pom.withXml { - def xml = asNode() - def dependency = xml.dependencies.find { dep -> dep.artifactId == 'slf4j-simple' } - dependency?.optional = true - xml.children().last() + pomInfo - } } } diff --git a/examples/grails3-hibernate5/build.gradle b/examples/grails3-hibernate5/build.gradle index bfb41ca24c..57578a982f 100644 --- a/examples/grails3-hibernate5/build.gradle +++ b/examples/grails3-hibernate5/build.gradle @@ -43,14 +43,26 @@ dependencies { testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" 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.fork = true //compileGroovy.groovyOptions.forkOptions.jvmArgs = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'] diff --git a/examples/grails3-multiple-datasources/build.gradle b/examples/grails3-multiple-datasources/build.gradle index f678a26902..693f78081c 100644 --- a/examples/grails3-multiple-datasources/build.gradle +++ b/examples/grails3-multiple-datasources/build.gradle @@ -32,11 +32,23 @@ dependencies { testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" 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" + } +} + diff --git a/examples/grails3-schema-per-tenant/build.gradle b/examples/grails3-schema-per-tenant/build.gradle index ac310b1ee0..1ed22a673f 100644 --- a/examples/grails3-schema-per-tenant/build.gradle +++ b/examples/grails3-schema-per-tenant/build.gradle @@ -32,11 +32,22 @@ dependencies { testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" 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" + } } diff --git a/gradle.properties b/gradle.properties index d70c961ebe..661bf28ee6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,5 @@ assetPipelineVersion=3.3.4 -chromeDriverVersion=2.44 gebVersion=2.3 -geckodriverVersion=0.23.0 gormVersion=8.0.0-M1 grailsGradlePluginVersion=6.0.0-SNAPSHOT groovyVersion=3.0.11 @@ -28,7 +26,6 @@ springBootVersion=2.7.11 springVersion=5.3.20 tomcatLog4jVersion=8.5.2 tomcatVersion=9.0.74 -webdriverBinariesVersion=1.4 # Following are used only for example projects fieldsVersion=3.0.0.RC1 @@ -40,3 +37,5 @@ org.gradle.caching=true org.gradle.parallel=false org.gradle.daemon=true org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M +chromeDriverVersion=96.0.4664.45 +geckodriverVersion=0.24.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023..943f0cbfa7 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 53b9e3802b..508322917b 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-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 diff --git a/gradlew b/gradlew index 1b6c787337..65dcd68d65 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 @@ -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. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f938..6689b85bee 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -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 @@ -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% @@ -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. @@ -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