Skip to content

Commit da87255

Browse files
committed
Only setup configuration file when running the task, not when configuring it
1 parent d1c53ca commit da87255

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

build.gradle.kts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,21 @@ fun setDefaultZephyrWasmBinary() {
8787
File(projectDir.absolutePath + "/examples/binary-counter/upload.wasm.map").copyTo(File(zephyrBuildDir.absolutePath + "/upload.wasm.map"), overwrite = true)
8888
}
8989

90-
tasks.register<Copy>("setup") {
90+
tasks.register("setup") {
9191
dependsOn("fatJar")
9292
dependsOn("makeWARDuino")
93-
setDefaultZephyrWasmBinary()
94-
95-
// Setup configuration file.
96-
val file = File("${System.getenv("HOME")}/.mio/debugger.properties")
97-
if (!file.exists()) {
98-
file.parentFile.mkdirs()
99-
println("Generating a default configuration file ${file.absolutePath}")
100-
val properties = Properties()
101-
properties.setProperty("wdcli", wdcliPath)
102-
properties.store(file.writer(), null)
93+
94+
doLast {
95+
setDefaultZephyrWasmBinary()
96+
97+
// Setup configuration file.
98+
val file = File("${System.getenv("HOME")}/.mio/debugger.properties")
99+
if (!file.exists()) {
100+
file.parentFile.mkdirs()
101+
println("Generating a default configuration file ${file.absolutePath}")
102+
val properties = Properties()
103+
properties.setProperty("wdcli", wdcliPath)
104+
properties.store(file.writer(), null)
105+
}
103106
}
104107
}

0 commit comments

Comments
 (0)