Skip to content

Commit

Permalink
Update Gradle and build dependencies (#4270)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Mar 18, 2022
1 parent 338966e commit 345060e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
10 changes: 5 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ repositories {
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.2.2")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.3.0")
// Needed for japicmp but not automatically brought in for some reason.
implementation("com.google.guava:guava:31.0.1-jre")
implementation("com.google.guava:guava:31.1-jre")
implementation("com.squareup:javapoet:1.13.0")
implementation("com.squareup.wire:wire-compiler:4.1.0")
implementation("com.squareup.wire:wire-gradle-plugin:4.1.0")
implementation("com.squareup.wire:wire-compiler:4.2.0")
implementation("com.squareup.wire:wire-gradle-plugin:4.2.0")
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0")
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.3.0")
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.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.3.0")
Expand Down
32 changes: 18 additions & 14 deletions buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,24 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) {
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 {
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
files()
}
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.
onlyModified.set(false)
files()
}
)

// Reproduce defaults from https://github.com/melix/japicmp-gradle-plugin/blob/09f52739ef1fccda6b4310cf3f4b19dc97377024/src/main/java/me/champeau/gradle/japicmp/report/ViolationsGenerator.java#L130
// only changing the BinaryIncompatibleRule to our custom one that allows new default methods
Expand All @@ -110,11 +112,13 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) {
}

// this is needed so that we only consider the current artifact, and not dependencies
isIgnoreMissingClasses = true
packageExcludes = listOf("*.internal", "*.internal.*", "io.opentelemetry.internal.shaded.jctools.*")
ignoreMissingClasses.set(true)
packageExcludes.addAll("*.internal", "*.internal.*", "io.opentelemetry.internal.shaded.jctools.*")
val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion
txtOutputFile = apiNewVersion?.let { file("$rootDir/docs/apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
?: file("$rootDir/docs/apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
txtOutputFile.set(
apiNewVersion?.let { file("$rootDir/docs/apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
?: file("$rootDir/docs/apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
)
}
// have the check task depend on the api comparison task, to make it more likely it will get used.
named("check") {
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionSha256Sum=e5444a57cda4a95f90b0c9446a9e1b47d3d7f69057765bfb54bd4f482542d548
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

0 comments on commit 345060e

Please sign in to comment.