Commit graph

127 commits

Author SHA1 Message Date
Spandan Das
5be6333692 Use the correct bootjars when multiple prebuilt apexes exist
hiddenapi and dexpreopt require boot and system server jars from apexes.
When building with prebuilts, this comes via
java_import/java_sdk_library_import, which acts as a hook for
prebuilt_apex/apex_set. If we have multiple apexes in the tree, this
hook becomes 1:many. This CL prepares dex_bootjars to select the right
deapexerd .jar files when mutliple prebuilts exist.

Implementation details
- Update prebuilt module types (prebuilt_apex/apex_set) and source
  apexes to set a map of
  library name to dex jar path on host.
- dex_bootjars will access the path of the .dex jar on host via the
  provider. These then
  copied/installed to the right locations.

This CL does not drop the old mechanism to get the dex file (i.e. by
creating a dep on java_library). Once all mainline
modules have been flagged using apex_contributions, the old mechanism
will be dropped

Bug: 308790457
Test: git_master-art-host:art-gtest https://android-build.corp.google.com/builds/abtd/run/L21500030000926533
Test: git_main:art_standalone_dexpreopt_tests https://android-build.corp.google.com/builds/abtd/run/L99000030000891212
Test: Added a unit test that checks that the right .jar is selected
when multiple prebuilts exists

Change-Id: I6ef94135b9303a35135810930af4b641df13a583
2023-12-20 16:43:01 +00:00
Spandan Das
da739a30a6 Use the correct prof file when multiple prebuilt apexes exist
Generating boot image requires a .prof file provided by the ART apex.
When building with prebuilts, this comes via the
prebuilt_bootclasspath_fragment module, which acts as a shim for
prebuilt_apex/apex_set. If we have multiple prebuilt apexes in the tree,
this shim becomes 1:many. This CL prepares dex_bootjars to select the
right .prof file when multiple prebuilts exist.

Implementation details
- Update deps mutator of dex_bootjars to create a dep on
  all_apex_contributions. The latter contains information about which
  apex is selected in a specific release configuration. dex_bootjars
  will create a dependency on the selected apex in a postdeps phase
  mutator.
- All apex module types (apex, prebuilt_apex and apex_set) will set a
  provider that contains info about the location of the .prof file on
  host
- dex_bootjars will access the provider of the selected apex to get the
  location of the .prof file

This CL does not drop the old mechanism to get the .prof file (i.e. by
creating a dep on {prebuilt_}bootclasspath_fragment). Once all mainline
modules have been flagged using apex_contributions, the old mechanism
will be dropped

Bug: 308790457
Test: Added a unit test that checks that the right .prof is selected
when multiple prebuilts exists

Change-Id: I40fdb21416c46bed32f6ff187ce5153711ec2c69
2023-12-19 22:37:29 +00:00
Spandan Das
fae468ef14 Move validation from FindDeapexerProviderForModule to rdeps
FindDeapexerProviderForModule raises an exception if multiple apexes in
the tree has an export dep on the java module. In prepartation to
support multiple prebuilts, move this error check out of
FindDeapexerProviderForModule and into rdeps. i.e. raise an exception
only if an rdep calls DexJarBuildPath

- This should be a no-op for now.
- In the short-term future, a java import module will be allowed to have
  multiple deapexers. An error will be raised if anyone actually tries
  to depend on the dexjar
- In the long-term future, this function will be removed. All processing
  will be done at the prebuilt apex level and not at the prebuilt java
  library level

Since this check now happens in the moduleCtx of rdeps, add some
additional props to unit tests to ensure that it does not exit early on
unrelated validation checks (e.g. hidden_api prop is not set)

Test: go test ./apex ./java
Bug: 308790457

Change-Id: I3323d993c1ea8f43305834cae8e65b6fe41dfefd
2023-12-18 23:19:47 +00:00
Spandan Das
2069c3f74d Move dexpreopt processing from java_*_import to prebuilt_apex
dexpreopt of apex system server from prebuilts involves three soong
modules
1. prebuilt_apex / apex_set
2. an internal deapexer module created by the prebuilt apex
3. java_import/java_sdk_library

