Improve android_app_import.dpi_variants handling.

Instead of circumventing the limitation of Prebuilt implementation by
picking a source path itself, it now uses the same mechanism as
archMutator and replaces the source path in advance so that Prebuilt
always sees the corrent source path.

Because this requires the Apk field to be a string pointer, the single
source prebuilt implementation is being updated to be reflection-based.

Test: Soong unit tests, m soong_docs, TreeHugger
Change-Id: I2304f15e32d632f74f95f0d9e9bf1f75ff3e2225
This commit is contained in:
Jaewoong Jung
2019-06-11 12:25:34 -07:00
parent 630846d244
commit 3e18b19442
4 changed files with 120 additions and 81 deletions

View File

@@ -1138,7 +1138,7 @@ func TestAndroidAppImport_DpiVariants(t *testing.T) {
{
name: "AAPTPreferredConfig matches",
aaptPreferredConfig: proptools.StringPtr("xhdpi"),
aaptPrebuiltDPI: []string{"xxhdpi", "lhdpi"},
aaptPrebuiltDPI: []string{"xxhdpi", "ldpi"},
expected: "prebuilts/apk/app_xhdpi.apk",
},
{