From 5f373b30623c856a8709f05b52f784fc0c178575 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 26 May 2021 09:58:52 +0900 Subject: [PATCH] Configure kotlin directly in only project that uses it and enable testLatestDeps (#3081) --- gradle/dependencies.gradle | 4 ---- gradle/test-with-kotlin.gradle | 8 -------- instrumentation/instrumentation.gradle | 1 - .../kotlinx-coroutines-javaagent.gradle | 16 +++++++++++++--- settings.gradle | 1 + 5 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 gradle/test-with-kotlin.gradle diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 71e19360fd..c978f553b5 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -19,8 +19,6 @@ ext { logback : "1.2.3", bytebuddy : "1.10.18", // Also explicitly specified in buildSrc scala : "2.11.12", - kotlin : "1.4.0", - coroutines : "1.3.0", springboot : "2.3.1.RELEASE", junit5 : "5.7.1", checkerFramework : "3.6.1", @@ -100,8 +98,6 @@ ext { "org.slf4j:jul-to-slf4j:${versions.slf4j}", ], scala : "org.scala-lang:scala-library:${versions.scala}", - kotlin : "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}", - coroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}", junitApi : "org.junit.jupiter:junit-jupiter-api:${versions.junit5}", assertj : "org.assertj:assertj-core:${versions.assertj}", awaitility : "org.awaitility:awaitility:${versions.awaitility}", diff --git a/gradle/test-with-kotlin.gradle b/gradle/test-with-kotlin.gradle deleted file mode 100644 index 194f8df31d..0000000000 --- a/gradle/test-with-kotlin.gradle +++ /dev/null @@ -1,8 +0,0 @@ -// Enable testing kotlin code in groovy spock tests. -apply plugin: 'org.jetbrains.kotlin.jvm' - -tasks.named('compileTestGroovy').configure { - //Note: look like it should be `classpath += files(sourceSets.test.kotlin.classesDirectory)` - //instead, but kotlin plugin doesn't support it (yet?) - classpath += files(compileTestKotlin.destinationDir) -} diff --git a/instrumentation/instrumentation.gradle b/instrumentation/instrumentation.gradle index 5c8a99ad8a..1631e28cb6 100644 --- a/instrumentation/instrumentation.gradle +++ b/instrumentation/instrumentation.gradle @@ -8,7 +8,6 @@ buildscript { dependencies { classpath "net.bytebuddy:byte-buddy-gradle-plugin:${versions.bytebuddy}" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" } } plugins { diff --git a/instrumentation/kotlinx-coroutines/javaagent/kotlinx-coroutines-javaagent.gradle b/instrumentation/kotlinx-coroutines/javaagent/kotlinx-coroutines-javaagent.gradle index 0f61e916b6..11f58ab86a 100644 --- a/instrumentation/kotlinx-coroutines/javaagent/kotlinx-coroutines-javaagent.gradle +++ b/instrumentation/kotlinx-coroutines/javaagent/kotlinx-coroutines-javaagent.gradle @@ -1,5 +1,8 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' +} + apply from: "$rootDir/gradle/instrumentation.gradle" -apply from: "$rootDir/gradle/test-with-kotlin.gradle" muzzle { pass { @@ -18,6 +21,13 @@ dependencies { compileOnly deps.opentelemetryKotlin testImplementation deps.opentelemetryKotlin - testImplementation deps.kotlin - testImplementation deps.coroutines + testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + // Use first version with flow support since we have tests for it. + testLibrary "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0" +} + +tasks.named('compileTestGroovy').configure { + //Note: look like it should be `classpath += files(sourceSets.test.kotlin.classesDirectory)` + //instead, but kotlin plugin doesn't support it (yet?) + classpath += files(compileTestKotlin.destinationDir) } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 7d8c7b335d..e94d533f65 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,6 +7,7 @@ pluginManagement { id "io.github.gradle-nexus.publish-plugin" version "1.0.0" id "me.champeau.jmh" version "0.6.4" id "net.ltgt.errorprone" version "1.3.0" + id 'org.jetbrains.kotlin.jvm' version '1.5.10' id 'org.unbroken-dome.test-sets' version '4.0.0' id "nebula.release" version "15.3.0" id 'org.gradle.test-retry' version '1.2.0'