(3) acts as a shim for the deapexer to set the dexjar extracted from the
prebuilt apex. This methodolody requires a 1:1 correspondence across the
three modules

This breaks down when we have multiple versions of the same prebuilt
apex in the tree. In preparation for this, move the dexpreopt
processing from (3) to (1). Each prebuilt_apex will create the necessary
rules for dexpreopting the jars deapexed from itself. In the future,
apex_contributions will be used to pick which service-foo.{odex|.vdex} to
install depending on which prebuilt apex is selected.

Implementation details
- Embed dexpreopter in prebuiltApex structs so that this module type can
  register the dexpreopt rules. Since a single apex can have multiple
  system server jars, this also requires creating an additional scope in
  dexpreopt.go to prevent name collisions
- Add the dexpreopt modules as required in initApexFilesForAndroidMk
- Add the depreopt modules to androidMk in AndroidMkEntries. Drop the
  equivalent from java_import and java_sdk_library_import

Bug: 308790457
Test: existing soong unit tests
Test: lunch cf_x86_64_phone-next-userdebug && m out/target/product/vsoc_x86_64/system/apex/com.google.android.adservices.apex
Test: Verified that the above command installs
/out/target/product/vsoc_x86_64/system/framework/oat/x86_64/apex@com.android.adservices@javalib@service-adservices.jar@classes.{odex|vdex} and the equivalent files of service-sdksandbox

Test: presubmits

Change-Id: I01cea8956d2857fb864b415e73d3d2686d069b5e
2023-12-18 23:17:26 +00:00
Colin Cross
402130276c Convert SetProvider to generic providers API
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.

Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14 16:12:20 -08:00
Colin Cross
09ad3a6505 Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
Merged-In: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 19:06:43 -08:00
Jooyung Han
286957df99 Rewrite how to generate apexkeys.txt
Instead of listing all apexes in the source tree, now each apex emits
its own fragment for apexkeys.txt, which is pointed by
LOCAL_APEX_KEYS_FILE. Makefile collects apexkeys.txt from installed apex
files. This is to avoid listing unrelated apexes (not installed,
testdata, unexported namespaces, etc.)

Bug: 304914238
Test: m apexkeys.txt
Test: m blueprint-tests
Change-Id: Iefbe6e486cb418955584ad1a282455307e90be95
2023-10-30 16:48:36 +09:00
Jooyung Han
138ee09e28 Merge changes from topic "deprecate-zip-apex" into main
* changes:
  apex: Remove host support
  apex: Remove apexPackagingMutator
  apex: Remove 'zip' apex support
2023-08-23 23:48:43 +00:00
Jooyung Han
8d4a1f03b0 apex: Remove host support
Since we no longer support "zip" APEX, we don't need "host" support.

For example, we don't need go/python binary support.

Bug: 279835185
Test: m
Change-Id: I6e8d2b205e42662f31866dc9ac7507524effd144
2023-08-23 14:01:21 +09:00
Jooyung Han
06a8a1c384 apex: Remove 'zip' apex support
zip apex is no longer supported.

Bug: 279835185
Test: m
Change-Id: I651b0dc4e0efe766f61e97b1e5dd263e0ab74102
2023-08-23 14:01:13 +09:00
Cole Faust
d22afe96d7 Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS
We want to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can
remove the need for `m installclean`.

Currently, the compat symlinks are installed by adding them as
dependencies of other installed files. Doing this doesn't end up
propagaing the compat symlinks all the way to FULL_SYSTEMIMAGE_DEPS.

Add them to LOCAL_SOONG_INSTALL_SYMLINKS, which will cause them to
be propagated to FULL_SYSTEMIMAGE_DEPS.

Bug: 205632228
Test: Full build with a change to delete files not in FULL_SYSTEMIMAGE_DEPS from the staging dir
Change-Id: Idc7fc0a0dbf7c8ac3f0628c16413cd1df69a7821
2023-08-22 11:59:07 -07:00
Chun-Yi Lee
0a693c5b5c Revert "Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS"
Revert submission 2718295-colefaust_track_apex_compat_symlinks

