Add new compat_configs property to the apex am: 3abc174cfd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1638279 Change-Id: I5197d5ced2dad822c986a8874afef36c29c2fe25
This commit is contained in:
45
apex/apex.go
45
apex/apex.go
@@ -102,6 +102,9 @@ type apexBundleProperties struct {
|
|||||||
// List of prebuilt files that are embedded inside this APEX bundle.
|
// List of prebuilt files that are embedded inside this APEX bundle.
|
||||||
Prebuilts []string
|
Prebuilts []string
|
||||||
|
|
||||||
|
// List of platform_compat_config files that are embedded inside this APEX bundle.
|
||||||
|
Compat_configs []string
|
||||||
|
|
||||||
// List of BPF programs inside this APEX bundle.
|
// List of BPF programs inside this APEX bundle.
|
||||||
Bpfs []string
|
Bpfs []string
|
||||||
|
|
||||||
@@ -549,20 +552,21 @@ type dependencyTag struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
androidAppTag = dependencyTag{name: "androidApp", payload: true}
|
androidAppTag = dependencyTag{name: "androidApp", payload: true}
|
||||||
bpfTag = dependencyTag{name: "bpf", payload: true}
|
bpfTag = dependencyTag{name: "bpf", payload: true}
|
||||||
certificateTag = dependencyTag{name: "certificate"}
|
certificateTag = dependencyTag{name: "certificate"}
|
||||||
executableTag = dependencyTag{name: "executable", payload: true}
|
executableTag = dependencyTag{name: "executable", payload: true}
|
||||||
fsTag = dependencyTag{name: "filesystem", payload: true}
|
fsTag = dependencyTag{name: "filesystem", payload: true}
|
||||||
bootImageTag = dependencyTag{name: "bootImage", payload: true}
|
bootImageTag = dependencyTag{name: "bootImage", payload: true}
|
||||||
javaLibTag = dependencyTag{name: "javaLib", payload: true}
|
compatConfigsTag = dependencyTag{name: "compatConfig", payload: true}
|
||||||
jniLibTag = dependencyTag{name: "jniLib", payload: true}
|
javaLibTag = dependencyTag{name: "javaLib", payload: true}
|
||||||
keyTag = dependencyTag{name: "key"}
|
jniLibTag = dependencyTag{name: "jniLib", payload: true}
|
||||||
prebuiltTag = dependencyTag{name: "prebuilt", payload: true}
|
keyTag = dependencyTag{name: "key"}
|
||||||
rroTag = dependencyTag{name: "rro", payload: true}
|
prebuiltTag = dependencyTag{name: "prebuilt", payload: true}
|
||||||
sharedLibTag = dependencyTag{name: "sharedLib", payload: true}
|
rroTag = dependencyTag{name: "rro", payload: true}
|
||||||
testForTag = dependencyTag{name: "test for"}
|
sharedLibTag = dependencyTag{name: "sharedLib", payload: true}
|
||||||
testTag = dependencyTag{name: "test", payload: true}
|
testForTag = dependencyTag{name: "test for"}
|
||||||
|
testTag = dependencyTag{name: "test", payload: true}
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(jiyong): shorten this function signature
|
// TODO(jiyong): shorten this function signature
|
||||||
@@ -731,6 +735,13 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
{Mutator: "arch", Variation: archForPrebuiltEtc.String()},
|
{Mutator: "arch", Variation: archForPrebuiltEtc.String()},
|
||||||
}, prebuiltTag, a.properties.Prebuilts...)
|
}, prebuiltTag, a.properties.Prebuilts...)
|
||||||
|
|
||||||
|
// Add dependency on platform_compat_configs.
|
||||||
|
// TODO(b/182816033) - make this common-arch once all usages have been migrated.
|
||||||
|
ctx.AddFarVariationDependencies([]blueprint.Variation{
|
||||||
|
{Mutator: "os", Variation: ctx.Os().String()},
|
||||||
|
{Mutator: "arch", Variation: archForPrebuiltEtc.String()},
|
||||||
|
}, compatConfigsTag, a.properties.Compat_configs...)
|
||||||
|
|
||||||
// Common-arch dependencies come next
|
// Common-arch dependencies come next
|
||||||
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
|
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
|
||||||
ctx.AddFarVariationDependencies(commonVariation, bootImageTag, a.properties.Boot_images...)
|
ctx.AddFarVariationDependencies(commonVariation, bootImageTag, a.properties.Boot_images...)
|
||||||
@@ -1740,6 +1751,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
} else {
|
} else {
|
||||||
ctx.PropertyErrorf("prebuilts", "%q is not a prebuilt_etc and not a platform_compat_config module", depName)
|
ctx.PropertyErrorf("prebuilts", "%q is not a prebuilt_etc and not a platform_compat_config module", depName)
|
||||||
}
|
}
|
||||||
|
case compatConfigsTag:
|
||||||
|
if compatConfig, ok := child.(java.PlatformCompatConfigIntf); ok {
|
||||||
|
filesInfo = append(filesInfo, apexFileForCompatConfig(ctx, compatConfig, depName))
|
||||||
|
} else {
|
||||||
|
ctx.PropertyErrorf("compat_configs", "%q is not a platform_compat_config module", depName)
|
||||||
|
}
|
||||||
case testTag:
|
case testTag:
|
||||||
if ccTest, ok := child.(*cc.Module); ok {
|
if ccTest, ok := child.(*cc.Module); ok {
|
||||||
if ccTest.IsTestPerSrcAllTestsVariation() {
|
if ccTest.IsTestPerSrcAllTestsVariation() {
|
||||||
|
@@ -5995,7 +5995,7 @@ func TestCompatConfig(t *testing.T) {
|
|||||||
apex {
|
apex {
|
||||||
name: "myapex",
|
name: "myapex",
|
||||||
key: "myapex.key",
|
key: "myapex.key",
|
||||||
prebuilts: ["myjar-platform-compat-config"],
|
compat_configs: ["myjar-platform-compat-config"],
|
||||||
java_libs: ["myjar"],
|
java_libs: ["myjar"],
|
||||||
updatable: false,
|
updatable: false,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user