Browse Source

Update Gradle and build dependencies (#5531)

Anuraag Agrawal 3 years ago
parent
commit
487a01eb3e

+ 2 - 1
buildscripts/checkstyle.xml

@@ -390,8 +390,9 @@
   <!-- skip jflex generated files -->
   <module name="SuppressionSingleFilter">
     <property name="checks" value=".*"/>
+    <!-- TODO(anuraaga): Fix path after https://github.com/jprante/gradle-plugin-jflex/issues/20 -->
     <property name="files"
-      value="instrumentation-api[/\\]build[/\\]generated[/\\]sources[/\\]jflex"/>
+      value="instrumentation-api[/\\]build[/\\]generated[/\\]sources[/\\]main"/>
   </module>
   <module name="SuppressionSingleFilter">
     <property name="checks" value="MethodName"/>

+ 7 - 7
conventions/build.gradle.kts

@@ -39,12 +39,12 @@ 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:6.1.2")
-  implementation("com.google.guava:guava:31.0.1-jre")
+  implementation("com.diffplug.spotless:spotless-plugin-gradle:6.3.0")
+  implementation("com.google.guava:guava:31.1-jre")
   implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
   implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
-  implementation("org.ow2.asm:asm:9.1")
-  implementation("org.ow2.asm:asm-tree:9.1")
+  implementation("org.ow2.asm:asm:9.2")
+  implementation("org.ow2.asm:asm-tree:9.2")
   implementation("org.apache.httpcomponents:httpclient:4.5.13")
   implementation("org.gradle:test-retry-gradle-plugin:1.3.1")
   implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.4")
@@ -53,11 +53,11 @@ dependencies {
   implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0")
   implementation("me.champeau.jmh:jmh-gradle-plugin:0.6.6")
   implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.2")
-  implementation("net.ltgt.gradle:gradle-nullaway-plugin:1.2.0")
-  implementation("me.champeau.gradle:japicmp-gradle-plugin:0.3.0")
+  implementation("net.ltgt.gradle:gradle-nullaway-plugin:1.3.0")
+  implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.0")
 
   testImplementation(enforcedPlatform("org.junit:junit-bom:5.8.2"))
   testImplementation("org.junit.jupiter:junit-jupiter-api")
   testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
-  testImplementation("org.assertj:assertj-core:3.21.0")
+  testImplementation("org.assertj:assertj-core:3.22.0")
 }

+ 8 - 8
conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts

@@ -51,28 +51,28 @@ tasks {
     val apiNewVersion: String? by project
     val newArtifact = apiNewVersion?.let { findArtifact(it) }
       ?: file(getByName<Jar>("jar").archiveFile)
-    newClasspath = files(newArtifact)
+    newClasspath.from(files(newArtifact))
 
     // only output changes, not everything
-    isOnlyModified = true
+    onlyModified.set(true)
 
     // the japicmp "old" version is either the user-specified one, or the latest release.
     val apiBaseVersion: String? by project
     val baselineVersion = apiBaseVersion ?: latestReleasedVersion
-    oldClasspath = try {
+    oldClasspath.from(try {
       files(findArtifact(baselineVersion))
     } catch (e: Exception) {
       // if we can't find the baseline artifact, this is probably one that's never been published before,
       // so publish the whole API. We do that by flipping this flag, and comparing the current against nothing.
-      isOnlyModified = false
+      onlyModified.set(false)
       files()
-    }
+    })
 
     // this is needed so that we only consider the current artifact, and not dependencies
-    isIgnoreMissingClasses = true
-    packageExcludes = listOf("*.internal", "*.internal.*")
+    ignoreMissingClasses.set(true)
+    packageExcludes.addAll("*.internal", "*.internal.*")
     val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion
     val newVersionString = if (apiNewVersion == null) "current" else apiNewVersion
-    txtOutputFile = file("$rootDir/docs/apidiffs/${newVersionString}_vs_$baseVersionString/${base.archivesName.get()}.txt")
+    txtOutputFile.set(file("$rootDir/docs/apidiffs/${newVersionString}_vs_$baseVersionString/${base.archivesName.get()}.txt"))
   }
 }

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

@@ -212,11 +212,8 @@ fun isJavaVersionAllowed(version: JavaVersion): Boolean {
   return true
 }
 
-class TestcontainersBuildService : BuildService<BuildServiceParameters.None?> {
-  override fun getParameters(): BuildServiceParameters.None? {
-    return null
-  }
-}
+abstract class TestcontainersBuildService : BuildService<BuildServiceParameters.None>
+
 // To limit number of concurrently running resource intensive tests add
 // tasks {
 //   test {

+ 2 - 2
gradle-plugins/build.gradle.kts

@@ -24,7 +24,7 @@ configurations.named("compileOnly") {
 }
 
 dependencies {
-  implementation("com.google.guava:guava:31.0.1-jre")
+  implementation("com.google.guava:guava:31.1-jre")
   // we need to use byte buddy variant that does not shade asm
   implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.6") {
     exclude(group = "net.bytebuddy", module = "byte-buddy")
@@ -37,7 +37,7 @@ dependencies {
 
   implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
 
-  testImplementation("org.assertj:assertj-core:3.21.0")
+  testImplementation("org.assertj:assertj-core:3.22.0")
 
   testImplementation(enforcedPlatform("org.junit:junit-bom:5.8.2"))
   testImplementation("org.junit.jupiter:junit-jupiter-api")

+ 3 - 3
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionSha256Sum=8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
 zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
+zipStorePath=wrapper/dists

+ 0 - 10
instrumentation-api/build.gradle.kts

@@ -11,16 +11,6 @@ plugins {
   id("otel.jmh-conventions")
 }
 
-sourceSets {
-  main {
-    java {
-      // gradle-jflex-plugin has a bug in that it always looks for the last srcDir in this source
-      // set to generate into. By default it would be the src/main directory itself.
-      srcDir("$buildDir/generated/sources/jflex")
-    }
-  }
-}
-
 group = "io.opentelemetry.instrumentation"
 
 dependencies {

+ 4 - 4
settings.gradle.kts

@@ -1,12 +1,12 @@
 pluginManagement {
   plugins {
-    id("com.github.ben-manes.versions") version "0.41.0"
-    id("com.github.jk1.dependency-license-report") version "2.0"
-    id("com.gradle.plugin-publish") version "0.18.0"
+    id("com.github.ben-manes.versions") version "0.42.0"
+    id("com.github.jk1.dependency-license-report") version "2.1"
+    id("com.gradle.plugin-publish") version "0.20.0"
     id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
     id("org.jetbrains.kotlin.jvm") version "1.6.10"
     id("org.unbroken-dome.test-sets") version "4.0.0"
-    id("org.xbib.gradle.plugin.jflex") version "1.5.0"
+    id("org.xbib.gradle.plugin.jflex") version "1.6.0"
   }
 }