Reason for revert: To validate if this change is causing the build breakage.

Reverted changes: /q/submissionid:2718295-colefaust_track_apex_compat_symlinks

Change-Id: I1896530219cf984efdf9ca7f4b14d8784367f242
2023-08-22 01:18:45 +00:00
Cole Faust
b23d574655 Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS
We want to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can
remove the need for `m installclean`.

Currently, the compat symlinks are installed by adding them as
dependencies of other installed files. Doing this doesn't end up
propagaing the compat symlinks all the way to FULL_SYSTEMIMAGE_DEPS.

Add them to LOCAL_SOONG_INSTALL_SYMLINKS, which will cause them to
be propagated to FULL_SYSTEMIMAGE_DEPS.

Bug: 205632228
Test: Full build with a change to delete files not in FULL_SYSTEMIMAGE_DEPS from the staging dir
Change-Id: I0600ccf8d863d5e29e044c82293ece730fc98d43
2023-08-18 16:05:44 -07:00
Jooyung Han
eec1b3fe26 Remove "flattened" apexes
Now soong doesn't build "flattened" apexes.

Bug: 279835185
Test: m nothing (soong tests)
Test: m && launch_cvd (cuttlefish)
Change-Id: Id3c540ece1a15cecacc185da9aa17285edd2f493
2023-06-21 14:29:26 +09:00
Jiakai Zhang
b47caccbc0 Remove the ability to install boot images by bootclasspath_fragments.
We don't need this anymore because we are going to compile ART jars and
framework jars together.

Bug: 280776428
Test: m
Change-Id: I070157530449a1bb5779e25984c367df3dde7b36
2023-05-11 18:25:18 +01:00
Liz Kammer
2dc7244af9 Don't add apex_set deps in nondeterministic order
Test: unit tests
Change-Id: I97a9708cb6e5a4f3aef55697b6127f61e4d17720
2023-04-20 11:30:19 -04:00
Pranav Gupta
51645ff23e Add skip-sdk-check to extract_apks
Add skip-sdk-check to skip checking the SDK version when extracting an
APK/APEX from an App Set Bundle. This can be used when the platform SDK
version is not defined and the APEXs/APKs use SHA based SDK versions.
This check should not be set to true for non Beta dessert releases

Bug: 274518686
Test: # Add SHA targeting modules to platform
m SOONG_SKIP_APPSET_SDK_CHECK=true  #Build Passes
m SOONG_SKIP_APPSET_SDK_CHECK=false #Build Fails
m #No config supplied, build fails

Change-Id: I1919437d3410f09c991e1de39031bd88e1f8246a
2023-03-21 08:13:25 -07:00
Paul Duffin
76fdd67f9f Allow building against prerelease prebuilt APEXes
Generally, when building system images from prebuilt APEXes the APEXes
should be released versions and the build ensures that is the case when
extracting .apex files from prebuilt .apks files. However, it is useful
to test building against prebuilt APEXes before finalization to flush
out any issues early on. Previously, the build would fail in that case.
This change adds support for using the SOONG_ALLOW_PRERELEASE_APEXES
environment variable to allow prerelease APEXes to be suppported.

Bug: 259958590
Test: m MODULE_BUILD_FROM_SOURCE=false droid
      # Above fails because it could not find non-prelease APEXes in the
      # prebuilt .apks files.
      m SOONG_ALLOW_PRERELEASE_APEXES=true MODULE_BUILD_FROM_SOURCE=false droid
      # Above works.
Change-Id: I20b8e5db0b9fd2a21434be25652195fae929bd3f
2022-12-12 18:00:47 +00:00
Paul Duffin
4f2282c2d8 Make apex_set support ":<apex>" syntax to access the apex file
The apex and prebuilt_apex module types make the output APEX available
using ":<apex>" syntax, e.g. for use as a data file in a test. This
change adds compatible behavior to apex_set to ensure consistent
behavior when building against prebuilts.

