Fix bug where clean doesn't remove generated code, then fix the resulting compile which requires code generation to complete.
This commit is contained in:
parent
0c8aeb1432
commit
37698ab8b6
2 changed files with 10 additions and 11 deletions
1
Makefile
1
Makefile
|
@ -17,4 +17,3 @@ addressbook : capnpc-java
|
|||
PWD=pwd
|
||||
mkdir -p examples/src/main/generated
|
||||
capnp compile -I$(PWD)/generator/src/main/cpp/compiler --src-prefix=examples/src/main/schema -o./capnpc-java:examples/src/main/generated examples/src/main/schema/addressbook.capnp
|
||||
sbt examples/compile
|
||||
|
|
|
@ -23,17 +23,10 @@ object Build extends sbt.Build {
|
|||
id = "examples",
|
||||
base = file("examples")
|
||||
).dependsOn(generator)
|
||||
.settings(makeExamplesTask)
|
||||
.settings(compile <<= compile in Compile dependsOn makeExamples)
|
||||
.settings(unmanagedSourceDirectories in Compile += sourceDirectory.value / "main" / "generated")
|
||||
.settings(publish := {})
|
||||
.settings(publishLocal := {})
|
||||
.settings(fork in run := true)
|
||||
.settings(outputStrategy := Some(StdoutOutput))
|
||||
.settings(javaOptions in run ++= Seq(
|
||||
"-ms2g",
|
||||
"-mx2g",
|
||||
"-XX:+AlwaysPreTouch",
|
||||
"-XX:+TieredCompilation"
|
||||
))
|
||||
.settings(cleanFiles += sourceDirectory.value / "main" / "generated")
|
||||
|
||||
def project(id: String, base: File) =
|
||||
Project(
|
||||
|
@ -50,6 +43,13 @@ object Build extends sbt.Build {
|
|||
val makeResult = "make".!!
|
||||
println(s"**** C++ Build Started\n$makeResult\n**** C++ Build Complete")
|
||||
}
|
||||
|
||||
val makeExamples = taskKey[Unit]("Run capnp-java compiler against the addressbook schema")
|
||||
val makeExamplesTask = makeExamples := {
|
||||
Thread.sleep(1000)
|
||||
val makeResult = "make addressbook".!!
|
||||
println(s"**** CodeGen for Addressbook Started\n$makeResult\n**** CodeGen for Addressbook Complete")
|
||||
}
|
||||
}
|
||||
|
||||
object Shared {
|
||||
|
|
Loading…
Reference in a new issue