Fix the unbundled mainline module build

am: e3ef3c8f0c

Change-Id: Ic5fdbf4dc40d6744f5c97e9eafc3672f4aca975e
This commit is contained in:
Jiyong Park
2019-07-15 15:20:20 -07:00
committed by android-build-merger
3 changed files with 16 additions and 8 deletions

View File

@@ -1433,10 +1433,13 @@ func (p *Prebuilt) installable() bool {
} }
func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) {
// If the device is configured to use flattened APEX, don't set // If the device is configured to use flattened APEX, force disable the prebuilt because
// p.properties.Source so that the prebuilt module (which is // the prebuilt is a non-flattened one.
// a non-flattened APEX) is not used. forceDisable := ctx.Config().FlattenApex()
forceDisable := ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild()
// Force disable the prebuilts when we are doing unbundled build. We do unbundled build
// to build the prebuilts themselves.
forceDisable = forceDisable || !ctx.Config().UnbundledBuild()
// b/137216042 don't use prebuilts when address sanitizer is on // b/137216042 don't use prebuilts when address sanitizer is on
forceDisable = forceDisable || android.InList("address", ctx.Config().SanitizeDevice()) || forceDisable = forceDisable || android.InList("address", ctx.Config().SanitizeDevice()) ||

View File

@@ -97,7 +97,7 @@ func stubFlagsRule(ctx android.SingletonContext) {
// Add the android.test.base to the set of stubs only if the android.test.base module is on // Add the android.test.base to the set of stubs only if the android.test.base module is on
// the boot jars list as the runtime will only enforce hiddenapi access against modules on // the boot jars list as the runtime will only enforce hiddenapi access against modules on
// that list. // that list.
if inList("android.test.base", ctx.Config().BootJars()) { if inList("android.test.base", ctx.Config().BootJars()) && !ctx.Config().UnbundledBuildUsePrebuiltSdks() {
publicStubModules = append(publicStubModules, "android.test.base.stubs") publicStubModules = append(publicStubModules, "android.test.base.stubs")
} }

View File

@@ -149,16 +149,21 @@ var _ Dependency = (*SdkLibrary)(nil)
var _ SdkLibraryDependency = (*SdkLibrary)(nil) var _ SdkLibraryDependency = (*SdkLibrary)(nil)
func (module *SdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) { func (module *SdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
useBuiltStubs := !ctx.Config().UnbundledBuildUsePrebuiltSdks()
// Add dependencies to the stubs library // Add dependencies to the stubs library
ctx.AddVariationDependencies(nil, publicApiStubsTag, module.stubsName(apiScopePublic)) if useBuiltStubs {
ctx.AddVariationDependencies(nil, publicApiStubsTag, module.stubsName(apiScopePublic))
}
ctx.AddVariationDependencies(nil, publicApiFileTag, module.docsName(apiScopePublic)) ctx.AddVariationDependencies(nil, publicApiFileTag, module.docsName(apiScopePublic))
sdkDep := decodeSdkDep(ctx, sdkContext(&module.Library)) sdkDep := decodeSdkDep(ctx, sdkContext(&module.Library))
if sdkDep.hasStandardLibs() { if sdkDep.hasStandardLibs() {
ctx.AddVariationDependencies(nil, systemApiStubsTag, module.stubsName(apiScopeSystem)) if useBuiltStubs {
ctx.AddVariationDependencies(nil, systemApiStubsTag, module.stubsName(apiScopeSystem))
ctx.AddVariationDependencies(nil, testApiStubsTag, module.stubsName(apiScopeTest))
}
ctx.AddVariationDependencies(nil, systemApiFileTag, module.docsName(apiScopeSystem)) ctx.AddVariationDependencies(nil, systemApiFileTag, module.docsName(apiScopeSystem))
ctx.AddVariationDependencies(nil, testApiFileTag, module.docsName(apiScopeTest)) ctx.AddVariationDependencies(nil, testApiFileTag, module.docsName(apiScopeTest))
ctx.AddVariationDependencies(nil, testApiStubsTag, module.stubsName(apiScopeTest))
} }
module.Library.deps(ctx) module.Library.deps(ctx)