Bug: 259958590
Test: m MODULE_BUILD_FROM_SOURCE=false nothing
Change-Id: Ic6f105976cfdd6af4920cc1e11ab0b4ff72e6a6f
2022-12-12 17:44:33 +00:00
Anton Hansson
805e0a53ef Ignore native bridge archs for apex selection
This leads to an arm64 apex being used on a device that is mixed
x86_64 with nativebridge=arm64. A device like that doesn't appear
to work with arm64 binaries. For example, the boringssl-self-check
binary crashes on boot.

Bug: 260115309
Test: unit test
Test: boot emulator with this combination
Change-Id: Ic4a91974290a05b1799f755fcf52ef226d68f4c2
2022-11-29 12:56:37 +00:00
Colin Cross
abacbe8436 HACK: use arm64 apex prebuilts for riscv64
There are no riscv64 apex prebuilts, which breaks the build when
provenance_metadata singelton tries to run a tool on all the input
apexes that don't exist.  Hack it to provide the arm64 apex for now
if no riscv64 apex is specified, which will allow the build to pass.

Test: lunch aosp_riscv64-userdebug && m droid
Change-Id: Ic39936539803615ea4b7f817daf7b59ab7c40e7e
2022-11-01 19:13:17 +00:00
Chen Guoyin
401f298e50 Add riscv64 support for apex prebuilt
This add support for src field in bp file.

Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I9393696951db375d53436f9d5a9841b6a072cea3
2022-10-13 00:00:11 +08:00
Colin Cross
553a31be9d Support AllowMissingDependencies in prebuilt_apex modules
Arch-specfic prebuilt_apex modules may be missing prebuilts for new
architectures.  Mark the module as missing dependencies and allow
build analysis to continue when AllowMissingDependencies is set.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I79f0c20a0c9443fe443f9ed9bc846aa649f6b6a6
2022-10-04 16:38:14 -07:00
Pranav Gupta
eba03b0935 Tag apex_set's 'set' config with android:"path"
This allows apex_set's set config to use other soong modules as a dependency

Bug:249169376
Change-Id: I8da20c6f474328d63d9aa3811f94e3e04b89ea4c
Test: Added a test case to check soong module assignment to the set field of an apks_set rule
2022-09-27 16:29:36 +00:00
Colin Cross
d079e0b270 Reformat build/soong for go 1.19
Test: none
Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
2022-08-17 10:43:13 -07:00
Wei Li
340ee8e699 Export provenance metadata for prebuilt APKs and APEXes.
Bug: 217434690
Test: atest --host gen_provenance_metadata_test
Test: m provenance_metadata

Change-Id: I91c184b6e6fe5ccfc3fc65b55b09e7a3da9502a0
2022-04-05 16:16:16 -07:00
Jiakai Zhang
e6e90db00a Allow installing boot images outside of APEX for prebuilt.
This change is similar to aosp/1947127, but for prebuilts.

After this change, if `bootImageConfig.installDirOnDevice` is set to a
path outside of the APEX, the build system will build a boot image from
the dex files and the profile extracted from the prebuilt APEX.
Otherwise, it keeps the current behavior: extracting the boot image from
the prebuilt APEX.

This is a no-op change. Current behavior is not affected.

Bug: 211973309
Test: m nothing
Test: -
  On internal master:
  1. Patch aosp/1947128.
  2. Patch ag/16743847 and ag/16746804.
  3. m SOONG_CONFIG_art_module_source_build=false com.google.android.art
  4. See the boot image being installed in `/system/framework/<arch>`.
Change-Id: I24ca525309fecaf3ab7a67960fbf118cd00ecd1d
2022-01-28 15:08:06 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Colin Cross
730e3f6139 Set prebuiltCommon.installedFile for apex_set modules
apex_set modules failed to set prebuiltCommon.installedFile, which
caused LOCAL_SOONG_INSTALLED_MODULE to be empty and base_rules.mk
to create a duplicate install rule.  Set it to the path to the
apex file installed by Soong.

