Merge "Add no_apex property"

This commit is contained in:
Treehugger Robot
2019-08-23 04:00:38 +00:00
committed by Gerrit Code Review
3 changed files with 113 additions and 0 deletions

View File

@@ -126,6 +126,16 @@ var (
usesTag = dependencyTag{name: "uses"}
)
var (
whitelistNoApex = map[string][]string{
"apex_test_build_features": []string{"libbinder"},
"com.android.neuralnetworks": []string{"libbinder"},
"com.android.media": []string{"libbinder"},
"com.android.media.swcodec": []string{"libbinder"},
"test_com.android.media.swcodec": []string{"libbinder"},
}
)
func init() {
pctx.Import("android/soong/android")
pctx.Import("android/soong/java")
@@ -1005,6 +1015,16 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
return filesInfo[i].builtFile.String() < filesInfo[j].builtFile.String()
})
// check no_apex modules
whitelist := whitelistNoApex[ctx.ModuleName()]
for i := range filesInfo {
if am, ok := filesInfo[i].module.(android.ApexModule); ok {
if am.NoApex() && !android.InList(filesInfo[i].moduleName, whitelist) {
ctx.ModuleErrorf("tries to include no_apex module %s", filesInfo[i].moduleName)
}
}
}
// prepend the name of this APEX to the module names. These names will be the names of
// modules that will be defined if the APEX is flattened.
for i := range filesInfo {