aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2018-07-02 16:34:51 +0100
committerMathew Inwood <mathewi@google.com>2018-07-03 17:06:48 +0100
commit878c66260269562581ad1f397a441c5d87cdee1e (patch)
treee2c3f6d047928cce3b89c32c7a18f3f0db66243e
parentb1f0f1aecd64ed81d319255ab051e6c338052627 (diff)
downloadbuild_soong-878c66260269562581ad1f397a441c5d87cdee1e.tar.gz
build_soong-878c66260269562581ad1f397a441c5d87cdee1e.tar.bz2
build_soong-878c66260269562581ad1f397a441c5d87cdee1e.zip
Use correct variant for annotation processors.
Annotation processors should always have a common host variant, rather than a device variant as the build was looking for before. Bug: 110868826 Test: m Change-Id: I2b7d0e7ed1af3f2f9ddb87d2bf36920737a507e9
-rw-r--r--android/config.go6
-rw-r--r--java/java.go5
2 files changed, 7 insertions, 4 deletions
diff --git a/android/config.go b/android/config.go
index 8330b3df..3a9b98b3 100644
--- a/android/config.go
+++ b/android/config.go
@@ -90,8 +90,9 @@ type config struct {
ConfigFileName string
ProductVariablesFileName string
- Targets map[OsClass][]Target
- BuildOsVariant string
+ Targets map[OsClass][]Target
+ BuildOsVariant string
+ BuildOsCommonVariant string
deviceConfig *deviceConfig
@@ -310,6 +311,7 @@ func NewConfig(srcDir, buildDir string) (Config, error) {
config.Targets = targets
config.BuildOsVariant = targets[Host][0].String()
+ config.BuildOsCommonVariant = getCommonTargets(targets[Host])[0].String()
if err := config.fromEnv(); err != nil {
return Config{}, err
diff --git a/java/java.go b/java/java.go
index 5458ea19..e87a990f 100644
--- a/java/java.go
+++ b/java/java.go
@@ -522,8 +522,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
ctx.AddDependency(ctx.Module(), libTag, j.properties.Libs...)
ctx.AddDependency(ctx.Module(), staticLibTag, j.properties.Static_libs...)
- ctx.AddDependency(ctx.Module(), annoTag, j.properties.Annotation_processors...)
-
+ ctx.AddFarVariationDependencies([]blueprint.Variation{
+ {"arch", ctx.Config().BuildOsCommonVariant},
+ }, annoTag, j.properties.Annotation_processors...)
android.ExtractSourcesDeps(ctx, j.properties.Srcs)
android.ExtractSourcesDeps(ctx, j.properties.Exclude_srcs)
android.ExtractSourcesDeps(ctx, j.properties.Java_resources)