Bug: 204136549
Bug: 209867137
Test: m SOONG_CONFIG_art_module_source_build=false
Change-Id: Ia7fec09598823343242ebd44f1732e6bba21d027
2021-12-09 05:24:15 +00:00
Martin Stjernholm
ae44fd8032 Don't pass ":=" in variable name to AndroidMkEntries.SetString.
Fixes typos in https://r.android.com/1897972.

Test: m SOONG_CONFIG_art_module_source_build=false nothing
Bug: 204136549
Change-Id: I768c21bc99bfb4978fcf7f4f3631eef866e76764
2021-11-23 23:17:33 +00:00
Colin Cross
6340ea50d4 Move apex module installation into Soong
Move apex module installation rules into Soong by overriding
InstallBypassMake.

Soong installs don't support post install commands, so move the
symlinks into separate rules and add dependencies on them.

This relands If65d283abc86f18ad266da0bf16fe95971a0bf9c with fixes
to install files into $OUT/apex and I606286e971b55d9d1fc4dcd0fbd476962de5fa79
with a fix for reversed logic.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie65c53ebc7911efacdb8e11ba49059448f03c658
2021-11-19 13:37:36 -08:00
Colin Cross
ccba23db44 Revert "Move apex module installation into Soong"
This reverts commit e3d156a622.

Reason for revert: b/206119621

Bug: 204136549
Change-Id: I380223b86660c27bea8f5dcc2d61f32df2704c02
Fixes: 206119621
2021-11-12 19:01:29 +00:00
Colin Cross
e3d156a622 Move apex module installation into Soong
Move apex module installation rules into Soong by overriding
InstallBypassMake.

Soong installs don't support post install commands, so move the
symlinks into separate rules and add dependencies on them.

Bug: 204136549
Test: m checkbuild
Change-Id: If65d283abc86f18ad266da0bf16fe95971a0bf9c
2021-11-11 17:44:42 -08:00
Paul Duffin
13dd220448 Merge "Stop prebuilt_apex/apex_set exporting invalid jars to Make" 2021-10-13 14:53:17 +00:00
Paul Duffin
2579631bd1 Stop prebuilt_apex/apex_set exporting invalid jars to Make
A prebuilt_apex/apex_set module can make a dex implementation jar
available for use by Make targets but it does not have access to a real
classes implementation jar; the jar in the corresponding sdk is just an
empty file. Exporting that invalid file to Make means that the phony
target created for the module depends on an invalid classes jar which
causes the build to fail.

This change removes the logic that make classes and header jars
available to Make so that building the phony target no longer fails.

Bug: 202521005
Test: m TARGET_PRODUCT=armv8 TARGET_PRODUCT_VARIANT=eng TARGET_BUILD_UNBUNDLED=true SOONG_ALLOW_MISSING_DEPENDENCIES=true core-icu4j
      - above was performed in master-art.
Change-Id: If667b36b988e2d331acd85f60f3369778838d034
2021-10-11 17:53:54 +01:00
Jiakai Zhang
d20f37f014 Merge changes I7876b077,Ib2e7d5e6,I7d2d2e02,Ibf5322f8 am: dcc42b6f7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835088

Change-Id: Ifefcf876e203406967f44c035495dbba49c4362f
2021-09-30 15:24:48 +00:00
Jiakai Zhang
774dd305f4 Add exported_systemserverclasspath_fragments to prebuilt_apex rule.
This is for exporting the contents of systemserverclasspath_fragment for
dexpreopting.

Bug: 194150908
Test: manual - 1. Patch aosp/1818020 and aosp/1834534
  2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Change-Id: I7d2d2e02869d8a523f7c0efbbff81706672a95c5
2021-09-30 10:06:21 +00:00
Martin Stjernholm
40fc93fb3c Merge changes I957f3df8,I68986dcc am: cf6bf37d04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829372

Change-Id: Ifcf471f2746c1037b83c2a11b8f5120b86fd6cb2
2021-09-24 09:44:00 +00:00
Martin Stjernholm
4482560cc7 Consolidate the code to resolve a deapexer module dependency.
It will get more logic in upcoming CLs.

Add a property to DeapexerInfo for the APEX name, for use in error
messages.

