Update Gradle and build dependencies. (#4026)

This commit is contained in:
Anuraag Agrawal 2021-12-24 00:56:05 +09:00 committed by GitHub
parent 34dc74f220
commit 905c1ffa4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 21 deletions

View File

@ -9,19 +9,19 @@ repositories {
}
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.0.4")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.0.5")
// Needed for japicmp but not automatically brought in for some reason.
implementation("com.google.guava:guava:31.0.1-jre")
implementation("com.squareup:javapoet:1.13.0")
implementation("com.squareup.wire:wire-compiler:3.7.0")
implementation("com.squareup.wire:wire-gradle-plugin:3.7.0")
implementation("com.squareup.wire:wire-compiler:4.0.1")
implementation("com.squareup.wire:wire-gradle-plugin:4.0.1")
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.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("ru.vyarus:gradle-animalsniffer-plugin:1.5.3")
implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.4")
}
// We can't apply conventions to this build so include important ones such as the Java compilation

View File

@ -20,9 +20,9 @@ import com.squareup.wire.schema.Service
import com.squareup.wire.schema.Target
import com.squareup.wire.schema.Type
import okio.IOException
import java.nio.file.FileSystem
import java.nio.file.Files
import java.nio.file.Path
import okio.FileSystem
import okio.Path
import okio.Path.Companion.toPath
import javax.lang.model.element.Modifier.FINAL
import javax.lang.model.element.Modifier.PUBLIC
import javax.lang.model.element.Modifier.STATIC
@ -41,12 +41,12 @@ class ProtoFieldsWireHandler : CustomHandlerBeta {
logger: WireLogger,
profileLoader: ProfileLoader
): Target.SchemaHandler {
val modulePath = fs.getPath(outDirectory)
Files.createDirectories(modulePath)
val modulePath = outDirectory.toPath()
fs.createDirectories(modulePath)
val javaGenerator = JavaGenerator.get(schema)
return object : Target.SchemaHandler {
override fun handle(extend: Extend, field: Field) = null
override fun handle(extend: Extend, field: Field): Path? = null
override fun handle(service: Service): List<Path> = emptyList()
override fun handle(type: Type): Path? {
val typeSpec = javaGenerator.generateType(type, false)
@ -60,12 +60,18 @@ class ProtoFieldsWireHandler : CustomHandlerBeta {
.addFileComment("\$L", WireCompiler.CODE_GENERATED_BY_WIRE)
.addFileComment("\nSource: \$L in \$L", type.type, type.location.withPathOnly())
.build()
val generatedFilePath = modulePath.resolve(javaFile.packageName)
.resolve("${javaFile.typeSpec.name}.java")
val generatedFilePath = modulePath / javaFile.packageName / "${javaFile.typeSpec.name}.java"
val filePath = modulePath /
javaFile.packageName.replace(".", "/") /
"${javaTypeName.simpleName()}.java"
logger.artifact(modulePath, javaFile)
try {
javaFile.writeTo(modulePath)
fs.createDirectories(filePath.parent!!)
fs.write(filePath) {
writeUtf8(javaFile.toString())
}
} catch (e: IOException) {
throw IOException("Error emitting ${javaFile.packageName}.${javaFile.typeSpec.name} " +
"to $outDirectory", e)

View File

@ -1,2 +1,10 @@
Comparing source compatibility of against
No changes.
=== UNCHANGED CLASS: PUBLIC FINAL io.opentelemetry.extension.kotlin.ContextExtensionsKt (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
*** MODIFIED ANNOTATION: kotlin.Metadata
--- REMOVED ELEMENT: bv=1,0,3 (-)
*** MODIFIED ELEMENT: mv=1,5,1 (<- 1,4,0)
=== UNCHANGED ELEMENT: k=2
=== UNCHANGED ELEMENT: d1=<3D><>&#xA;<3B>&#xA;<3B><><EFBFBD>&#xA;<3B><><EFBFBD>&#xA;<3B><><EFBFBD>&#xA;<3B><><EFBFBD><EFBFBD>&#xA;<3B><><EFBFBD><EFBFBD>0<EFBFBD>*<2A>0<EFBFBD><30>&#xA;<3B><><EFBFBD><EFBFBD>0<EFBFBD>*<2A>0<EFBFBD><30>&#xA;<3B><><EFBFBD><EFBFBD>0<EFBFBD>*<2A>0<EFBFBD>¨<EFBFBD><C2A8>
=== UNCHANGED ELEMENT: d2=asContextElement,Lkotlin/coroutines/CoroutineContext;,Lio/opentelemetry/context/Context;,Lio/opentelemetry/context/ImplicitContextKeyed;,getOpenTelemetryContext,opentelemetry-extension-kotlin
+++ NEW ELEMENT: xi=48 (+)

View File

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

View File

@ -41,3 +41,9 @@ wire {
customHandlerClass = "io.opentelemetry.gradle.ProtoFieldsWireHandler"
}
}
tasks {
compileJava {
source("$buildDir/generated/source/wire")
}
}

View File

@ -67,3 +67,9 @@ wire {
customHandlerClass = "io.opentelemetry.gradle.ProtoFieldsWireHandler"
}
}
tasks {
compileJava {
source("$buildDir/generated/source/wire")
}
}

View File

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

View File

@ -1,12 +1,12 @@
pluginManagement {
plugins {
id("com.github.ben-manes.versions") version "0.39.0"
id("com.github.johnrengelman.shadow") version "7.1.0"
id("com.gradle.enterprise") version "3.7.2"
id("com.github.johnrengelman.shadow") version "7.1.1"
id("com.gradle.enterprise") version "3.8"
id("de.undercouch.download") version "4.1.2"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("nebula.release") version "16.0.0"
id("org.jetbrains.kotlin.jvm") version "1.6.0"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("org.unbroken-dome.test-sets") version "4.0.0"
}
}