Commit graph

20491 commits

Author SHA1 Message Date
Paul Duffin
dce3fe78f0 java_sdk_library: Improve consistency with ..._import
The scopePaths struct is used by both java_sdk_library and its prebuilt
but was not populated in the same way. This change addresses those
discrepancies in preparation for a follow up change which will allow
access to some of those fields through OutputFileProvider.

Changes:
* Document the scopePaths field and struct.
* Switch those fields that may not be fully populated from Paths to
  OptionalPath to make that 100% clear and protect against unchecked
  use.
* Switch java_sdk_library_import to use the dependency extraction
  mechanism driven by the dependency tag. This should actually have
  been part of the change that added that mechanism.
* Only create prebuilt_stubs_sources if sources have been provided.
* Add dependencies from java_sdk_library_import on its stubs source
  child modules if sources have been provided. That will ensure the
  stubsSrcJar field is updated.
* Updates current/removedApiFilePath if provided for the scope in
  java_sdk_library_import.
* Extracts ApiStubsSrcProvider from ApiStubsProvider to allow it to
  be implemented by PrebuiltStubsSources so that it can provide access
  to the stubs src jar that it creates.

Test: m nothing
Bug: 148080325
Bug: 155164730
Merged-In: Ic5bf884b2b1e79841843e7c3b4642796ecd49f5d
Change-Id: Ic5bf884b2b1e79841843e7c3b4642796ecd49f5d
(cherry picked from commit 0f8faffdc0)
2020-05-21 14:53:38 +01:00
Paul Duffin
fe82172afb java_sdk_library: Add redirection to module-lib stubs
Previously, when using sdk_version: "module_current" any direct
reference to an sdk library would use the public not module-lib stubs.
This change corrects that.

Prior to the addition of the module-lib api scope almost all
java_sdk_library instances supported all the scopes to which a request
for jars could be redirected, i.e. public, system and test. The
exceptions to that are a few special instances that were used with
sdk_version: "none" and so were either caught by the java_sdk_library
special cases or dropped through to public.

The addition of module-lib, plus the flexible control over which scopes
are generated means that is no longer true. It is possible for a
java_sdk_library to be requested for a scope it does not have which
would have resulted in an empty set of paths being returned leading to
confusing compilation errors.

To avoid that this change also adds support for using the inheritance
hierarchy defined by the apiScope.extends field to fall back to the
closest available surface.

Test: m nothing
Bug: 155164730
Merged-In: I6aab75a772433ee0a36b6f1758a4aec4be2f9a49
Change-Id: I6aab75a772433ee0a36b6f1758a4aec4be2f9a49
(cherry picked from commit 803a9565cd)
2020-05-21 14:53:38 +01:00
Paul Duffin
f97ca37fce java_sdk_library: Extract common stubs redirect code
The java_sdk_library and java_sdk_library_import redirect a request for
header and implementation jars to broadly the same place although the
java_sdk_library does have some special code that is mixed in with the
common code.

This change separates the java_sdk_library special code from the common
code and moves the common code into its own method for use by both
module types. That makes the special behavior clearer and ensures the
common behavior remains consistent in future.

Test: m nothing
Bug: 155164730
Merged-In: I53e41a18792488aefd6a886c587559e90b3c4fde
Change-Id: I53e41a18792488aefd6a886c587559e90b3c4fde
(cherry picked from commit b05d4295de)
2020-05-21 14:53:38 +01: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
Alexander Smundak
c6088b2d08 Merge "Handle universal APK case in extract_apks" into rvc-dev 2020-05-20 19:55:44 +00:00
Nikita Ioffe
b029f03191 Merge "Always set targetSdkLevel to DefaultAppTargetSdk" into rvc-dev 2020-05-20 10:39:07 +00:00
Sasha Smundak
06fcac6f24 Handle universal APK case in extract_apks
Bug: 157081961
Test: manual and builtin
Change-Id: I5ac64c845328a54024171da41c369050243462b0
2020-05-20 00:38:02 -07: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
bf5c640aa5 Merge "Add --no-force-assign-all for java_sdk_library" into rvc-dev 2020-05-19 23:08:47 +00:00
Paul Duffin
31b84c83bf Add --no-force-assign-all for java_sdk_library
Previously, the flag was only added for java_library modules that were
being instrumented. This will also add if for java_sdk_library modules
too.

Bug: 156705688
Test: TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86 EMMA_INSTRUMENT=true NATIVE_COVERAGE=true ./vendor/google/build/build_unbundled_coverage_mainline_module.sh -j8
Change-Id: I5d06ec037007b1770748df24a2e2e8691f177f4f
2020-05-19 21:18:05 +01:00
Jeff Tinker
999cff9a36 Merge "Revert "Generate the ART boot image for host as well (used by ART tests)."" into rvc-dev 2020-05-19 18:10:51 +00:00
Jeff Tinker
74cc81c399 Revert "Generate the ART boot image for host as well (used by ART tests)."
This reverts commit e920d2d0c5.

Reason for revert: b/157053931 - Broken test:
com.android.devicehealthchecks.SystemAppCheck#system_app_native_crash
on git_rvc-dev on crosshatch-userdebug at 6510182

This CL is the only change in this build range so seems likely to be
the culprit.

Build break bug number:
bug:157053931

Original CL bug numbers:
Bug: 147817558
Bug: 147819342
Bug: 156649984

Change-Id: If8bf2f646789b583adcbfbc5df263ce953c05b76
2020-05-19 18:08:01 +00:00
TreeHugger Robot
47df9bc10d Merge "Add support for remotely executing header-abi-dumper actions." into rvc-dev 2020-05-19 16:27:38 +00:00
Ulyana Trafimovich
b3b814cbdd Merge "Generate the ART boot image for host as well (used by ART tests)." into rvc-dev 2020-05-19 14:13:16 +00:00
Treehugger Robot
35a91836e4 Add support for remotely executing header-abi-dumper actions.
Bug: b/156613606
Test: built with and without RBE_ABI_DUMPER set.
Change-Id: Ie752c07325453076d191813eaa50da03e3a0c2d8
Merged-In: Ie752c07325453076d191813eaa50da03e3a0c2d8
2020-05-19 09:55:36 -04:00
Ramy Medhat
9adb15e4d3 Merge "Add implicit outputs to link actions Bug: b/154733231" into rvc-dev 2020-05-19 13:43:06 +00:00
David Srbecky
e920d2d0c5 Generate the ART boot image for host as well (used by ART tests).
This will allow us to remove the core.art image compiled in make.

Test: lunch aosp_x86_64 && m test-art-host-gtest
Bug: 147817558
Bug: 147819342
Bug: 156649984
Change-Id: I864f72198d875dc1421c9c029a683bafbe7b71ac
Merged-In: I864f72198d875dc1421c9c029a683bafbe7b71ac
(cherry picked from commit 7f8dac1254)
2020-05-19 09:44:51 +01:00
Stephen Hines
13b041d6ea Merge "Default to zero-initialization instead of pattern." into rvc-dev 2020-05-18 22:18:21 +00:00
Liz Kammer
2bc57f6afe Add signing linage support for android_app_import
Test: app_test
Bug: 153366049
Change-Id: I260f198637a1a0f8b3373250413356785c56588a
2020-05-18 10:46:19 -07:00
Paul Duffin
c8f2f186d1 Extract common behavior between Module and Import
Although the duplication being eliminated here is minimal follow up
changes will add more functionality that is common to Module and
Import.

Test: m nothing
Bug: 156723295
Merged-In: I1733405526764272beba63470a9bc8a958d41024
Change-Id: I1733405526764272beba63470a9bc8a958d41024
(cherry picked from commit 0d3c2e136b)
2020-05-18 11:31:53 +01:00
Paul Duffin
c5d954a48d java_sdk_library: Remove unnecessary qualification of fields
Fields in embedded structures can be accessed without qualifying them
by the type of the embedded structure.

This reduces the size of follow up changes that switch java_sdk_library
from embedding Library.

Bug: 156618935
Test: m nothing
Merged-In: I84f294c6f02d5089055130c63f5fb0538a1f21b9
Change-Id: I84f294c6f02d5089055130c63f5fb0538a1f21b9
(cherry picked from commit a18abc2a61)
2020-05-18 11:30:19 +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
Paul Duffin
dc424ffdf8 Merge "Remove unnecessary copying of common properties" into rvc-dev 2020-05-17 13:04:23 +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
f8e08b20d6 java_sdk_library: Propagate naming_scheme to snapshot
Bug: 155164730
Test: m nothing
Merged-In: Iec7c52d2102b6294540090f3c1e32bd9d8cc7da8
Change-Id: Iec7c52d2102b6294540090f3c1e32bd9d8cc7da8
(cherry picked from commit f7a6433bab)
2020-05-16 18:36:08 +01:00
Paul Duffin
d41712d365 Remove unnecessary copying of common properties
The (Soc/Device/Product/System_ext)_specific are all properties in
ModuleBase.commonProperties. Initially, they were explicitly copied
from the parent to the child. Since then the CreateModule() method
was modified to automatically copy all the commonProperties from the
parent to the child so this code is no longer necessary.

Bug: 156618935
Test: m nothing
      checked that it does not change the generated xml permissions
	  file for a java_sdk_library that sets soc_specific: true and
	  is in the vendor partition.
Merged-In: I8c985b50cb6b6c019b33a4652de482ded689fee4
Change-Id: I8c985b50cb6b6c019b33a4652de482ded689fee4
(cherry picked from commit 1dbe3ca254)
2020-05-16 17:55:23 +01:00
Martin Stjernholm
57029c07bf Include runtime-module-sdk in the SDK build.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 152255951
Merged-In: I39f9024205a198ef8ce19e2c70e3b9dced54add1
Change-Id: I39f9024205a198ef8ce19e2c70e3b9dced54add1
(cherry picked from commit 6ee5f754fe)
2020-05-16 12:14:08 +01:00
Nicolas Geoffray
36469f7121 Add conscrypt-module-host-exports to the list.
// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730

Test: build-mainline-modules.sh
Merged-In: I9ca14cc37a69b1172f52412297977dd03c6ca1a0
Change-Id: I9ca14cc37a69b1172f52412297977dd03c6ca1a0
(cherry picked from commit 0a2e297206)
2020-05-16 12:14:08 +01:00
Martin Stjernholm
f39ef8aa10 Reduce the number of Soong invocations, and various other minor script fixes.
-  We can pass all targets at once to build-aml-prebuilts.sh.
-  Less noise from build-mainline-modules.sh.
-  Default to the same out directory in both build scripts.
-  Addressed post-submit comments on https://r.android.com/1170907.
-  Various minor cleanups.

// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730

Test: build/soong/scripts/build-mainline-modules.sh
Merged-In: Id21ef80c2334462836e217032fc5bf63b7cd04e1
Change-Id: Id21ef80c2334462836e217032fc5bf63b7cd04e1
(cherry picked from commit 691503ea0b)
2020-05-16 12:14:08 +01:00
Nicolas Geoffray
168ea3d4e1 Use FORCE_BUILD_LLVM_COMPONENTS.
And remove the allow missing dependencies flag.

// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730

Test: build-mainline-modules.sh
Merged-In: I6ba8892ef66eeb42c7bd3abc989a80ad4b6a1cf9
Change-Id: I6ba8892ef66eeb42c7bd3abc989a80ad4b6a1cf9
(cherry picked from commit 7cad0f860b)
2020-05-16 12:14:08 +01:00
Nicolas Geoffray
7356fffd6d Add linux_bionic cross compilation for mainline SDKs.
ART requires linux bionic prebuilts.

Bug: 142935992
Test: build-mainline-modules.sh
Merged-In: If0f97e58d2afccbc3f5d0b2e7dabac51330cc5c7
Change-Id: If0f97e58d2afccbc3f5d0b2e7dabac51330cc5c7
(cherry picked from commit 71233e4732)
2020-05-16 12:14:08 +01:00
Nicolas Geoffray
164451c1f0 Support secondary arch for host module exports.
Bug: 142935992
Test: build-aml-prebuilts.sh generate x86 prebuilts

Merged-In: Iec4d8aa59a3ad55583c788f8ec40dd0637e7af33
Change-Id: Iec4d8aa59a3ad55583c788f8ec40dd0637e7af33
(cherry picked from commit abdc8c5501)
2020-05-16 12:14:08 +01:00
Nicolas Geoffray
270916d8ff Add a build script to compile modules and SDKs in AOSP.
Test: build-mainline-modules.sh
Bug: 142935992
Merged-In: I80a9bf8ce03d77705ba677f95b03aeb2ac2451d5
Change-Id: I80a9bf8ce03d77705ba677f95b03aeb2ac2451d5
(cherry picked from commit 90bc3cd304)
2020-05-16 12:07:03 +01:00
Martin Stjernholm
adb189529a Fix special case when appending a visibility rule to //visibility:private.
Test: m nothing
Bug: 151303681
Merged-In: Ibe7e953219e4660c653063e87cb08407a2cb513d
Change-Id: Ibe7e953219e4660c653063e87cb08407a2cb513d
(cherry picked from commit 64aeaaddef)
2020-05-16 12:07:03 +01:00
Martin Stjernholm
f8533bc636 Add explicit visibility on the self package in EffectiveVisibilityRules.
Modules in a package is implicitly visible within the same package.
When making effective visibility rules which work from another location
that visibility needs to be mentioned explicitly. In practice this
allows prebuilts to remain visible to other modules in the source
package when the prebuilts are preferred.

