Merge "Don't create non-primary arch variant for recovery-only module"
diff --git a/java/sdk_library.go b/java/sdk_library.go
index e4cfd41..e65af65 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -46,6 +46,7 @@
publicApiStubsTag = dependencyTag{name: "public"}
systemApiStubsTag = dependencyTag{name: "system"}
testApiStubsTag = dependencyTag{name: "test"}
+ implLibTag = dependencyTag{name: "platform"}
)
type apiScope int
@@ -127,6 +128,7 @@
publicApiStubsPath android.Paths
systemApiStubsPath android.Paths
testApiStubsPath android.Paths
+ implLibPath android.Paths
}
func (module *sdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -134,24 +136,27 @@
ctx.AddDependency(ctx.Module(), publicApiStubsTag, module.stubsName(apiScopePublic))
ctx.AddDependency(ctx.Module(), systemApiStubsTag, module.stubsName(apiScopeSystem))
ctx.AddDependency(ctx.Module(), testApiStubsTag, module.stubsName(apiScopeTest))
+ ctx.AddDependency(ctx.Module(), implLibTag, module.implName())
}
func (module *sdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- // Record the paths to the header jars of the stubs library.
+ // Record the paths to the header jars of the library (stubs and impl).
// When this java_sdk_library is dependened from others via "libs" property,
// the recorded paths will be returned depending on the link type of the caller.
ctx.VisitDirectDeps(func(to android.Module) {
otherName := ctx.OtherModuleName(to)
tag := ctx.OtherModuleDependencyTag(to)
- if stubs, ok := to.(Dependency); ok {
+ if lib, ok := to.(Dependency); ok {
switch tag {
case publicApiStubsTag:
- module.publicApiStubsPath = stubs.HeaderJars()
+ module.publicApiStubsPath = lib.HeaderJars()
case systemApiStubsTag:
- module.systemApiStubsPath = stubs.HeaderJars()
+ module.systemApiStubsPath = lib.HeaderJars()
case testApiStubsTag:
- module.testApiStubsPath = stubs.HeaderJars()
+ module.testApiStubsPath = lib.HeaderJars()
+ case implLibTag:
+ module.implLibPath = lib.HeaderJars()
default:
ctx.ModuleErrorf("depends on module %q of unknown tag %q", otherName, tag)
}
@@ -543,8 +548,10 @@
// to satisfy SdkLibraryDependency interface
func (module *sdkLibrary) HeaderJars(linkType linkType) android.Paths {
// This module is just a wrapper for the stubs.
- if linkType == javaSystem || linkType == javaPlatform {
+ if linkType == javaSystem {
return module.systemApiStubsPath
+ } else if linkType == javaPlatform {
+ return module.implLibPath
} else {
return module.publicApiStubsPath
}
diff --git a/ui/build/config.go b/ui/build/config.go
index d0378ec..1f7656e 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -118,6 +118,18 @@
// Set in envsetup.sh, reset in makefiles
"ANDROID_JAVA_TOOLCHAIN",
+
+ // Set by envsetup.sh, but shouldn't be used inside the build because envsetup.sh is optional
+ "ANDROID_BUILD_TOP",
+ "ANDROID_HOST_OUT",
+ "ANDROID_PRODUCT_OUT",
+ "ANDROID_HOST_OUT_TESTCASES",
+ "ANDROID_TARGET_OUT_TESTCASES",
+ "ANDROID_TOOLCHAIN",
+ "ANDROID_TOOLCHAIN_2ND_ARCH",
+ "ANDROID_DEV_SCRIPTS",
+ "ANDROID_EMULATOR_PREBUILTS",
+ "ANDROID_PRE_BUILD_PATHS",
)
// Tell python not to spam the source tree with .pyc files.