Skip to content

Commit

Permalink
Maybe this is a bug?
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsummerssmith committed Dec 19, 2017
1 parent 3c58033 commit 2b9cb1b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion examples/helloworld/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions examples/helloworld/foo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package examples.helloworld

data class Foo(
val name: String
)
2 changes: 2 additions & 0 deletions examples/helloworld/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ annotation class Feature1_2TestAnnotation(val value: Array<String>)
val boom = "yaay"

fun main(args : Array<String>) {
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())
Expand Down
6 changes: 4 additions & 2 deletions examples/helloworld/rules.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ data class KotlinLibraryRule(
)

data class KotlinBinaryRule(
val name: String,
val name: Foo,
val jars: List<String> = listOf<String>(),
val deps: List<String> = listOf<String>()
)
) {
constructor (name:String) : this(Foo(name))
}

0 comments on commit 2b9cb1b

Please sign in to comment.