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

feat(deps): Update dependncy Apache Groovy to v4.0.2 #265

Closed
wants to merge 9 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: readw
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK
Expand Down
23 changes: 20 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version project.projectVersion
ext {
groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion
isCiBuild = System.getenv().get("TRAVIS") == 'true' || (System.getenv().get("CI") as Boolean)
commonBuild = 'https://raw.githubusercontent.com/grails/grails-common-build/v2.0.3'
commonBuild = 'https://raw.githubusercontent.com/grails/grails-common-build/3.0.x'
}

apply plugin:'idea'
Expand Down Expand Up @@ -56,7 +56,7 @@ subprojects {
apply from: "${commonBuild}/common-project.gradle"

dependencies {
documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
documentation "org.apache.groovy:groovy-dateutil:$groovyVersion"
}
}

Expand All @@ -67,28 +67,45 @@ subprojects {
targetCompatibility=1.17

configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(platform(module('org.apache.groovy:groovy-bom:3.0.13'))).
using module('org.apache.groovy:groovy-bom:4.0.12')
}
}

configurations.all {
exclude group: "org.codehaus.groovy", module: "groovy-bom" // we need to explicitly as groovy-bom as platform because overriding the version didn't say anything about importing it as a platform.
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == "org.spockframework") {
details.useVersion(spockVersion)
} else if (details.requested.group == "org.junit.jupiter") {
details.useVersion(junitJupiterVersion)
} else if (details.requested.group == "org.junit.platform") {
details.useVersion(junitPlatformVerison)
} else if (details.requested.group == "org.codehaus.groovy" && details.requested.name != 'groovy-bom') {
details.useTarget(group: "org.apache.groovy", name: details.requested.name, version: groovyVersion)
details.because "The dependency coordinates are changed in Apache Groovy 4"
}
}
}

dependencies {
api platform("org.apache.groovy:groovy-bom:$groovyVersion")
compileOnly "javax.servlet:javax.servlet-api:$servletApiVersion"

testImplementation "javax.servlet:javax.servlet-api:$servletApiVersion"
testImplementation "org.codehaus.groovy:groovy-test-junit5:${groovyVersion}"
testImplementation "org.apache.groovy:groovy-test-junit5:${groovyVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
testImplementation "org.junit.platform:junit-platform-runner:${junitPlatformVerison}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
}

tasks.named("compileTestGroovy") {
options.forkOptions.jvmArgs += ["-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true"]
}

tasks.withType(Test) {
systemProperty 'spock.iKnowWhatImDoing.disableGroovyVersionCheck', 'true'
useJUnitPlatform()
testLogging {
showStandardStreams = true
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ githubBranch=7.0.x
developers=Puneet Behl, Graeme Rocher
grailsGradlePluginVersion=6.1.2
grailsVersion=6.1.2
groovyVersion=3.0.20
groovyVersion=4.0.12
servletApiVersion=4.0.1
javaParserCoreVersion=3.15.14
jansiVersion=1.18
Expand All @@ -17,7 +17,7 @@ jspApiVersion=2.1
jstlVersion=1.1.2
junitJupiterVersion=5.10.2
junitPlatformVerison=1.10.2
spockVersion=2.0-groovy-3.0
spockVersion=2.3-groovy-4.0
slf4jVersion=1.7.32
antVersion=1.10.14
controllersRef=https://docs.grails.org/latest/ref/Controllers
Expand Down
2 changes: 1 addition & 1 deletion grails-gsp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ dependencies {
exclude group:'org.grails', module:'grails-spring'
}
api project(":grails-taglib")
api "org.codehaus.groovy:groovy-templates:$groovyVersion"
api "org.apache.groovy:groovy-templates:$groovyVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class GroovyPageCompiler {
compilerConfig.setSourceEncoding(encoding)
ExecutorService threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()*2)
CompletionService completionService = new ExecutorCompletionService(threadPool);
List<Future<Map>> futures = []
List<Future<?>> futures = []
try {
Integer collationLevel = Runtime.getRuntime().availableProcessors()*2
if(srcFiles.size() < collationLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import grails.util.GrailsUtil
import grails.util.Holders
import grails.util.Metadata
import grails.util.MockRequestDataValueProcessor
import groovy.transform.NotYetImplemented
import groovy.test.NotYetImplemented
import org.grails.gsp.GroovyPageBinding
import org.grails.plugins.web.taglib.ApplicationTagLib
import org.grails.plugins.web.taglib.FormTagLib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.grails.web.taglib

import groovy.xml.XmlSlurper
import org.apache.commons.lang.WordUtils
import org.junit.jupiter.api.Test
import org.springframework.context.MessageSourceResolvable
import org.springframework.web.servlet.support.RequestContextUtils as RCU
import org.w3c.dom.Document

import static org.junit.jupiter.api.Assertions.assertEquals
import static org.junit.jupiter.api.Assertions.assertNotNull
import static org.junit.jupiter.api.Assertions.assertTrue
import static org.junit.jupiter.api.Assertions.*

/**
* @author Graeme Rocher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.grails.web.taglib
import grails.gorm.annotation.Entity
import grails.testing.gorm.DataTest
import grails.testing.web.taglib.TagLibUnitTest
import groovy.xml.XmlSlurper
import org.grails.core.io.MockStringResourceLoader
import org.grails.plugins.web.taglib.ValidationTagLib
import org.grails.web.util.GrailsApplicationAttributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import grails.plugins.DefaultGrailsPluginManager
import grails.plugins.metadata.GrailsPlugin
import grails.util.GrailsUtil
import grails.util.GrailsWebMockUtil
import groovy.xml.XmlSlurper
import groovy.xml.slurpersupport.GPathResult
import org.grails.core.io.SimpleMapResourceLoader
import org.grails.gsp.compiler.GroovyPageParser
import org.grails.gsp.io.GroovyPageCompiledScriptSource
Expand Down Expand Up @@ -210,7 +212,7 @@ class GrailsConventionGroovyPageLocatorSpec extends Specification {
</plugin>
'''

def xml = new XmlSlurper().parseText(str)
GPathResult xml = new XmlSlurper().parseText(str)

def resource = new MockBinaryPluginResource(str.bytes)
def descriptor = new BinaryGrailsPluginDescriptor(resource, ['org.grails.web.gsp.io.TestBinaryResource'])
Expand Down
Loading