From 2b9cb1bc106645a56d827e1034dfbebf8cd8c7c2 Mon Sep 17 00:00:00 2001 From: Trevor Summers Smith Date: Tue, 19 Dec 2017 12:23:42 -0500 Subject: [PATCH] Maybe this is a bug? --- examples/helloworld/BUILD | 9 ++++++++- examples/helloworld/foo.kt | 5 +++++ examples/helloworld/main.kt | 2 ++ examples/helloworld/rules.kt | 6 ++++-- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 examples/helloworld/foo.kt diff --git a/examples/helloworld/BUILD b/examples/helloworld/BUILD index b2a5788..fac51ad 100644 --- a/examples/helloworld/BUILD +++ b/examples/helloworld/BUILD @@ -27,17 +27,24 @@ java_binary( ], ) +kotlin_library( + name = "foo", + srcs = ["foo.kt"], +) + # A simple kotlin rule that defines "data classes" kotlin_library( name = "rules", srcs = ["rules.kt"], - java_deps = [":milk"] + java_deps = [":milk"], + deps = [":foo"], ) # A simple java class that defines soy milk java_library( name = "milk", srcs = ["SoyMilk.java"], + # UNCOMMENT ME TO SEE Foo in included deps = [":foo_kt"], ) # A java rule that depends on a kotlin rule (using kotlin within traditional java) diff --git a/examples/helloworld/foo.kt b/examples/helloworld/foo.kt new file mode 100644 index 0000000..24011cb --- /dev/null +++ b/examples/helloworld/foo.kt @@ -0,0 +1,5 @@ +package examples.helloworld + +data class Foo( + val name: String +) diff --git a/examples/helloworld/main.kt b/examples/helloworld/main.kt index 306a99b..06227b7 100644 --- a/examples/helloworld/main.kt +++ b/examples/helloworld/main.kt @@ -8,6 +8,8 @@ annotation class Feature1_2TestAnnotation(val value: Array) val boom = "yaay" fun main(args : Array) { + val foo = KotlinBinaryRule("foo") + println(foo.name) println(Joiner.on(' ').join(arrayOf("I", "am", "Kotlin!", "......"))) println(Joiner.on(' ').join(arrayOf("...", "But", "what", "is", "soy", "milk?"))) println(SoyMilk()) diff --git a/examples/helloworld/rules.kt b/examples/helloworld/rules.kt index 09a77d8..c8b7d74 100644 --- a/examples/helloworld/rules.kt +++ b/examples/helloworld/rules.kt @@ -7,7 +7,9 @@ data class KotlinLibraryRule( ) data class KotlinBinaryRule( - val name: String, + val name: Foo, val jars: List = listOf(), val deps: List = listOf() -) +) { + constructor (name:String) : this(Foo(name)) +}