Test: m nothing
Bug: 192006406
Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
2021-09-23 17:19:55 +01:00
Martin Stjernholm
8be1e6db16 Propagate the dex jar path as an OptionalPath which is either valid or
invalid with a message.

This will allow propagating any error from the deapexer module for
prebuilt APEXes to the location where the dex jars get used. It's only
at those points that we can raise errors about not being able to
extract files from the deapexer modules if they are invalid, and this
way we avoid encoding knowledge there about why they may be invalid.

To keep the refactoring limited it intentionally does not change any of
the existing logic for when dexJarFiles are set or not (non-nil vs nil
prior to this change), although there may be opportunity to use this
for more conditions when dex jars aren't available.

The refactoring is also not extended to
dexpreopt.ClassLoaderContextMap.

Test: m nothing
Bug: 192006406
Change-Id: I68986dccd9a9b3fee4d24caa1947ea17a36caedc
2021-09-23 17:19:55 +01:00
Jiakai Zhang
23a5cba0af Merge changes I9c94a54a,Idc0c73a7 am: 2c6ede11cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824513

Change-Id: I1f3ce39cd3b3988e676791a59f0c70e2bc80015d
2021-09-17 11:33:22 +00:00
Jiakai Zhang
204356f3b5 Preopt APEX system server jars from prebuilts.
Similar to the previous CL, but for jars from prebuilts.

Test: manual - 1. Patch aosp/1818020 and aosp/1810840.
  2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Bug: 194150908
Change-Id: Idc0c73a78045a602ad3a91cb5071d291bd611015
2021-09-15 09:01:07 +00:00
Mohammad Islam
17544fe23a Merge "Relax restriction on suffix of apex_set filename to include .capex" am: 385cde82d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821656

Change-Id: I91189bd060d0c365892234daab5a59b70a8018c7
2021-09-09 09:08:51 +00:00
Samiul Islam
7c02e26cba Relax restriction on suffix of apex_set filename to include .capex
Compressed APEX files generated by the build system have the .capex
extension. This CL allows us using those .capex files with their actual
suffix.

Bug: 197258691
Test: manual + unit test added
Change-Id: I79173ef942326b48b5e659f1873d80f12b212339
2021-09-08 18:29:47 +01:00
Kun Niu
ce1dcf6a9f Use prebuild modules even when coverage is enabled.
Bug: 194323871
Test: local build passed.
Change-Id: I94a3922453473de7d754afce4b05ac3b6ae3765d
2021-08-05 18:15:28 +00:00
Paul Duffin
46ab291f67 Ignore license and similar dependencies of prebuilt_apex/apex_set
Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.

This change simply ignores any module that does not implement
ApexModule.

Bug: 179354495
Test: m nothing
Merged-In: Iead6f9d1085d169335b88ceadcce2d8cc042254d
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
(cherry picked from commit fee8cf36e3)
2021-06-30 00:08:49 +01:00
Paul Duffin
fee8cf36e3 Ignore license and similar dependencies of prebuilt_apex/apex_set
Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.

This change simply ignores any module that does not implement
ApexModule.

Bug: 179354495
Test: m nothing
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
2021-06-29 18:42:55 +01:00
Martin Stjernholm
d8da28ea9c Fix inconsistencies in the apex names used for the apex variations.
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.

Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.

For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.

Cherry-picked from https://r.android.com/1748294.

Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Merged-In: If8612639bffdf91cbcab3387b0603bf5dffef1f5
2021-06-25 21:27:14 +01:00
Martin Stjernholm
bfffae7bec Fix inconsistencies in the apex names used for the apex variations.
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.

Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.

For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.

Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
2021-06-25 16:41:05 +01:00
Paul Duffin
034196d9fe Simplify deapexer support
Uses the apex relative path to the file as the identifier that is used
to obtain the path to the corresponding file extracted from the apex.
That is instead of a special constructed string id.

Bug: 177892522
Test: m nothing
Merged-In: I5dc77c8fb272bac289b8891d1eac801e541af1f5
Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
(cherry picked from commit b4bbf2ca10)
2021-06-21 10:54:22 +01:00