Skip to content

Instantly share code, notes, and snippets.

@johnynek
Created February 16, 2018 20:46
Show Gist options
  • Save johnynek/857579dfd3ce0b1c437826f496448e16 to your computer and use it in GitHub Desktop.
Save johnynek/857579dfd3ce0b1c437826f496448e16 to your computer and use it in GitHub Desktop.
package test;
class A {
}
package test;
class B {
private A myA;
public B(A a) {
myA = a;
}
}
java_library(
name = "a",
srcs = ["A.java"])
java_library(
name = "b",
srcs = ["B.java"],
deps = [":a"])
java_library(
name = "c",
srcs = ["C.java"],
deps = [":b"]) #to fix make this ":b", ":a"
package test;
class C {
private B myB;
//public C(B b, A a) {
public C(B b) { // if you depend on A without declaring it the build fails.
myB = b;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment