Commit Graph

617 Commits

Author SHA1 Message Date
TreeHugger Robot d65089b4a4 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev 2020-06-22 17:55:16 +00:00
Jooyung Han d166f79278 Merge "apex: make allowed_files prop overridable" into rvc-dev 2020-06-22 17:05:58 +00:00
Paul Duffin 9ee66da850 Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
Merged-In: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-20 11:38:08 +01:00
Jooyung Han faa5399b3f apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
2020-06-20 12:56:49 +09:00
Andrei Onea 115e7e77d8 Enforce permitted_packages for Q+ and R+ modules
Q+ and R+ mainline modules may only add code in a restricted set of Java
package prefixes, that may never be changed.
If a mainline module owns the Java package prefix "foo.bar", it may have
classes in "foo.bar", "foo.bar.baz", "foo.bar.baz.bat" etc.

Test: m
Bug: 156725734
Change-Id: I30bf510ed473309871469bf439d7c81575450931
2020-06-18 16:57:39 +01:00
Jiyong Park ac5e79f900 Don't remove entries for overriddable modules
Previously, when there is apex_set that is overriding another module,
the entry for the overridden module is removed from apexkeys.txt.
However, this is wrong because the existence of the apex_set module
doesn't necessary mean that the module is insatalled instead of the
overridden module. That is determined by PRODUCT_PACKAGES which Soong
has no knowledge of. Therefore, we don't delete the entry for the
overridden (actually possibly overridable) modules in the file.

Bug: 158729168
Test: m
Change-Id: I85d0c756f862323bae556bf657d66ec50038985f
2020-06-18 23:05:31 +09:00
Jiyong Park 8d6286befe apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Exempt-From-Owner-Approval: cherry-pic from AOSP

Bug: 158729168
Test: m
Merged-In: I9507375342ec053309660d94c931a79bf4f21218
(cherry picked from commit 8d6c51ebcc)
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-17 13:17:11 +09:00
Anton Hansson c3754ba042 Merge "Let APEX build against preferred java_sdk_library_import" into rvc-dev 2020-06-16 17:47:16 +00:00
Paul Duffin f642a31ab5 Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Merged-In: I2f4edea937ac377431a5696c92cbd467bded62ef
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
(cherry picked from commit eedc5d55ce)
2020-06-16 10:43:19 +01:00
Colin Cross f4a5492ec9 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev
* changes:
  Use inclusive language in Android.bp files
  Use inclusive language in build/soong
2020-06-16 03:28:15 +00:00
Colin Cross a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross 95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Jiyong Park e26a63e2fd Fix type assertion error regarding dex_import
Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f made it possible to add
dex_import modules into apex, but that change had a bug. When creating
Android.mk for the dex_import module, the code executed an unchecked
type assertion to convert java.DexImport to java.Dependency, which
cannot be successful. This change fixes the bug by doing a checked type
assertion instead.

Exempt-From-Owner-Approval: cp from AOSP

Bug: 157886942
Test: m (test added)
Merged-In: Id22c20d42effce539fab10b0d349bf340d467f02
(cherry picked from commit 9e83f0b531)
Change-Id: Id22c20d42effce539fab10b0d349bf340d467f02
2020-06-11 09:47:16 +09:00
Jaewoong Jung 829b7135f3 Use Targets[Android] instead of DeviceArch funcs.
NDK prebuit script doesn't set device arch product variables, and so
causes SupportedAbis to panic.

Fixes: 158673325
Test: app_test.go, apex_test.go
Test: build-ndk-prebuilts.sh
Change-Id: I8331ef5bca12301318510ec9712770fd8d3a26a9
2020-06-10 12:30:51 -07:00
Sasha Smundak c4f0ff1d6c Cherrypick aosp/1318079 and aosp/1324841
Allow apex module to have android_app_set as its constituent.
Fix android_app_set documentation

Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: Id9b296d9301902deb463b299413491bc66d58944
2020-06-05 15:39:38 -07:00
Anton Hansson d7fdfd6e77 Merge "dex_import can be added to apex" into rvc-dev 2020-06-05 10:05:50 +00:00
Anton Hansson 4ecb0d6bb0 Merge "Use Stem where output file name is expected in APEX" into rvc-dev 2020-06-05 10:05:50 +00:00
Jiyong Park 2cd081cf06 dex_import can be added to apex
Bug:157886942
Test: m
Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
Merged-In: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
2020-06-04 10:28:44 +01:00
Jaewoong Jung fccad6b098 Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

(This is a cherry-pick change.)

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
Merged-In: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-02 14:35:04 -07:00
Kousik Kumar 6619d28c15 Merge "Add support for remote-execution / caching of signapk actions" into rvc-dev 2020-05-31 01:10:18 +00:00
Jiyong Park 327b057e84 Merge "Notice file embededd in APEX is deterministic" into rvc-dev 2020-05-30 22:35:47 +00:00
Kousik Kumar 15e9d0dbf8 Add support for remote-execution / caching of signapk actions
Test: "RBE_SIGNAPK=true RBE_SIGNAPK_EXEC_STRATEGY=remote ... use_rbe m" on crosshatch-userdebug and
signapk targets worked
Bug: b/156765091

Change-Id: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
Merged-In: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
2020-05-30 19:58:58 +00:00
Jiyong Park cbe50c7073 Use Stem where output file name is expected in APEX
Bug: 157638999
Test: m
Merged-In: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
(cherry picked from commit f1493cc0f2)
Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
2020-05-30 21:15:24 +09:00
Jiyong Park 402ace6c25 Notice file embededd in APEX is deterministic
Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 157724521
Test: m
Merged-In: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
(cherry picked from commit 33c7736936)
Change-Id: I25f6cd9dd0679af6acfc2594314d11fa53ae2151
2020-05-30 12:11:16 +00:00
Jiyong Park ed50ca8dd8 apex respects stem of java_library modules
apex now respects stem of java_library modules.

As a follow-up we need to suppor the same for other types of modules.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 157638999
Test: m
Merged-In: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
(cherry picked from commit a62aa23990)
Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-29 14:15:36 +09:00
Jiyong Park b7431abffe Merge changes from topic "apex_available_art" into rvc-dev
* changes:
  Remove apex_available whitelist for the ART APEX
  DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
2020-05-28 00:49:45 +00:00
Artur Satayev 07d215215b Merge changes I4ab7e1a3,Ib525b2f5,I2d4c54fb into rvc-dev
* changes:
  Generate combined deps-info for all updatable modules.
  Remove ApexBundleDepsInfo.MinSdkVersion()
  Add "updatable" property to ApexModule interface.
2020-05-27 20:58:27 +00:00
Artur Satayev 2b4b7bbe82 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Merged-In: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 849f844252)
2020-05-27 17:51:18 +01:00
Ulya Trafimovich c0eb0b1ae5 Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a)
2020-05-27 17:50:51 +01:00
Paul Duffin bf19a97965 java_sdk_library: Expose implementation within APEX
Access to the implementation JARs is restricted to avoid code from
depending on implementation details that could change from one release
to the next which could cause compatibility issues. That is not a
problem when referenced from within the APEX that contains the
java_sdk_library.

As references from within the same APEX often need to access
implementation specific details of the java_sdk_library and doing that
from within the same APEX is safe this change all references to a
java_sdk_library made within the same APEX to use the implementation
jars instead of stub jars.

Bug: 155164730
Test: m droid
Change-Id: If239059690de61683c2ad2d8a0ce2e47286a3637
(cherry picked from commit 9b879594ed)
2020-05-27 07:41:18 +01:00
Jiyong Park be6e2b6a18 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-25 17:05:35 +09:00
Jiyong Park 8b39919030 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
This reverts commit c9c7116721.

This revert is to avoid merge conflict when ag/11299431 is auto-merged
to master.

This change will again be reverted when ag/11299431 lands.

Bug: 150999716
Test: m

Change-Id: Ia0f7a0e0eb8cf6f6f4d0693de01777a8a750c769
2020-05-25 17:05:35 +09:00
Jooyung Han e0937418a9 Merge "apex: Make android_library support APEX variants" into rvc-dev 2020-05-21 11:48:56 +00:00
Jooyung Han 11c2093ea3 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
2020-05-20 21:49:30 +00:00
Nikita Ioffe 5f6771e160 Always set targetSdkLevel to DefaultAppTargetSdk
Test: m
Bug: 156914912
Change-Id: Ibe63352c2fc474dd816d87ac79b31a56d32b35d2
2020-05-20 00:20:00 +01:00
TreeHugger Robot 53754e3592 Merge "Remove apex_available whitelist for the extservices APEX" into rvc-dev 2020-05-17 15:17:58 +00:00
Jiyong Park db4ce6e80a Remove apex_available whitelist for the extservices APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Merged-In: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
2020-05-17 21:23:08 +09:00
Paul Duffin c91aafb699 Merge "Replace javaLibrary with java.Dependency,android.Module" into rvc-dev 2020-05-16 07:24:18 +00:00
Jaewoong Jung 8cf307e754 Add apex_set module.
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.

Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Merged-In: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
2020-05-16 00:37:36 +00:00
Paul Duffin f299cbefcd Replace javaLibrary with java.Dependency,android.Module
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.

Bug: 146586360
Test: m nothing
Merged-In: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
(cherry picked from commit 581bbbe8cb)
2020-05-15 17:07:02 +01:00
Paul Duffin eedf3f1f4a Move prebuilts mutators after defaults have been applied
A follow up change will add a mechanism for a module to register a hook
that is called after any defaults have been applied. That is intended
for use by modules like java_sdk_library that create child modules that
are dependent upon properties that could be supplied by defaults.

Creating those child modules after prebuilts mutators are run will
cause problems if those child modules clash with prebuilts modules.
Moving the prebuilts mutators after the defaults mutators will fix
that.

Tests are currently being run with the mutators in different orders so
this change also cleans that up so they are consistent with the actual
code that is being run.

Bug: 155295806
Test: m checkbuild
Merged-In: I825c6df09058fb3a45db196661959eb332aca2f3
Change-Id: I825c6df09058fb3a45db196661959eb332aca2f3
(cherry picked from commit c988c8e202)
2020-05-07 11:36:44 +01:00
TreeHugger Robot c40859ae12 Merge "Remove networkstack-aidl-interfaces-unstable-java from the whitelist" into rvc-dev 2020-05-07 05:43:24 +00:00
Artur Satayev 388d39ba9a Introduce min_sdk_version to deps info.
Bug: 149622332
Test: m
Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
Merged-In: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 480e25b74f)
2020-05-06 15:01:14 +00:00
Jeongik Cha 255a570e6d Remove networkstack-aidl-interfaces-unstable-java from the whitelist
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist

Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
2020-05-06 05:20:13 +00:00
Artur Satayev 5e7c32d6cb Introduce flat deps info list.
Compared to full list, flat list drops dependency edges and simply
lists all transitive dependencies for a top-level apex bundle.

Bug: 149622332
Test: m, manually build flatlist
Change-Id: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
Merged-In: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit a8bd113a69)
2020-05-05 17:28:41 +00:00
Artur Satayev 334b51730a Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Merged-In: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 872a144dca)
2020-05-05 16:19:07 +00:00
Artur Satayev 2eedf623ff Ensure APEX's Java deps use stable SDKs.
Test: m
Bug: 153333044
Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Merged-In: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 8cf899afcc)
2020-05-04 16:51:59 +00:00
Colin Cross 2a5fb91370 Merge changes from topic "sdk_version_variant" into rvc-dev
* changes:
  Add sdk mutator for native modules
  Require apps built against the SDK to use JNI built against the NDK
2020-05-02 01:41:18 +00:00
Nicolas Geoffray 101a7622fe Fix dex2oat symlink now that we generate dex2oat32/dex2oat64.
Test: m
Bug: 155257660
Change-Id: I466feabc64c0fb77fcf652be81bc0c4944b84ac0
2020-04-29 12:00:41 +01:00
Jiyong Park 23ba7cc000 Merge "Add test_for property" into rvc-dev 2020-04-28 14:27:07 +00:00