Skip to content

Commit

Permalink
Update build scripts to avoid deprecation warnings with Gradle 8
Browse files Browse the repository at this point in the history
Closes gh-884
  • Loading branch information
rainboyan committed Jan 5, 2025
1 parent 8684626 commit 4c74d68
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
36 changes: 20 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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/"
}
}
}

Expand Down Expand Up @@ -124,8 +130,6 @@ allprojects {
}
}

apply from: "gradle/idea.gradle"

subprojects { project ->
version = grailsVersion
group = "org.graceframework"
Expand Down Expand Up @@ -187,6 +191,8 @@ subprojects { project ->
apply plugin: "org.gradle.test-retry"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
Expand Down Expand Up @@ -222,7 +228,7 @@ subprojects { project ->

afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
required = isReleaseVersion && gradle.taskGraph.hasTask("publish")
sign publishing.publications.maven
}
}
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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]) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion grace-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
9 changes: 5 additions & 4 deletions grace-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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"
}

Expand Down
10 changes: 7 additions & 3 deletions grace-shell/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
maven {
url = "https://repo.grails.org/grails/core"
}
}
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4c74d68

Please sign in to comment.