diff --git a/build.gradle b/build.gradle index e017ce41e1..86d7008a41 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,9 @@ buildscript { repositories { mavenCentral() gradlePluginPortal() - maven { url "https://plugins.gradle.org/m2/" } + maven { + url = "https://plugins.gradle.org/m2/" + } } dependencies { classpath "io.github.gradle-nexus:publish-plugin:$gradleNexusPublishPluginVersion" @@ -83,9 +85,13 @@ nexusPublishing { allprojects { repositories { mavenCentral() - maven { url "https://plugins.gradle.org/m2/" } + maven { + url = "https://plugins.gradle.org/m2/" + } if (project.projectVersion.endsWith('-SNAPSHOT')) { - maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } + maven { + url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + } } } @@ -124,8 +130,6 @@ allprojects { } } -apply from: "gradle/idea.gradle" - subprojects { project -> version = grailsVersion group = "org.graceframework" @@ -187,6 +191,8 @@ subprojects { project -> apply plugin: "org.gradle.test-retry" java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 withJavadocJar() withSourcesJar() } @@ -222,7 +228,7 @@ subprojects { project -> afterEvaluate { signing { - required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } + required = isReleaseVersion && gradle.taskGraph.hasTask("publish") sign publishing.publications.maven } } @@ -255,9 +261,6 @@ subprojects { project -> if (project.name == 'grace-dependencies') return if (project.name == 'grace-bom') return - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - jar{ manifest.mainAttributes( "Built-By": System.properties['user.name'], @@ -289,10 +292,11 @@ subprojects { project -> } configure([compileGroovy, compileTestGroovy]) { - groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G') groovyOptions.encoding = "UTF-8" options.encoding = "UTF-8" options.compilerArgs << '-parameters' + options.forkOptions.memoryInitialSize = '128M' + options.forkOptions.memoryMaximumSize = '1G' } configure([compileJava, compileTestJava]) { @@ -357,10 +361,10 @@ subprojects { project -> testLogging { events "passed", "skipped", "failed" - showExceptions true - exceptionFormat "full" - showCauses true - showStackTraces true + showExceptions = true + exceptionFormat = "full" + showCauses = true + showStackTraces = true } excludes = ["**/*TestCase.class", "**/*\$*.class"] if (isCiBuild) { @@ -446,8 +450,8 @@ sdkman { } task sdkManRelease { - group 'SDKMAN! Release' - description 'Performs a Major or Minor Release depend on project version' + group = 'SDKMAN! Release' + description = 'Performs a Major or Minor Release depend on project version' if (project.projectVersion.endsWith("SNAPSHOT")) { // Do nothing } else if (project.projectVersion.contains("M") || project.projectVersion.contains("RC")) { diff --git a/grace-bom/build.gradle b/grace-bom/build.gradle index 1086e5438f..7787609a34 100644 --- a/grace-bom/build.gradle +++ b/grace-bom/build.gradle @@ -128,7 +128,7 @@ task generateEffectiveBom(type: Copy) { include "pom-default.xml" filter(org.apache.tools.ant.filters.ReplaceTokens, beginToken: '${', endToken: '}', tokens: tokens) } - destinationDir file("$buildDir/generated/effective-bom") + destinationDir = file("$buildDir/generated/effective-bom") rename "pom-default.xml", "${project.name}-effective.xml" } diff --git a/grace-gradle-plugin/build.gradle b/grace-gradle-plugin/build.gradle index 394ffab9f1..f73e40c1be 100644 --- a/grace-gradle-plugin/build.gradle +++ b/grace-gradle-plugin/build.gradle @@ -105,9 +105,10 @@ jar { } configure([compileGroovy, compileTestGroovy]) { - groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G') groovyOptions.encoding = "UTF-8" options.encoding = "UTF-8" + options.forkOptions.memoryInitialSize = '128M' + options.forkOptions.memoryMaximumSize = '1G' } configure([compileJava, compileTestJava]) { @@ -121,9 +122,9 @@ configure([groovydoc]) { } configure([javadoc]) { - options.encoding "UTF-8" - options.docEncoding "UTF-8" - options.charSet "UTF-8" + options.encoding = "UTF-8" + options.docEncoding = "UTF-8" + options.charSet = "UTF-8" options.jFlags "-Xms64M", "-Xmx512M" } diff --git a/grace-shell/build.gradle b/grace-shell/build.gradle index a0d9a4260e..ffbe9de614 100644 --- a/grace-shell/build.gradle +++ b/grace-shell/build.gradle @@ -1,10 +1,14 @@ -apply plugin:'application' +apply plugin: 'application' -mainClassName = "org.grails.cli.GrailsCli" +application { + mainClass.set('org.grails.cli.GrailsCli') +} repositories { mavenCentral() - maven { url 'https://repo.gradle.org/gradle/libs-releases' } + maven { + url = 'https://repo.gradle.org/gradle/libs-releases' + } } ext { diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 7dd82b54d8..807229433e 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -1,6 +1,8 @@ buildscript { repositories { - maven { url "https://repo.grails.org/grails/core" } + maven { + url = "https://repo.grails.org/grails/core" + } } } @@ -78,7 +80,6 @@ task javadoc(type:Javadoc, group: 'documentation') { links("https://java.sun.com/j2ee/1.4/docs/api", "https://java.sun.com/j2se/1.5.0/docs/api", "https://static.springframework.org/spring/docs/2.5.x/api") // tags("todo:a:To do") todo fix the javadoc task to accept this option } - verbose = false } tasks.register('groovydoc', Groovydoc) { @@ -117,7 +118,7 @@ task gdoc(type: GradleBuild, dependsOn: ["groovydoc", "fetchGrailsDocsSource"], startParameter.setCurrentDir(new File("${buildDir}/grails-docs-src")); // startParameter.setSearchUpwards(false) startParameter.useEmptySettings() - buildFile = "${buildDir}/grails-docs-src/build.gradle" + dir = "${buildDir}/grails-docs-src/build.gradle" tasks = ["clean", "assemble"] doFirst {