Add no_apex check for static library

If no_apex module is static library, this module is not included to
filesInfo. So add a check tat the static library is no_apex among
indirect dependencies.

Bug: 139016109
Test: m -j
Change-Id: I46ddf099715aea0e088027a1141e282969cef0e1
This commit is contained in:
Sundong Ahn
2019-08-27 18:53:12 +09:00
parent 2569cc5026
commit 2db7f46d0c
2 changed files with 32 additions and 0 deletions

View File

@@ -984,6 +984,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
} }
} else if am.CanHaveApexVariants() && am.IsInstallableToApex() { } else if am.CanHaveApexVariants() && am.IsInstallableToApex() {
ctx.ModuleErrorf("unexpected tag %q for indirect dependency %q", depTag, depName) ctx.ModuleErrorf("unexpected tag %q for indirect dependency %q", depTag, depName)
} else if am.NoApex() && !android.InList(depName, whitelistNoApex[ctx.ModuleName()]) {
ctx.ModuleErrorf("tries to include no_apex module %s", depName)
} }
} }
} }

View File

@@ -1851,6 +1851,36 @@ func TestApexUsesFailsIfUseNoApex(t *testing.T) {
} }
`) `)
testApexError(t, `tries to include no_apex module mylib2`, `
apex {
name: "commonapex",
key: "myapex.key",
native_shared_libs: ["mylib"],
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
cc_library {
name: "mylib",
srcs: ["mylib.cpp"],
static_libs: ["mylib2"],
system_shared_libs: [],
stl: "none",
}
cc_library {
name: "mylib2",
srcs: ["mylib.cpp"],
system_shared_libs: [],
stl: "none",
no_apex: true,
}
`)
ctx, _ := testApex(t, ` ctx, _ := testApex(t, `
apex { apex {
name: "myapex", name: "myapex",