summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-09-20 01:09:48 +0000
committer Spandan Das <spandandas@google.com> 2024-09-20 23:47:36 +0000
commit52c01a1897f68e93bacfb2d7500ecc31f3bd3c61 (patch)
tree19caf92fb9d205faaf2cfaf0684c400058a45919 /apex/apex_test.go
parenta326b320ab2b8b5cbad003571f3fccf1573b20a6 (diff)
Remove internal deapexer module
The build ations will be created by the top-level apex. Details 1. In GenerateAndroidBuildActions, do a graph walk to determine if the apex has exported deps. 2. If there are exported deps, call the newly introduced `deapex` function. This registers the build rules and returns a DeapexerInfo object. This was previously provided by the internal deapexer dependency. 3. Update `dexpreoptSystemServerJars and `provideApexExportsInfo` to use the DeapexerInfo object from (2). A lot of unit tests that relied on the legacy mechanism of deapexing have been updated. Test: go test ./apex Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts) Test: verified no diff in file_list.txt Bug: 368337090 Change-Id: I0edb681beccac4d2a9ceb73f9a506c081a8a96e0
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go48
1 files changed, 30 insertions, 18 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index c45c1e42e..0438a677e 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -3685,7 +3685,7 @@ func ensureExactContents(t *testing.T, ctx *android.TestContext, moduleName, var
}
func ensureExactDeapexedContents(t *testing.T, ctx *android.TestContext, moduleName string, variant string, files []string) {
- deapexer := ctx.ModuleForTests(moduleName+".deapexer", variant).Description("deapex")
+ deapexer := ctx.ModuleForTests(moduleName, variant).Description("deapex")
outputs := make([]string, 0, len(deapexer.ImplicitOutputs)+1)
if deapexer.Output != nil {
outputs = append(outputs, deapexer.Output.String())
@@ -4959,12 +4959,14 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
},
}
- java_import {
+ java_sdk_library_import {
name: "libfoo",
- jars: ["libfoo.jar"],
+ public: {
+ jars: ["libfoo.jar"],
+ },
apex_available: ["myapex"],
+ shared_library: false,
permitted_packages: ["foo"],
- sdk_version: "core_current",
}
java_sdk_library_import {
@@ -5018,13 +5020,17 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
apex_available: ["myapex"],
}
- java_import {
+ java_sdk_library_import {
name: "libfoo",
- jars: ["libfoo.jar"],
+ public: {
+ jars: ["libfoo.jar"],
+ },
apex_available: ["myapex"],
- permitted_packages: ["foo"],
+ shared_library: false,
+ permitted_packages: ["libfoo"],
}
+
java_sdk_library_import {
name: "libbar",
public: {
@@ -5200,13 +5206,15 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
},
}
- java_import {
+ java_sdk_library_import {
name: "libfoo",
prefer: true,
- jars: ["libfoo.jar"],
+ public: {
+ jars: ["libfoo.jar"],
+ },
apex_available: ["myapex"],
- permitted_packages: ["foo"],
- sdk_version: "core_current",
+ shared_library: false,
+ permitted_packages: ["libfoo"],
}
java_library {
@@ -8057,12 +8065,16 @@ func TestDexpreoptAccessDexFilesFromPrebuiltApex(t *testing.T) {
},
}
- java_import {
- name: "libfoo",
+ java_sdk_library_import {
+ name: "libfoo",
+ prefer: true,
+ public: {
jars: ["libfoo.jar"],
- apex_available: ["myapex"],
- permitted_packages: ["libfoo"],
- }
+ },
+ apex_available: ["myapex"],
+ shared_library: false,
+ permitted_packages: ["libfoo"],
+ }
`, "", preparer, fragment)
})
}
@@ -10749,12 +10761,12 @@ func TestBootDexJarsMultipleApexPrebuilts(t *testing.T) {
{
desc: "Prebuilt apex prebuilt_com.android.foo is selected, profile should come from .prof deapexed from the prebuilt",
selectedApexContributions: "foo.prebuilt.contributions",
- expectedBootJar: "out/soong/.intermediates/prebuilt_com.android.foo.deapexer/android_common/deapexer/javalib/framework-foo.jar",
+ expectedBootJar: "out/soong/.intermediates/prebuilt_com.android.foo/android_common_com.android.foo/deapexer/javalib/framework-foo.jar",
},
{
desc: "Prebuilt apex prebuilt_com.android.foo.v2 is selected, profile should come from .prof deapexed from the prebuilt",
selectedApexContributions: "foo.prebuilt.v2.contributions",
- expectedBootJar: "out/soong/.intermediates/prebuilt_com.android.foo.v2.deapexer/android_common/deapexer/javalib/framework-foo.jar",
+ expectedBootJar: "out/soong/.intermediates/com.android.foo.v2/android_common_com.android.foo/deapexer/javalib/framework-foo.jar",
},
}