Merge "Ignore PrebuiltDepTag when processing APEX contents" am: 846e60dbc7
Change-Id: Ic0f43434fc9e0c503c3b5a1e91de03f66844831a
This commit is contained in:
@@ -19,6 +19,8 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/google/blueprint"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -117,6 +119,15 @@ type ApexProperties struct {
|
|||||||
Info ApexInfo `blueprint:"mutated"`
|
Info ApexInfo `blueprint:"mutated"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Marker interface that identifies dependencies that are excluded from APEX
|
||||||
|
// contents.
|
||||||
|
type ExcludeFromApexContentsTag interface {
|
||||||
|
blueprint.DependencyTag
|
||||||
|
|
||||||
|
// Method that differentiates this interface from others.
|
||||||
|
ExcludeFromApexContents()
|
||||||
|
}
|
||||||
|
|
||||||
// Provides default implementation for the ApexModule interface. APEX-aware
|
// Provides default implementation for the ApexModule interface. APEX-aware
|
||||||
// modules are expected to include this struct and call InitApexModule().
|
// modules are expected to include this struct and call InitApexModule().
|
||||||
type ApexModuleBase struct {
|
type ApexModuleBase struct {
|
||||||
|
@@ -39,6 +39,12 @@ var PrebuiltDepTag prebuiltDependencyTag
|
|||||||
// Mark this tag so dependencies that use it are excluded from visibility enforcement.
|
// Mark this tag so dependencies that use it are excluded from visibility enforcement.
|
||||||
func (t prebuiltDependencyTag) ExcludeFromVisibilityEnforcement() {}
|
func (t prebuiltDependencyTag) ExcludeFromVisibilityEnforcement() {}
|
||||||
|
|
||||||
|
// Mark this tag so dependencies that use it are excluded from APEX contents.
|
||||||
|
func (t prebuiltDependencyTag) ExcludeFromApexContents() {}
|
||||||
|
|
||||||
|
var _ ExcludeFromVisibilityEnforcementTag = PrebuiltDepTag
|
||||||
|
var _ ExcludeFromApexContentsTag = PrebuiltDepTag
|
||||||
|
|
||||||
type PrebuiltProperties struct {
|
type PrebuiltProperties struct {
|
||||||
// When prefer is set to true the prebuilt will be used instead of any source module with
|
// When prefer is set to true the prebuilt will be used instead of any source module with
|
||||||
// a matching name.
|
// a matching name.
|
||||||
|
@@ -1986,6 +1986,9 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
// TODO(jiyong) do this using walkPayloadDeps
|
// TODO(jiyong) do this using walkPayloadDeps
|
||||||
ctx.WalkDepsBlueprint(func(child, parent blueprint.Module) bool {
|
ctx.WalkDepsBlueprint(func(child, parent blueprint.Module) bool {
|
||||||
depTag := ctx.OtherModuleDependencyTag(child)
|
depTag := ctx.OtherModuleDependencyTag(child)
|
||||||
|
if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
depName := ctx.OtherModuleName(child)
|
depName := ctx.OtherModuleName(child)
|
||||||
if _, isDirectDep := parent.(*apexBundle); isDirectDep {
|
if _, isDirectDep := parent.(*apexBundle); isDirectDep {
|
||||||
switch depTag {
|
switch depTag {
|
||||||
@@ -2154,7 +2157,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
filesInfo = append(filesInfo, apexFileForPrebuiltEtc(ctx, prebuilt, depName))
|
filesInfo = append(filesInfo, apexFileForPrebuiltEtc(ctx, prebuilt, depName))
|
||||||
}
|
}
|
||||||
} 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 %s for indirect dependency %q", PrettyPrintTag(depTag), depName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,7 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
|
|||||||
"my_include": nil,
|
"my_include": nil,
|
||||||
"foo/bar/MyClass.java": nil,
|
"foo/bar/MyClass.java": nil,
|
||||||
"prebuilt.jar": nil,
|
"prebuilt.jar": nil,
|
||||||
|
"prebuilt.so": nil,
|
||||||
"vendor/foo/devkeys/test.x509.pem": nil,
|
"vendor/foo/devkeys/test.x509.pem": nil,
|
||||||
"vendor/foo/devkeys/test.pk8": nil,
|
"vendor/foo/devkeys/test.pk8": nil,
|
||||||
"testkey.x509.pem": nil,
|
"testkey.x509.pem": nil,
|
||||||
@@ -368,7 +369,7 @@ func TestBasicApex(t *testing.T) {
|
|||||||
apex_available: [ "myapex" ],
|
apex_available: [ "myapex" ],
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_library {
|
cc_library_shared {
|
||||||
name: "mylib2",
|
name: "mylib2",
|
||||||
srcs: ["mylib.cpp"],
|
srcs: ["mylib.cpp"],
|
||||||
system_shared_libs: [],
|
system_shared_libs: [],
|
||||||
@@ -382,6 +383,16 @@ func TestBasicApex(t *testing.T) {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cc_prebuilt_library_shared {
|
||||||
|
name: "mylib2",
|
||||||
|
srcs: ["prebuilt.so"],
|
||||||
|
// TODO: remove //apex_available:platform
|
||||||
|
apex_available: [
|
||||||
|
"//apex_available:platform",
|
||||||
|
"myapex",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "libstatic",
|
name: "libstatic",
|
||||||
srcs: ["mylib.cpp"],
|
srcs: ["mylib.cpp"],
|
||||||
|
Reference in New Issue
Block a user