diff options
| author | 2023-04-17 11:24:54 +0900 | |
|---|---|---|
| committer | 2023-04-17 15:25:17 +0900 | |
| commit | 9551384f65eb77e43afbe3408d5437ce91804edd (patch) | |
| tree | 1d81b257b595bdaa169c1ffb249d2e3a3d33a91c /apex/apex_test.go | |
| parent | 7de9aa1a7bdc9f301891c2bd5a27e693d6b57c94 (diff) | |
apex: skip symbol files when replaced with prebuilt
Apexer rule with symbol files causes "no build rule" error when the apex
is replaced with prebuilt.
Bug: 251299786
Test: m checkbuild (presubmit)
Change-Id: I7390f72c321beaeb49fcee4e02a219c07f184664
Diffstat (limited to 'apex/apex_test.go')
| -rw-r--r-- | apex/apex_test.go | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 557265ce2..924f92344 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -5646,6 +5646,58 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) { }) } +func TestPrebuiltSkipsSymbols(t *testing.T) { + testCases := []struct { + name string + usePrebuilt bool + installSymbolFiles bool + }{ + { + name: "Source module build rule doesn't install symbol files", + usePrebuilt: true, + installSymbolFiles: false, + }, + { + name: "Source module is installed with symbols", + usePrebuilt: false, + installSymbolFiles: true, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + preferProperty := "prefer: false" + if tc.usePrebuilt { + preferProperty = "prefer: true" + } + ctx := testApex(t, ` + // Source module + apex { + name: "myapex", + key: "myapex.key", + updatable: false, + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + apex_set { + name: "myapex", + set: "myapex.apks", + `+preferProperty+` + } + `) + // Symbol files are installed by installing entries under ${OUT}/apex/{apex name} + android.AssertStringListContainsEquals(t, "Implicits", + ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("apexRule").Implicits.Strings(), + "out/soong/target/product/test_device/apex/myapex/apex_manifest.pb", + tc.installSymbolFiles) + }) + } +} + func TestApexWithTests(t *testing.T) { ctx := testApex(t, ` apex_test { |