Pārlūkot izejas kodu

Update to Gradle 7.1 (#3344)

Anuraag Agrawal 3 gadi atpakaļ
vecāks
revīzija
97254f04d1

+ 6 - 6
buildSrc/build.gradle.kts

@@ -41,18 +41,18 @@ dependencies {
   implementation("org.apache.maven:maven-aether-provider:3.3.9")
 
   // When updating, update above in plugins too
-  implementation("com.diffplug.spotless:spotless-plugin-gradle:5.13.0")
+  implementation("com.diffplug.spotless:spotless-plugin-gradle:5.14.0")
   implementation("com.google.guava:guava:30.1-jre")
   implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0")
-  implementation("org.ow2.asm:asm:7.0-beta")
-  implementation("org.ow2.asm:asm-tree:7.0-beta")
-  implementation("org.apache.httpcomponents:httpclient:4.5.10")
+  implementation("org.ow2.asm:asm:9.1")
+  implementation("org.ow2.asm:asm-tree:9.1")
+  implementation("org.apache.httpcomponents:httpclient:4.5.13")
   implementation("org.gradle:test-retry-gradle-plugin:1.2.1")
   // When updating, also update dependencyManagement/dependencyManagement.gradle.kts
   implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.11.2")
   implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.1")
 
-  testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
-  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1")
+  testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
+  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
   testImplementation("org.assertj:assertj-core:3.19.0")
 }

+ 2 - 2
buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/bytebuddy/ByteBuddyPluginConfigurator.java

@@ -103,13 +103,13 @@ public class ByteBuddyPluginConfigurator {
               Task maybeCompileTask = compileTaskProvider.get();
               if (maybeCompileTask instanceof AbstractCompile) {
                 AbstractCompile compileTask = (AbstractCompile) maybeCompileTask;
-                File classesDirectory = compileTask.getDestinationDir();
+                File classesDirectory = compileTask.getDestinationDirectory().getAsFile().get();
                 File rawClassesDirectory =
                     new File(classesDirectory.getParent(), classesDirectory.getName() + "raw")
                         .getAbsoluteFile();
 
                 task.dependsOn(compileTask);
-                compileTask.setDestinationDir(rawClassesDirectory);
+                compileTask.getDestinationDirectory().set(rawClassesDirectory);
 
                 task.setSource(rawClassesDirectory);
                 task.setTarget(classesDirectory);

+ 4 - 4
buildSrc/src/main/kotlin/otel.jacoco-conventions.gradle.kts

@@ -3,7 +3,7 @@ plugins {
 }
 
 jacoco {
-  toolVersion = "0.8.6"
+  toolVersion = "0.8.7"
 }
 
 tasks {
@@ -11,9 +11,9 @@ tasks {
     dependsOn("test")
 
     reports {
-      xml.isEnabled = true
-      csv.isEnabled = false
-      html.destination = file("${buildDir}/reports/jacoco/")
+      xml.required.set(true)
+      csv.required.set(false)
+      html.outputLocation.set(file("${buildDir}/reports/jacoco/"))
     }
   }
 }

+ 2 - 2
buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

@@ -18,9 +18,9 @@ val otelJava = extensions.create<OtelJavaExtension>("otelJava")
 
 afterEvaluate {
   if (findProperty("mavenGroupId") == "io.opentelemetry.javaagent.instrumentation") {
-    base.archivesBaseName = "opentelemetry-javaagent-${base.archivesBaseName}"
+    base.archivesName.set("opentelemetry-javaagent-${base.archivesName.get()}")
   } else {
-    base.archivesBaseName = "opentelemetry-${base.archivesBaseName}"
+    base.archivesName.set("opentelemetry-${base.archivesName.get()}")
   }
 }
 

+ 1 - 1
buildSrc/src/main/kotlin/otel.library-instrumentation.gradle.kts

@@ -7,7 +7,7 @@ plugins {
 
 extra["mavenGroupId"] = "io.opentelemetry.instrumentation"
 
-base.archivesBaseName = projectDir.parentFile.name
+base.archivesName.set(projectDir.parentFile.name)
 
 dependencies {
   api(project(":instrumentation-api"))

+ 1 - 1
buildSrc/src/main/kotlin/otel.publish-conventions.gradle.kts

@@ -39,7 +39,7 @@ publishing {
         if (mavenGroupId != null) {
           groupId = mavenGroupId
         }
-        artifactId = artifactPrefix(project, base.archivesBaseName) + base.archivesBaseName
+        artifactId = artifactPrefix(project, base.archivesName.get()) + base.archivesName.get()
 
         if (!groupId.startsWith("io.opentelemetry.")) {
           throw GradleException("groupId is not set for this project or its parent ${project.parent}")

+ 1 - 3
buildSrc/src/main/kotlin/otel.scala-conventions.gradle.kts

@@ -11,9 +11,7 @@ dependencies {
 tasks {
   named<GroovyCompile>("compileTestGroovy") {
     sourceSets.test {
-      withConvention(ScalaSourceSet::class) {
-        classpath = classpath.plus(files(scala.classesDirectory))
-      }
+      classpath = classpath.plus(files(scala.classesDirectory))
     }
   }
 }

BIN
gradle/wrapper/gradle-wrapper.jar


+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
-distributionSha256Sum=dccda8aa069563c8ba2f6cdfd0777df0e34a5b4d15138ca8b9757e94f4e8a8cb
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
+distributionSha256Sum=2debee19271e1b82c6e41137d78e44e6e841035230a1a169ca47fd3fb09ed87b
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 1 - 1
gradlew

@@ -72,7 +72,7 @@ case "`uname`" in
   Darwin* )
     darwin=true
     ;;
-  MINGW* )
+  MSYS* | MINGW* )
     msys=true
     ;;
   NONSTOP* )

+ 4 - 3
instrumentation/gwt-2.0/javaagent/gwt-2.0-javaagent.gradle

@@ -11,11 +11,12 @@ muzzle {
 
 sourceSets {
   testapp {
-    java
+    java {
+      destinationDirectory.set(file("${buildDir}/testapp/classes"))
+    }
     resources {
       srcDirs("src/webapp")
     }
-    java.outputDir = file("$buildDir/testapp/classes")
     compileClasspath += sourceSets.main.compileClasspath
   }
 }
@@ -60,7 +61,7 @@ task compileGwt(dependsOn: classes, type: JavaExec) {
   outputs.dir extraDir
   outputs.dir warDir
 
-  main = 'com.google.gwt.dev.Compiler'
+  mainClass.set("com.google.gwt.dev.Compiler")
 
   classpath {
     [

+ 5 - 5
settings.gradle

@@ -1,18 +1,18 @@
 pluginManagement {
   plugins {
     id 'com.github.ben-manes.versions' version '0.39.0'
-    id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
-    id "me.champeau.jmh" version "0.6.4"
+    id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
+    id "me.champeau.jmh" version "0.6.5"
     id "net.ltgt.nullaway" version "1.1.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 "nebula.release" version "15.3.1"
   }
 }
 
 plugins {
-  id 'com.gradle.enterprise' version '3.6.1'
-  id 'com.github.burrunan.s3-build-cache' version '1.1'
+  id 'com.gradle.enterprise' version '3.6.3'
+  id 'com.github.burrunan.s3-build-cache' version '1.2'
 }
 
 dependencyResolutionManagement {