Revert "Support overriding APEX java contents"

This reverts commit be90172f0a.

Reason for revert: not used, and not desired

Bug: 270542561
Test: presubmit
Change-Id: I415440dbae965f3c07c6f3ccf6ab4bc9ec57fbf6
This commit is contained in:
Anton Hansson 2023-02-24 11:06:07 +00:00
parent c2e385cc4c
commit e7545858bd
2 changed files with 15 additions and 106 deletions

View file

@ -111,6 +111,15 @@ type apexBundleProperties struct {
Multilib apexMultilibProperties
// List of bootclasspath fragments that are embedded inside this APEX bundle.
Bootclasspath_fragments []string
// List of systemserverclasspath fragments that are embedded inside this APEX bundle.
Systemserverclasspath_fragments []string
// List of java libraries that are embedded inside this APEX bundle.
Java_libs []string
// List of sh binaries that are embedded inside this APEX bundle.
Sh_binaries []string
@ -332,15 +341,6 @@ type overridableProperties struct {
// List of BPF programs inside this APEX bundle.
Bpfs []string
// List of bootclasspath fragments that are embedded inside this APEX bundle.
Bootclasspath_fragments []string
// List of systemserverclasspath fragments that are embedded inside this APEX bundle.
Systemserverclasspath_fragments []string
// List of java libraries that are embedded inside this APEX bundle.
Java_libs []string
// Names of modules to be overridden. Listed modules can only be other binaries (in Make or
// Soong). This does not completely prevent installation of the overridden binaries, but if
// both binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will
@ -845,6 +845,9 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
// Common-arch dependencies come next
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.properties.Bootclasspath_fragments...)
ctx.AddFarVariationDependencies(commonVariation, sscpfTag, a.properties.Systemserverclasspath_fragments...)
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...)
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
ctx.AddFarVariationDependencies(commonVariation, compatConfigTag, a.properties.Compat_configs...)
}
@ -859,9 +862,6 @@ func (a *apexBundle) OverridablePropertiesDepsMutator(ctx android.BottomUpMutato
ctx.AddFarVariationDependencies(commonVariation, androidAppTag, a.overridableProperties.Apps...)
ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.overridableProperties.Bpfs...)
ctx.AddFarVariationDependencies(commonVariation, rroTag, a.overridableProperties.Rros...)
ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.overridableProperties.Bootclasspath_fragments...)
ctx.AddFarVariationDependencies(commonVariation, sscpfTag, a.overridableProperties.Systemserverclasspath_fragments...)
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.overridableProperties.Java_libs...)
if prebuilts := a.overridableProperties.Prebuilts; len(prebuilts) > 0 {
// For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device)
// regardless of the TARGET_PREFER_* setting. See b/144532908
@ -3107,9 +3107,9 @@ func isStaticExecutableAllowed(apex string, exec string) bool {
// Collect information for opening IDE project files in java/jdeps.go.
func (a *apexBundle) IDEInfo(dpInfo *android.IdeInfo) {
dpInfo.Deps = append(dpInfo.Deps, a.overridableProperties.Java_libs...)
dpInfo.Deps = append(dpInfo.Deps, a.overridableProperties.Bootclasspath_fragments...)
dpInfo.Deps = append(dpInfo.Deps, a.overridableProperties.Systemserverclasspath_fragments...)
dpInfo.Deps = append(dpInfo.Deps, a.properties.Java_libs...)
dpInfo.Deps = append(dpInfo.Deps, a.properties.Bootclasspath_fragments...)
dpInfo.Deps = append(dpInfo.Deps, a.properties.Systemserverclasspath_fragments...)
dpInfo.Paths = append(dpInfo.Paths, a.modulePaths...)
}

View file

@ -6294,9 +6294,6 @@ func TestOverrideApex(t *testing.T) {
apps: ["app"],
bpfs: ["bpf"],
prebuilts: ["myetc"],
bootclasspath_fragments: ["mybootclasspath_fragment"],
systemserverclasspath_fragments: ["mysystemserverclasspath_fragment"],
java_libs: ["myjava_library"],
overrides: ["oldapex"],
updatable: false,
}
@ -6307,9 +6304,6 @@ func TestOverrideApex(t *testing.T) {
apps: ["override_app"],
bpfs: ["overrideBpf"],
prebuilts: ["override_myetc"],
bootclasspath_fragments: ["override_bootclasspath_fragment"],
systemserverclasspath_fragments: ["override_systemserverclasspath_fragment"],
java_libs: ["override_java_library"],
overrides: ["unknownapex"],
logging_parent: "com.foo.bar",
package_name: "test.overridden.package",
@ -6368,78 +6362,6 @@ func TestOverrideApex(t *testing.T) {
name: "override_myetc",
src: "override_myprebuilt",
}
java_library {
name: "bcplib",
srcs: ["a.java"],
compile_dex: true,
apex_available: ["myapex"],
permitted_packages: ["bcp.lib"],
}
bootclasspath_fragment {
name: "mybootclasspath_fragment",
contents: ["bcplib"],
apex_available: ["myapex"],
hidden_api: {
split_packages: ["*"],
},
}
java_library {
name: "override_bcplib",
srcs: ["a.java"],
compile_dex: true,
apex_available: ["myapex"],
permitted_packages: ["override.bcp.lib"],
}
bootclasspath_fragment {
name: "override_bootclasspath_fragment",
contents: ["override_bcplib"],
apex_available: ["myapex"],
hidden_api: {
split_packages: ["*"],
},
}
java_library {
name: "systemserverlib",
srcs: ["a.java"],
apex_available: ["myapex"],
}
systemserverclasspath_fragment {
name: "mysystemserverclasspath_fragment",
standalone_contents: ["systemserverlib"],
apex_available: ["myapex"],
}
java_library {
name: "override_systemserverlib",
srcs: ["a.java"],
apex_available: ["myapex"],
}
systemserverclasspath_fragment {
name: "override_systemserverclasspath_fragment",
standalone_contents: ["override_systemserverlib"],
apex_available: ["myapex"],
}
java_library {
name: "myjava_library",
srcs: ["a.java"],
compile_dex: true,
apex_available: ["myapex"],
}
java_library {
name: "override_java_library",
srcs: ["a.java"],
compile_dex: true,
apex_available: ["myapex"],
}
`, withManifestPackageNameOverrides([]string{"myapex:com.android.myapex"}))
originalVariant := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(android.OverridableModule)
@ -6474,13 +6396,6 @@ func TestOverrideApex(t *testing.T) {
t.Errorf("override_myapex should have logging parent (com.foo.bar), but was %q.", apexBundle.overridableProperties.Logging_parent)
}
android.AssertArrayString(t, "Bootclasspath_fragments does not match",
[]string{"override_bootclasspath_fragment"}, apexBundle.overridableProperties.Bootclasspath_fragments)
android.AssertArrayString(t, "Systemserverclasspath_fragments does not match",
[]string{"override_systemserverclasspath_fragment"}, apexBundle.overridableProperties.Systemserverclasspath_fragments)
android.AssertArrayString(t, "Java_libs does not match",
[]string{"override_java_library"}, apexBundle.overridableProperties.Java_libs)
optFlags := apexRule.Args["opt_flags"]
ensureContains(t, optFlags, "--override_apk_package_name test.overridden.package")
ensureContains(t, optFlags, "--pubkey testkey2.avbpubkey")
@ -6495,18 +6410,12 @@ func TestOverrideApex(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_MODULE := override_app.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE := overrideBpf.o.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE := override_bcplib.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE := override_systemserverlib.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE := override_java_library.override_myapex")
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := override_myapex.apex")
ensureContains(t, androidMk, "LOCAL_OVERRIDES_MODULES := unknownapex myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := app.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := bpf.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := override_app.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := override_bcplib.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := override_systemserverlib.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE := override_java_library.pb.myapex")
ensureNotContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.apex")
}