@@ -60,22 +60,24 @@ tasks.register<Jar>("fatJar") {
6060 }
6161}
6262
63- val wdcliPath = projectDir.absolutePath + " /WARDuino/build-emu/wdcli"
64-
65- tasks.register<Exec >(" cmakeWARDuino" ) {
66- val buildDir = File (File (wdcliPath).parent)
63+ fun cmakeBuildTask (dir : String ): String {
64+ val buildDir = File (File (dir).parent)
6765 buildDir.mkdirs()
68- workingDir(buildDir)
69- commandLine(" sh" , " -c" , " cmake .. -DBUILD_EMULATOR=ON" )
70- }
7166
72- tasks.register<Exec >(" makeWARDuino" ) {
73- dependsOn(" cmakeWARDuino" )
67+ val name = buildDir.parentFile.name
7468
75- val buildDir = File (File (wdcliPath).parent)
76- buildDir.mkdirs()
77- workingDir(buildDir)
78- commandLine(" sh" , " -c" , " make" )
69+ tasks.register<Exec >(" cmake-$name " ) {
70+ workingDir(buildDir)
71+ commandLine(" sh" , " -c" , " cmake .. -DBUILD_EMULATOR=ON" )
72+ }
73+
74+ tasks.register<Exec >(" make-$name " ) {
75+ dependsOn(" cmake-$name " )
76+ workingDir(buildDir)
77+ commandLine(" sh" , " -c" , " make" )
78+ }
79+
80+ return " make-$name "
7981}
8082
8183fun setDefaultZephyrWasmBinary () {
@@ -84,9 +86,15 @@ fun setDefaultZephyrWasmBinary() {
8486 File (projectDir.absolutePath + " /examples/binary-counter/upload.wasm.map" ).copyTo(File (zephyrBuildDir.absolutePath + " /upload.wasm.map" ), overwrite = true )
8587}
8688
89+ val wdcliPath = projectDir.absolutePath + " /WARDuino/build-emu/wdcli"
90+ val wdcliSymbolicPath = projectDir.absolutePath + " /WARDuino-symbolic/build-emu/wdcli"
91+ private val compileWdcliTask = cmakeBuildTask(wdcliPath)
92+ private val compileWdcliSymbolicTask = cmakeBuildTask(wdcliSymbolicPath)
93+
8794tasks.register<Copy >(" setup" ) {
8895 dependsOn(" fatJar" )
89- dependsOn(" makeWARDuino" )
96+ dependsOn(compileWdcliTask)
97+ dependsOn(compileWdcliSymbolicTask)
9098 setDefaultZephyrWasmBinary()
9199
92100 // Setup configuration file.
@@ -96,6 +104,8 @@ tasks.register<Copy>("setup") {
96104 println (" Generating a default configuration file ${file.absolutePath} " )
97105 val properties = Properties ()
98106 properties.setProperty(" wdcli" , wdcliPath)
107+ properties.setProperty(" wdcli-symbolic" , wdcliSymbolicPath)
108+ properties.setProperty(" concolic" , " true" )
99109 properties.store(file.writer(), null )
100110 }
101111}
0 commit comments