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

Update to Groovy 4 #5532

Merged
merged 3 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Update to Groovy 4
  • Loading branch information
laurit committed Mar 9, 2022
commit 65544d8db61eb7d1cd502b0cd1d3edad57ab56ae
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ tasks.withType<JavaCompile>().configureEach {
// Groovy and Scala compilers don't actually understand --release option
afterEvaluate {
tasks.withType<GroovyCompile>().configureEach {
sourceCompatibility = otelJava.minJavaVersionSupported.get().majorVersion
targetCompatibility = otelJava.minJavaVersionSupported.get().majorVersion
var javaVersion = otelJava.minJavaVersionSupported.get().majorVersion
if (javaVersion == "8") {
javaVersion = "1.8"
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType<ScalaCompile>().configureEach {
sourceCompatibility = otelJava.minJavaVersionSupported.get().majorVersion
Expand Down
13 changes: 7 additions & 6 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ rootProject.extra["versions"] = dependencyVersions
val otelVersion = "1.12.0"
rootProject.extra["otelVersion"] = otelVersion

// Need both BOM and -all
val groovyVersion = "3.0.9"
// Need both BOM and groovy jars
val groovyVersion = "4.0.1"

// We don't force libraries we instrument to new versions since we compile and test against specific
// old baseline versions
Expand All @@ -32,7 +32,7 @@ val groovyVersion = "3.0.9"
val DEPENDENCY_BOMS = listOf(
"com.fasterxml.jackson:jackson-bom:2.13.1",
"com.google.guava:guava-bom:31.0.1-jre",
"org.codehaus.groovy:groovy-bom:${groovyVersion}",
"org.apache.groovy:groovy-bom:${groovyVersion}",
"io.opentelemetry:opentelemetry-bom:${otelVersion}",
"io.opentelemetry:opentelemetry-bom-alpha:${otelVersion}-alpha",
"org.junit:junit-bom:5.8.2"
Expand Down Expand Up @@ -109,11 +109,12 @@ val DEPENDENCIES = listOf(
"org.awaitility:awaitility:4.1.1",
"com.google.code.findbugs:annotations:3.0.1u2",
"com.google.code.findbugs:jsr305:3.0.2",
"org.codehaus.groovy:groovy-all:${groovyVersion}",
"org.apache.groovy:groovy:${groovyVersion}",
"org.apache.groovy:groovy-json:${groovyVersion}",
"org.junit-pioneer:junit-pioneer:1.5.0",
"org.objenesis:objenesis:3.2",
"org.spockframework:spock-core:2.0-groovy-3.0",
"org.spockframework:spock-junit4:2.0-groovy-3.0",
"org.spockframework:spock-core:2.2-M1-groovy-4.0",
"org.spockframework:spock-junit4:2.2-M1-groovy-4.0",
"org.scala-lang:scala-library:2.11.12",
"org.springframework.boot:spring-boot-dependencies:2.3.1.RELEASE",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
implementation("javax.annotation:javax.annotation-api:1.3.2")
implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {

api("org.apache.httpcomponents:httpclient:4.3")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
2 changes: 1 addition & 1 deletion instrumentation/armeria-1.3/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
implementation("com.github.stefanbirkner:system-lambda")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
implementation("com.github.stefanbirkner:system-lambda")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
testImplementation("org.codehaus.groovy:groovy-all")
testImplementation("org.apache.groovy:groovy")
testImplementation("org.spockframework:spock-core")

testImplementation(project(":instrumentation-api"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
api("com.couchbase.client:java-client:2.5.0")
api("org.springframework.data:spring-data-couchbase:2.0.0.RELEASE")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
23 changes: 23 additions & 0 deletions instrumentation/grails-3.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,26 @@ dependencies {
testLibrary("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
testLibrary("org.springframework.boot:spring-boot-starter-tomcat:$springBootVersion")
}

// exclude groovy 4 from testing-common
laurit marked this conversation as resolved.
Show resolved Hide resolved
configurations.configureEach {
exclude("org.apache.groovy", "groovy")
exclude("org.apache.groovy", "groovy-json")
}

configurations.configureEach {
if (!name.contains("muzzle")) {
resolutionStrategy {
eachDependency {
// groovy compilation fails when spock is removed
// just set spock and groovy to compatible versions
if (requested.group == "org.spockframework") {
useVersion("2.1-groovy-3.0")
}
if (requested.group == "org.codehaus.groovy") {
useVersion("3.0.9")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
api(project(":testing-common"))
api("javax.ws.rs:javax.ws.rs-api:2.0")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
implementation("org.slf4j:slf4j-api")
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/jdbc/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ plugins {
}

dependencies {
implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {

implementation("org.junit.jupiter:junit-jupiter-api")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
implementation("org.testcontainers:testcontainers")
implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ abstract class AbstractLogbackTest extends InstrumentationSpecification {
def "ids when span"() {
when:
Span span1 = runWithSpan("test") {
logger.info("log message 1")
AbstractLogbackTest.logger.info("log message 1")
Span.current()
}

logger.info("log message 2")

Span span2 = runWithSpan("test 2") {
logger.info("log message 3")
AbstractLogbackTest.logger.info("log message 3")
Span.current()
}

Expand Down
2 changes: 1 addition & 1 deletion instrumentation/mongo/mongo-3.1/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {

compileOnly("org.mongodb:mongo-java-driver:3.1.0")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api(project(":testing-common"))
api("org.testcontainers:mongodb:${versions["org.testcontainers"]}")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api(project(":testing-common"))
api("com.typesafe.play:play-ahc-ws-standalone_$scalaVersion:1.0.2")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
implementation("io.ratpack:ratpack-core:1.4.0")
implementation("io.ratpack:ratpack-test:1.4.0")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {

api("io.projectreactor:reactor-core:3.1.0.RELEASE")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation("org.restlet:org.restlet.ext.spring:1.1.5")
implementation("org.springframework:spring:2.5.6")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
implementation("org.restlet.jse:org.restlet:2.0.2")
implementation("org.restlet.jse:org.restlet.ext.spring:2.0.2")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
implementation("org.apache.rocketmq:rocketmq-test:4.8.0")

implementation("com.google.guava:guava")
implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

implementation("com.google.guava:guava")

implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

implementation("io.opentelemetry:opentelemetry-extension-annotations")
implementation("com.google.guava:guava")
implementation("org.codehaus.groovy:groovy-all")
implementation("org.apache.groovy:groovy")
implementation("io.opentelemetry:opentelemetry-api")
implementation("org.spockframework:spock-core")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import groovy.servlet.AbstractHttpServlet
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import javax.servlet.http.HttpServlet
import spock.lang.Subject

import javax.servlet.ServletOutputStream
Expand All @@ -30,7 +30,7 @@ class HttpServletResponseTest extends AgentInstrumentationSpecification {
}

def setup() {
def servlet = new AbstractHttpServlet() {}
def servlet = new HttpServlet() {}
// We need to call service so HttpServletAdvice can link the request to the response.
servlet.service((ServletRequest) request, (ServletResponse) response)
clearExportedData()
Expand Down Expand Up @@ -93,7 +93,7 @@ class HttpServletResponseTest extends AgentInstrumentationSpecification {
throw ex
}
}
def servlet = new AbstractHttpServlet() {}
def servlet = new HttpServlet() {}
// We need to call service so HttpServletAdvice can link the request to the response.
servlet.service((ServletRequest) request, (ServletResponse) response)
clearExportedData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import groovy.servlet.AbstractHttpServlet
import io.opentelemetry.instrumentation.test.base.HttpServerTest
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

Expand All @@ -18,7 +18,7 @@ import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint

class TestServlet2 {

static class Sync extends AbstractHttpServlet {
static class Sync extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) {
req.getRequestDispatcher()
Expand Down
Loading