aboutsummaryrefslogtreecommitdiffstats
path: root/java/droiddoc.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-08-29 14:10:52 -0700
committerColin Cross <ccross@android.com>2018-08-30 16:31:02 +0000
commit42d48b7b8b94e301d703656db0b25bc5ee7eb3bc (patch)
tree377b5bdf4556fbb6a04bb436230fe6abcbe64157 /java/droiddoc.go
parentb69575b1f697edae9f9b78765d50c8117d21f7d1 (diff)
downloadandroid_build_soong-42d48b7b8b94e301d703656db0b25bc5ee7eb3bc.tar.gz
android_build_soong-42d48b7b8b94e301d703656db0b25bc5ee7eb3bc.tar.bz2
android_build_soong-42d48b7b8b94e301d703656db0b25bc5ee7eb3bc.zip
Enforce dependencies have right architecture
ctx.AddDependency will succeed if the named dependency only has a single variant, even if that variant is the wrong architecture. Use ctx.AddVariationDependency(nil, ...) instead, which requires that all variations of the calling module match the dependency. Bug: 112707915 Test: no change to out/soong/build.ninja Test: using a device dependency in a host java module is an error Change-Id: I70b661a57d4412eb63b8c9841febfb756e9e025d
Diffstat (limited to 'java/droiddoc.go')
-rw-r--r--java/droiddoc.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go
index e4c9e384..68d78610 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -371,24 +371,24 @@ func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))
if sdkDep.useDefaultLibs {
- ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...)
+ ctx.AddVariationDependencies(nil, bootClasspathTag, config.DefaultBootclasspathLibraries...)
if ctx.Config().TargetOpenJDK9() {
- ctx.AddDependency(ctx.Module(), systemModulesTag, config.DefaultSystemModules)
+ ctx.AddVariationDependencies(nil, systemModulesTag, config.DefaultSystemModules)
}
if !Bool(j.properties.No_framework_libs) {
- ctx.AddDependency(ctx.Module(), libTag, config.DefaultLibraries...)
+ ctx.AddVariationDependencies(nil, libTag, config.DefaultLibraries...)
}
} else if sdkDep.useModule {
if ctx.Config().TargetOpenJDK9() {
- ctx.AddDependency(ctx.Module(), systemModulesTag, sdkDep.systemModules)
+ ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules)
}
- ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.modules...)
+ ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.modules...)
}
}
- ctx.AddDependency(ctx.Module(), libTag, j.properties.Libs...)
+ ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
if j.properties.Srcs_lib != nil {
- ctx.AddDependency(ctx.Module(), srcsLibTag, *j.properties.Srcs_lib)
+ ctx.AddVariationDependencies(nil, srcsLibTag, *j.properties.Srcs_lib)
}
android.ExtractSourcesDeps(ctx, j.properties.Srcs)