Skip to content

Commit b1481b9

Browse files
committed
work around wire plugin issue
1 parent 50798ff commit b1481b9

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

disk-buffering/build.gradle.kts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
import de.undercouch.gradle.tasks.download.Download
23
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSniffer
34

45
plugins {
@@ -7,7 +8,8 @@ plugins {
78
id("com.github.johnrengelman.shadow")
89
id("me.champeau.jmh") version "0.7.3"
910
id("ru.vyarus.animalsniffer") version "2.0.0"
10-
id("com.squareup.wire") version "5.3.0"
11+
id("com.squareup.wire") version "5.3.1"
12+
id("de.undercouch.download")
1113
}
1214

1315
description = "Exporter implementations that store signals on disk"
@@ -49,11 +51,14 @@ jmh {
4951
timeUnit.set("ms")
5052
}
5153

54+
val protoVersion = "1.5.0"
55+
val protoArchive = layout.buildDirectory.file("archives/opentelemetry-proto-$protoVersion.zip").get().asFile
56+
5257
wire {
5358
java {}
5459

5560
sourcePath {
56-
srcJar("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")
61+
srcDir(layout.buildDirectory.dir("protos/opentelemetry-proto-$protoVersion"))
5762
}
5863

5964
root(
@@ -63,6 +68,26 @@ wire {
6368
)
6469
}
6570

71+
afterEvaluate {
72+
tasks {
73+
val downloadProtoArchive by registering(Download::class) {
74+
onlyIf { !protoArchive.exists() }
75+
src("https://github.com/open-telemetry/opentelemetry-proto/archive/v$protoVersion.zip")
76+
dest(protoArchive)
77+
}
78+
79+
val unzipProtoArchive by registering(Copy::class) {
80+
dependsOn(downloadProtoArchive)
81+
from(zipTree(protoArchive))
82+
into(layout.buildDirectory.dir("protos"))
83+
}
84+
85+
named("generateMainProtos") {
86+
dependsOn(unzipProtoArchive)
87+
}
88+
}
89+
}
90+
6691
tasks.named<ShadowJar>("shadowJar") {
6792
archiveClassifier.set("")
6893
configurations = emptyList() // To avoid embedding any dependencies as we only need to rename some local packages.

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pluginManagement {
33
id("com.github.johnrengelman.shadow") version "8.1.1"
44
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
55
id("com.gradle.develocity") version "3.19.2"
6+
id("de.undercouch.download") version "5.6.0"
67
}
78
}
89

0 commit comments

Comments
 (0)