Test: m nothing
Test: m conscrypt-module-sdk, check that the snapshot Soong modules give
  visibility to //external/conscrypt
Bug: 151303681
Merged-In: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5
Change-Id: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5
(cherry picked from commit 0641d189d0)
2020-05-16 12:07:03 +01:00
Martin Stjernholm
68e9d96d61 Don't print :__pkg__ for package rules, since that's the default.
To reduce clutter a little.

// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730

Test: m nothing
Merged-In: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819
Change-Id: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819
(cherry picked from commit 01407c525a)
2020-05-16 12:06:54 +01:00
Anton Hansson
18a289560d Fix API lint copy command
The space after the backtick prevents it working when copy-pasting it
into the shell.

Test: create lint error => m => cp/pasted command runs successfully
Merged-In: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
Change-Id: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
(cherry picked from commit 3361a294c0)

// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730
Change-Id: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
2020-05-16 11:03:46 +00:00
Paul Duffin
c91aafb699 Merge "Replace javaLibrary with java.Dependency,android.Module" into rvc-dev 2020-05-16 07:24:18 +00:00
TreeHugger Robot
ff91b3c29a Merge "Add apex_set module." into rvc-dev 2020-05-16 02:37:39 +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
TreeHugger Robot
a91a16b484 Merge "Use system modules for prebuilt SDKs >=30" into rvc-dev 2020-05-15 23:47:29 +00:00
TreeHugger Robot
3fcdb81cf2 Merge "Don't use SDK variant for vendor JNI libraries" into rvc-dev 2020-05-15 23:45:36 +00:00
Sasha Smundak
4de27a5757 Implement android_app_set module
Bug: 152319766
Test: manual and builtin
Change-Id: Id0877476f9ae23311d92c0b59a9c568140ab4119
Merged-In: Id0877476f9ae23311d92c0b59a9c568140ab4119
2020-05-15 10:49:59 -07:00
Sasha Smundak
bbf0579ac7 Implement extract_apks
Bug: 152319766
Test: manual and builtin
Change-Id: Ia15d66e86c7bcfd52f5b776173ca1665b68ff438
Merged-In: Ia15d66e86c7bcfd52f5b776173ca1665b68ff438
2020-05-15 10:49:45 -07:00
Colin Cross
eb03296b57 Don't use SDK variant for vendor JNI libraries
Vendor JNI libraries already have stable APIs enforced by the VNDK,
they shouldn't use SDK variants.

Bug: 156225490
Test: TestJNISDK
Change-Id: I21ba67e8e9fb05016caf5888129adc1a939545c2
Merged-In: I21ba67e8e9fb05016caf5888129adc1a939545c2
(cherry picked from commit c2d24050c5)
2020-05-15 10:13:42 -07: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
Colin Cross
db22475ecb Use system modules for prebuilt SDKs >=30
Prebuilt SDKs >=30 now contain core-for-system-modules.jar,
convert them to system modules and use them when compiling against
the SDK to allow using javac -source 1.9 -target 1.9.

Bug: 117069453
Test: TestClasspath
Change-Id: Iebadad5980b952ed91c3ffd56cff1ce1827d3247
2020-05-14 19:51:31 -07:00
Kousik Kumar
459c6b25e5 Add implicit outputs to link actions
Bug: b/154733231

Change-Id: I9b6ae97f5bbfe8f9c4b9c089544a768982794f32
Merged-In: I9b6ae97f5bbfe8f9c4b9c089544a768982794f32
Test: Built the failing action with / without this change
2020-05-14 17:33:35 +00:00
Paul Duffin
0f27063a9e Correct module_lib scope name
The module_lib scope should be called module-lib in order to pick up
the latest filegroup. Without it the API lint does not use a baseline
and so reports issues with released and unchangeable APIs.

It is also needed for the correct dist path.

Test: m update-api
Bug: 155164730
Merged-In: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
Change-Id: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
(cherry picked from commit 6b836ba566)
2020-05-14 12:16:16 +01:00