New issue
Advanced search Search tips

Issue 628675 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add support for using group() from android_library()

Project Member Reported by nyquist@chromium.org, Jul 15 2016

Issue description

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).

 
Status: Fixed (was: Untriaged)
It exists :). It's called "java_group()"

Sign in to add a comment