Merge "Only apply apex transition to DCLA libs for now."
This commit is contained in:
@@ -201,6 +201,8 @@ type BazelContext interface {
|
|||||||
// (for example, that it is MixedBuildBuildable).
|
// (for example, that it is MixedBuildBuildable).
|
||||||
IsModuleNameAllowed(moduleName string, withinApex bool) bool
|
IsModuleNameAllowed(moduleName string, withinApex bool) bool
|
||||||
|
|
||||||
|
IsModuleDclaAllowed(moduleName string) bool
|
||||||
|
|
||||||
// Returns the bazel output base (the root directory for all bazel intermediate outputs).
|
// Returns the bazel output base (the root directory for all bazel intermediate outputs).
|
||||||
OutputBase() string
|
OutputBase() string
|
||||||
|
|
||||||
@@ -341,6 +343,10 @@ func (m MockBazelContext) IsModuleNameAllowed(_ string, _ bool) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m MockBazelContext) IsModuleDclaAllowed(_ string) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (m MockBazelContext) OutputBase() string { return m.OutputBaseDir }
|
func (m MockBazelContext) OutputBase() string { return m.OutputBaseDir }
|
||||||
|
|
||||||
func (m MockBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
|
func (m MockBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
|
||||||
@@ -483,6 +489,10 @@ func (n noopBazelContext) IsModuleNameAllowed(_ string, _ bool) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n noopBazelContext) IsModuleDclaAllowed(_ string) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (m noopBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
|
func (m noopBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement {
|
||||||
return []*bazel.BuildStatement{}
|
return []*bazel.BuildStatement{}
|
||||||
}
|
}
|
||||||
@@ -619,13 +629,17 @@ func (context *mixedBuildBazelContext) IsModuleNameAllowed(moduleName string, wi
|
|||||||
if context.bazelEnabledModules[moduleName] {
|
if context.bazelEnabledModules[moduleName] {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if withinApex && context.bazelDclaEnabledModules[moduleName] {
|
if withinApex && context.IsModuleDclaAllowed(moduleName) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.modulesDefaultToBazel
|
return context.modulesDefaultToBazel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (context *mixedBuildBazelContext) IsModuleDclaAllowed(moduleName string) bool {
|
||||||
|
return context.bazelDclaEnabledModules[moduleName]
|
||||||
|
}
|
||||||
|
|
||||||
func pwdPrefix() string {
|
func pwdPrefix() string {
|
||||||
// Darwin doesn't have /proc
|
// Darwin doesn't have /proc
|
||||||
if runtime.GOOS != "darwin" {
|
if runtime.GOOS != "darwin" {
|
||||||
|
3
cc/cc.go
3
cc/cc.go
@@ -1920,6 +1920,9 @@ func isUbsanEnabled(c *Module) bool {
|
|||||||
func GetApexConfigKey(ctx android.BaseModuleContext) *android.ApexConfigKey {
|
func GetApexConfigKey(ctx android.BaseModuleContext) *android.ApexConfigKey {
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
|
if !ctx.Config().BazelContext.IsModuleDclaAllowed(ctx.Module().Name()) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
apexKey := android.ApexConfigKey{
|
apexKey := android.ApexConfigKey{
|
||||||
WithinApex: true,
|
WithinApex: true,
|
||||||
ApexSdkVersion: findApexSdkVersion(ctx, apexInfo).String(),
|
ApexSdkVersion: findApexSdkVersion(ctx, apexInfo).String(),
|
||||||
|
Reference in New Issue
Block a user