In C++ we can easily use a group() to setup a group of dependencies. The same functionality does not work for an android_library(), as it can not depend on a group, that then depends on an android_library().
I would want the following to work, but it does not:
######
android_library("foo_java") {
deps = [ ":foo_shim_java" ]
}
group("foo_shim_java") {
if (use_actual_foo) {
deps = [ ":actual_foo_java" ]
} else {
deps = [ ":dummy_foo_java" ]
}
}
android_library("actual_foo_java") {
...
}
android_library("dummy_foo_java") {
...
}
######
The error is:
ERROR Unresolved dependencies.
:foo_java__build_config(//build/toolchain/android:clang_arm)
needs :foo_shim_java__build_config(//build/toolchain/android:clang_arm)
The target foo_shim can be made to work with the following workaround:
######
android_library("foo_shim") {
if (use_actual_foo) {
deps = [ ":actual_foo" ]
} else {
deps = [ ":dummy_foo" ]
}
java_files = [ "android/java/src/some/Dummy.java" ]
}
######
It would be great if there was a way to get the group() to work (or at least a similar construct without requiring a fake Java file).
Comment 1 by agrieve@chromium.org
, Jul 15 2016