Skip to content

Commit be78bf6

Browse files
committed
Improve syntax
1 parent 295563c commit be78bf6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion"
6666

6767
val downloadSemanticConventions by tasks.registering(Download::class) {
6868
src(semanticConventionsRepoZip)
69-
dest("${layout.buildDirectory.asFile.get()}/semantic-conventions-${semanticConventionsVersion}/semantic-conventions.zip")
69+
dest(layout.buildDirectory.file("semantic-conventions-${semanticConventionsVersion}/semantic-conventions.zip"))
7070
overwrite(false)
7171
}
7272

@@ -79,7 +79,7 @@ val unzipConfigurationSchema by tasks.registering(Copy::class) {
7979
val pathParts = path.split("/")
8080
path = pathParts.subList(1, pathParts.size).joinToString("/")
8181
})
82-
into("${layout.buildDirectory.asFile.get()}/semantic-conventions-${semanticConventionsVersion}/")
82+
into(layout.buildDirectory.file("semantic-conventions-${semanticConventionsVersion}/"))
8383
}
8484

8585
fun generateTask(taskName: String, incubating: Boolean) {
@@ -102,10 +102,11 @@ fun generateTask(taskName: String, incubating: Boolean) {
102102
val gid = unix.getGid() // $(id -g $USERNAME)
103103
listOf("-u", "$uid:$gid")
104104
}
105+
val modelPath = layout.buildDirectory.file("semantic-conventions-${semanticConventionsVersion}/model").get()
105106
val weaver_args = listOf(
106107
"--rm",
107108
"--platform=linux/x86_64",
108-
"--mount", "type=bind,source=${layout.buildDirectory.asFile.get()}/semantic-conventions-${semanticConventionsVersion}/model,target=/home/weaver/source,readonly",
109+
"--mount", "type=bind,source=${modelPath},target=/home/weaver/source,readonly",
109110
"--mount", "type=bind,source=$projectDir/buildscripts/templates,target=/home/weaver/templates,readonly",
110111
"--mount", "type=bind,source=$projectDir/$outputDir,target=/home/weaver/target",
111112
"otel/weaver:$generatorVersion",

0 commit comments

Comments
 (0)