start trying to get EncodingTest configured
This commit is contained in:
parent
32eb8a5a1c
commit
a1be7d2e27
4 changed files with 41 additions and 3 deletions
|
@ -1633,7 +1633,9 @@ private:
|
||||||
// KJ_MAP(n, namespaceParts) { return kj::strTree("namespace ", n, " {\n"); }, "\n",
|
// KJ_MAP(n, namespaceParts) { return kj::strTree("namespace ", n, " {\n"); }, "\n",
|
||||||
"public class ", outerClassName, " {\n",
|
"public class ", outerClassName, " {\n",
|
||||||
KJ_MAP(n, nodeTexts) { return kj::mv(n.outerTypeDef); },
|
KJ_MAP(n, nodeTexts) { return kj::mv(n.outerTypeDef); },
|
||||||
KJ_MAP(n, namespaceParts) { return kj::strTree("}\n"); }, "\n")
|
//KJ_MAP(n, namespaceParts) { return kj::strTree("}\n"); },
|
||||||
|
"}\n",
|
||||||
|
"\n")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
27
compiler/src/test/schema/test.capnp
Normal file
27
compiler/src/test/schema/test.capnp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
@0xd6eccba9557a7f51;
|
||||||
|
|
||||||
|
using Java = import "/java_support/java.capnp";
|
||||||
|
$Java.package("org.capnproto.test");
|
||||||
|
|
||||||
|
enum TestEnum {
|
||||||
|
foo @0;
|
||||||
|
bar @1;
|
||||||
|
baz @2;
|
||||||
|
qux @3;
|
||||||
|
quux @4;
|
||||||
|
corge @5;
|
||||||
|
grault @6;
|
||||||
|
garply @7;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TestOutOfOrder {
|
||||||
|
foo @3 :Text;
|
||||||
|
bar @2 :Text;
|
||||||
|
baz @8 :Text;
|
||||||
|
qux @0 :Text;
|
||||||
|
quux @6 :Text;
|
||||||
|
corge @4 :Text;
|
||||||
|
grault @1 :Text;
|
||||||
|
garply @7 :Text;
|
||||||
|
waldo @5 :Text;
|
||||||
|
}
|
|
@ -16,6 +16,9 @@ object Build extends sbt.Build {
|
||||||
base = file("compiler")
|
base = file("compiler")
|
||||||
).settings(makeCppTask)
|
).settings(makeCppTask)
|
||||||
.settings(compile <<= compile in Compile dependsOn makeCpp)
|
.settings(compile <<= compile in Compile dependsOn makeCpp)
|
||||||
|
.settings(compileTestSchemaTask)
|
||||||
|
// .settings(test <<= test in Test dependsOn compileTestSchema)
|
||||||
|
// .settings(unmanagedSourceDirectories in Test += sourceDirectory.value / "test" / "generated")
|
||||||
|
|
||||||
lazy val runtime =
|
lazy val runtime =
|
||||||
project(
|
project(
|
||||||
|
@ -44,13 +47,19 @@ object Build extends sbt.Build {
|
||||||
Seq(libraryDependencies ++= Shared.testDeps)
|
Seq(libraryDependencies ++= Shared.testDeps)
|
||||||
).configs(IntegrationTest)
|
).configs(IntegrationTest)
|
||||||
|
|
||||||
|
val compileTestSchema = taskKey[Unit]("Run capnpc-java on test schema")
|
||||||
|
val compileTestSchemaTask = compileTestSchema := {
|
||||||
|
val result = "capnp compile -I compiler/src/main/cpp/ --src-prefix=compiler/src/test/schema/ -o./capnpc-java:compiler/src/test/generated compiler/src/test/schema/test.capnp".!!
|
||||||
|
println(s"**** CodeGen for test.capnp started\n$result\n**** CodeGen complete.");
|
||||||
|
}
|
||||||
|
|
||||||
val makeCpp = taskKey[Unit]("Run make against the C++ code to create the Java code generator")
|
val makeCpp = taskKey[Unit]("Run make against the C++ code to create the Java code generator")
|
||||||
val makeCppTask = makeCpp := {
|
val makeCppTask = makeCpp := {
|
||||||
val makeResult = "make capnpc-java".!!
|
val makeResult = "make capnpc-java".!!
|
||||||
println(s"**** C++ Build Started\n$makeResult\n**** C++ Build Complete")
|
println(s"**** C++ Build Started\n$makeResult\n**** C++ Build Complete")
|
||||||
}
|
}
|
||||||
|
|
||||||
val makeExamples = taskKey[Unit]("Run capnp-java compiler against the addressbook schema")
|
val makeExamples = taskKey[Unit]("Run capnpc-java compiler against the addressbook schema")
|
||||||
val makeExamplesTask = makeExamples := {
|
val makeExamplesTask = makeExamples := {
|
||||||
Thread.sleep(1000)
|
Thread.sleep(1000)
|
||||||
val makeResult = "make addressbook".!!
|
val makeResult = "make addressbook".!!
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.capnproto;
|
||||||
|
|
||||||
import org.scalatest.FunSuite
|
import org.scalatest.FunSuite
|
||||||
|
|
||||||
class ExampleSuite extends FunSuite {
|
class LayoutSuite extends FunSuite {
|
||||||
|
|
||||||
test("SimpleRawDataStruct") {
|
test("SimpleRawDataStruct") {
|
||||||
val data : Array[Byte] =
|
val data : Array[Byte] =
|
||||||
|
|
Loading…
Reference in a new issue