Skip to content

Commit

Permalink
compile grails-gradle-plugin with the Groovy version provided by Grad…
Browse files Browse the repository at this point in the history
…le (#334)

* compile grails-gradle-plugin with the Groovy version provided by Gradle
to ensure build compatibility with Gradle, currently Groovy 3.0.x
see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
  • Loading branch information
jamesfredley authored Sep 21, 2024
1 parent fb5069a commit c28e624
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
34 changes: 22 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
classpath "io.github.gradle-nexus:publish-plugin:$gradleNexusPublishPluginVersion"
}
}

Expand All @@ -18,9 +18,9 @@ repositories {

ext.isSnapshot = version.endsWith("-SNAPSHOT")
ext.isReleaseVersion = !ext.isSnapshot
ext."signing.keyId" = System.getenv("SIGNING_KEY") ?: project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : null
ext."signing.password" = System.getenv("SIGNING_PASSPHRASE") ?: project.hasProperty("signing.password") ? project.getProperty('signing.password') : null
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : null
ext."signing.keyId" = project.findProperty("signing.keyId") ?: System.getenv('SIGNING_KEY')
ext."signing.password" = project.findProperty("signing.password") ?: System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.findProperty("signing.secretKeyRingFile") ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"

ext.pomInfo = {
delegate.url 'https://github.com/grails/grails-gradle-plugin'
Expand Down Expand Up @@ -74,18 +74,28 @@ java {
withSourcesJar()
}

// resolve conflict from Gradle's version of Groovy. Not needed if Gradle switches to 4.0
configurations.configureEach { exclude group: 'org.apache.groovy', module: 'groovy-xml' }

dependencies {
implementation "io.github.gradle-nexus:publish-plugin:2.0.0"
implementation "com.bmuschko:gradle-nexus-plugin:2.3.1"
implementation "org.grails:grails-bootstrap:$grailsVersion"
// compile grails-gradle-plugin with the Groovy version provided by Gradle
// to ensure build compatibility with Gradle, currently Groovy 3.0.x
// see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
compileOnly "org.codehaus.groovy:groovy:$GroovySystem.version"
compileOnly "org.grails:grails-bootstrap:$grailsVersion", {
exclude group: 'org.apache.groovy'
}
compileOnly "org.grails:grails-shell:$grailsShellVersion", {
exclude group: 'org.apache.groovy'
}

runtimeOnly "org.grails:grails-bootstrap:$grailsVersion"
runtimeOnly "org.grails:grails-shell:$grailsShellVersion"

implementation "org.grails:grails-gradle-model:$grailsVersion"
implementation "org.grails:grails-shell:$grailsShellVersion"

implementation "io.github.gradle-nexus:publish-plugin:$gradleNexusPublishPluginVersion"
implementation "com.bmuschko:gradle-nexus-plugin:$gradleNexusPluginVersion"
implementation "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
implementation "org.springframework.boot:spring-boot-loader-tools:$springBootVersion"
implementation "io.spring.gradle:dependency-management-plugin:1.1.6"
implementation "io.spring.gradle:dependency-management-plugin:$springGradleDependencyManagementVersion"
}

gradlePlugin {
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
projectVersion=7.0.0-SNAPSHOT
gradleNexusPluginVersion=2.3.1
gradleNexusPublishPluginVersion=2.0.0
grailsVersion=7.0.0-SNAPSHOT
grailsShellVersion=7.0.0-SNAPSHOT
springBootVersion=3.3.4
springGradleDependencyManagementVersion=1.1.6
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M

0 comments on commit c28e624

Please sign in to comment.