Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,23 @@ protobuf {
}
}

val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")
val protoArchive = layout.buildDirectory.file("archives/opentelemetry-proto-$protoVersion.zip")

tasks {
test {
useJUnitPlatform()
}

val downloadProtoArchive by registering(Download::class) {
onlyIf { !protoArchive.exists() }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that you removed this because gradle is smart enough to figure out that it doesn't need to download it again when the destination file already exists

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the overwrite(false) below takes care of that.

I checked we have same pattern in two other repos.

src("https://github.com/open-telemetry/opentelemetry-proto/archive/v$protoVersion.zip")
dest(protoArchive)
overwrite(false)
}

val unzipProtoArchive by registering(Copy::class) {
dependsOn(downloadProtoArchive)
from(zipTree(protoArchive))
into("$buildDir/protos")
into(layout.buildDirectory.dir("protos"))
}

named("processResources") {
Expand All @@ -101,7 +101,7 @@ tasks {
sourceSets {
main {
proto {
srcDir("$buildDir/protos/opentelemetry-proto-$protoVersion")
srcDir(layout.buildDirectory.dir("protos/opentelemetry-proto-$protoVersion"))
}
}
}
Expand Down