Commit graph

80 commits

Author SHA1 Message Date
Anton Hansson
a2adc37fc9 Make hiddenapi use prebuilt stubs when it should
Bug: 160455085
Test: build_unbundled_mainline_module.sh (with disabled source-stubs)
Test: hiddenapi_singleton_test.go
Change-Id: Id93c974351b3f8efdf8e4efe4192d3809f4fcaa5
2020-09-18 08:06:58 -07:00
Liz Kammer
88d593d942 Merge "Add hidden_api for java_import" 2020-09-14 13:57:09 +00:00
Liz Kammer
5ca3a6293e Add hidden_api for java_import
Test: go java tests
Test: m
Bug: 160455085
Change-Id: Ib6e826e32ca73ceea0799b26145ad06b1e62a1bf
2020-09-10 07:56:03 -07:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Jeongik Cha
219141c6bb Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
If BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES has a numeric value,
it replaces "current" or "system_current" with the version which
the flag indicates.

Bug: 163009188
Test: BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES=29 m, and then check if every vendor
java module's sdk_version is 29 if its sdk_version was current.

Change-Id: I17b49b8e02caf2d1bc57b91648d4420f3ad9fcb9
2020-08-27 23:09:54 +09:00
Liz Kammer
dd849a81f3 Add data_native_bins property to java_test_host
When multiple os/arch variants are supported, java_test_host could not
find a matching arch due to java having arch:common, whereas native
binaries support a specific architecture. This change adds the property
`data_native_bins` in order to support binaries with the appropriate
os/arch variants.

Test: m FirmwareDtboVerification with data_native_bins
Test: forrest
Bug: 153848038
Change-Id: I45adebff0fde2811d5ef5620c697b97b768c951f
2020-07-27 09:14:06 -07:00
Pete Gillin
84c3807b99 Enforce the legacy core/platform API restriction.
This change silently decides whether modules which depend on either
sdkPrivate or sdkCorePlatform get the legacy or the stable version of
the core/platform API, based on whether the module's name is on a
hard-coded list or not.

Test: m java
Test: make a target from the list when its entry is commented out, which correctly fails
Bug: 157640067
Change-Id: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: Iaa97ddaa015e8079fcb3426585c5101c7ec9e22a
(cherry picked from commit c0f4373106)
2020-07-23 09:06:52 +01:00
Paul Duffin
d295daa19a Ensure that sdk/module_exports depends on source members am: cee7e66b07 am: e371a18acc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359444

Change-Id: If241aea3d4997adfa1edea5e17c35b02f6bc0eb6
2020-07-09 21:58:57 +00:00
Paul Duffin
cee7e66b07 Ensure that sdk/module_exports depends on source members
Previously, preferring a prebuilt of an sdk/module_exports's member
would cause the sdk/module_exports to depend on the prebuilt instead
of the source and cause problems with the build.

This chance prevents the dependency from an sdk/module_exports to its
members from being replaced with prebuilts.

Bug: 160785918
Test: m nothing
Change-Id: Iee4bcd438c11929e30fb5766701b05a0e89956d9
2020-07-09 17:51:06 +01:00
Treehugger Robot
c4ef52f518 Merge "Prepare Soong for switch to stable core/platform API." am: 286d8f9972 am: d6bc08bdbd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1353885

Change-Id: I8785b0cf32bb45c97878500f53754012a681da51
2020-07-01 12:21:39 +00:00
Pete Gillin
40a0642385 Prepare Soong for switch to stable core/platform API.
This ensures that `m nothing` succeeds even if java/config/config.go
is changed to use `stable.core.platform.api.stubs` and
`stable-core-platform-api-stubs-system-modules` instead of the legacy
versions. (The change to stable cannot be made yet because real
targets depend on APIs only in legacy, but it is useful for the build
system to be ready for this change.)

Bug: 157640067
Test: m nothing (with and without local change mentioned above)
Change-Id: Id7562d8c592551fd0ed2b9849bcf6eb707c2a1d0
2020-07-01 11:31:30 +01:00
Paul Duffin
0c5bae5e83 java_sdk_library: Add system-server scope
Bug: 155164730
Test: m nothing
Merged-In: I49a2dab5c064b05f16691a3fae65f2b4ffc53bfd
Change-Id: I49a2dab5c064b05f16691a3fae65f2b4ffc53bfd
(cherry picked from commit 5a757b1ebb)
2020-06-15 15:02:19 +01:00
Colin Cross
300b266264 resolve merge conflicts of a73ffc21e0 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: Ie8ad8a9e91bf4a86c90060b15dc88f9860539637
2020-06-11 12:12:30 -07:00
Paul Duffin
01c577968a Merge "java_sdk_library: Add system-server scope" into rvc-dev am: 4754d4451c
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11705588

Change-Id: I6c2a7000cf7b46dcef8ed476d6e96ffc7e441ed4
2020-06-10 13:12:51 +00:00
Colin Cross
238c1f3903 Remove most paths from java.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove most of them from
java.TestConfig.  Leave a few that are globbed by lots of tests,
and move a few that are globbed by a single test into the tests.

Test: all soong tests
Change-Id: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
2020-06-09 14:38:39 -07:00
Paul Duffin
5a757b1ebb java_sdk_library: Add system-server scope
Bug: 155164730
Test: m nothing
Change-Id: I49a2dab5c064b05f16691a3fae65f2b4ffc53bfd
2020-06-08 15:27:58 +01:00
Pete Gillin
1f41dbff64 Split the core/platform API into stable and legacy versions.
For now, everything outside libcore still uses the legacy version.

Test: treehugger
Bug: 157640067
Change-Id: If5234e9ee533ff537926801a0af045d36b1caf01
2020-06-08 10:53:51 +01:00
Ulya Trafimovich
c9af538c90 Add android.test.base to class loader context for API version < 30.
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id2ece4b2a6317998e1dd177e853848cc3956f39f
2020-06-01 12:51:38 +01:00
Anton Hansson
c9cc20cbe8 Revert "Default annotations_enabled to true for sdk_library"
This reverts commit a9a3173ee3.

Bug: 157010342
Reason for revert: broke ike
Exempt-From-Owner-Approval: clean revert
Change-Id: I592f50d0263ce78ea6d0d335cc7e0f493fcff800
2020-05-25 09:49:48 +00:00
Anton Hansson
a9a3173ee3 Default annotations_enabled to true for sdk_library
This turns out retention of Nullable annotations, which is almost
certainly what every user wants. Also add the "stub-annotations" lib to
the stub libs property, to make sure the nullability annotations
resolve properly.

Bug: 157010342
Test: m
Change-Id: I905144add4ef6f85445eedd1ba5169445f6005e0
2020-05-21 13:36:49 +01:00
Colin Cross
49e94c0a92 Merge "Use system modules for prebuilt SDKs >=30" 2020-05-18 19:02:43 +00:00
Colin Cross
17dec171b4 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
Merged-In: Iebadad5980b952ed91c3ffd56cff1ce1827d3247
2020-05-15 17:21:58 -07:00
TreeHugger Robot
a91a16b484 Merge "Use system modules for prebuilt SDKs >=30" into rvc-dev 2020-05-15 23:47:29 +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
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
Sasha Smundak
a7856c0077 Implement android_app_set module
Bug: 152319766
Test: manual and builtin
Change-Id: Id0877476f9ae23311d92c0b59a9c568140ab4119
2020-05-14 19:01:11 -07:00
Liz Kammer
e2b27f473f Add signing certificate lineage support to soong
(This is a cherry pick.)

Test: app_test
Bug: 153366049
Merged-In: I65a92d6c40057dcc01950991fb7be485de1c9080
Change-Id: I65a92d6c40057dcc01950991fb7be485de1c9080
2020-05-13 14:30:53 -07:00
Liz Kammer
70dd74dde7 Add signing certificate lineage support to soong
Test: app_test
Bug: 153366049

Change-Id: I65a92d6c40057dcc01950991fb7be485de1c9080
2020-05-08 09:50:42 -07:00
Anton Hansson
f6aead085c Merge "Make system_server stubs consistent with other stubs" 2020-03-25 14:18:32 +00:00
Anton Hansson
ba6ab2e791 Make system_server stubs consistent with other stubs
Include the module_api stubs in system_server one instead of
putting both of these jars on the classpath. Also rename it
to be in line with the other stubs.

Bug: 149293194
Test: m
Exempt-From-Owner-Approval: approved internally
Change-Id: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e
Merged-In: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e
(cherry picked from commit bbd78556da)
2020-03-25 14:18:02 +00:00
Jiyong Park
19604de13e add aidl.export_include_dirs to java_import module type
This allows a java prebuilt to export AIDL files to its clients.

Bug: 151933053
Test: m
Change-Id: I21b5d5ce647141a7c76f62490adbccb858b10323
2020-03-24 16:44:11 +09:00
Anton Hansson
bbd78556da Make system_server stubs consistent with other stubs
Include the module_api stubs in system_server one instead of
putting both of these jars on the classpath. Also rename it
to be in line with the other stubs.

Bug: 149293194
Test: m
Change-Id: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e
2020-03-19 17:42:59 +00:00
Colin Cross
f28329de73 Move NDK test modules into cc/testing.go
Move the NDK modules defined in app_test.go into cc/testing.go in
preparation for using sdk_version: "current" in more tests.

Test: all soong tests
Change-Id: I80bc31225fb4562fce42781219cefbbd6affae06
2020-02-19 18:59:15 -08:00
Jiyong Park
aae9bd11c2 sdk_version: "system_server_current"
The new sdk version "system_server_current" is for system server
components that needs to use all public APIs, system APIs, module APIs,
and the system server APIs.

Bug: 146757305
Test: m
Change-Id: I24fd5af010532a110393676607dc90889f2ec17e
2020-02-12 04:36:43 +09:00
Treehugger Robot
c4930248c4 Merge "sdk_version: "module_current" is supported" 2020-02-06 03:50:43 +00:00
Jaewoong Jung
387ad5c576 Merge "Add rules to handle asset resources." 2020-02-05 22:24:39 +00:00
Paul Duffin
a2db18fb1e java_sdk_library use prebuilt jars for numeric sdk_version
Previously, when a library that used a numeric sdk version also
referenced a java_sdk_library it would use the current version of its
API. That was dangerous as there is an expectation that an app building
against a numbered version will also be targeted at that version and
so building against a later version of the API could hide runtime
incompatibilities.

This change will use prebuilt versions of the java_sdk_library's api
when being built for a numbered sdk version.

Bug: 148080325
Test: m droid
Change-Id: I3fd416553950785a443c1702e495a96debc33331
2020-02-04 14:47:04 +00:00
Paul Duffin
56d4490d59 java_sdk_library_import - expose system and test stubs
Previously, the java_sdk_library_import only exposed the public stubs.
This change adds support for exposing system and test stubs too by adding
separate structures for public, system and test scopes. The existing
properties are kept for legacy reasons (and because libs can be common
across the differents scopes).

It extracts some code that is common to both sdk library and sdk
library import.

The legacy support will be removed in a future change once all existing
usages have been switched over.

Bug: 148080325
Test: m droid
      TARGET_BUILD_APPS=Camera2 m
Change-Id: I0b26cc8af9ee044437ff3b80c1eca611816b9386
2020-02-03 15:58:08 +00:00
Jiyong Park
50146e9c8e sdk_version: "module_current" is supported
module_* is a new API surface for OS modules (e.g. APEXes). It has
slightly bigger API surface than the system_* SDK. Specifically, APIs
with @SystemApi(client=MODULE_LIBRARIES) are added there.

Bug: 146757305
Test: m

Change-Id: I8980e50c0e3a4cd843048e0de1f638e854384f46
2020-01-31 23:01:34 +09:00
Jaewoong Jung
6431ca7a3a Add rules to handle asset resources.
AAPT2 ignores assets in overlay resource inputs, so separate rules are
required to extract and merge assets from dependencies.

Test: app_test.go
Test: Added assets to Settings-core for testing
Test: Confirmed Settings.apk contains them with this change.
Fixes: 146655310
Change-Id: Iab8bc61b719541dae64f0e3502bc9cb45a353687
2020-01-16 12:19:49 -08:00
Jiyong Park
2fbf47f0c2 Remove unused system_modules
With
https://android-review.googlesource.com/c/platform/build/soong/+/1145829,
android_*stubs_current_system_modules are no longer used. Thus removing.

Bug: 142896162
Test: m checkbuild
Change-Id: Icb8ea48f9bdb73f780cd9bdacf4c111ca7b7cd9e
2020-01-03 14:16:22 +09:00
Paul Duffin
1b82e6a108 Add support for java_test in sdk
Adds java_test_import module type for use by the sdk snapshot and
adds java_tests property to the sdk and sdk_snapshot module type.

This is needed for the conscrypt test sdk.

Bug: 143678475
Test: m nothing
Change-Id: Ied4c56c978dac2f92a9b3bc34b3235d7eeba2fd3
2019-12-31 15:08:59 +00:00
Jiyong Park
f3273c5587 Merge "Add updatable_media_stub to framework" 2019-12-19 18:04:54 +00:00
Jiyong Park
231d056d50 Add updatable_media_stub to framework
The module framework is now a build-only library whose purpose is to
provide hidden APIs from the non-updatable part of the platform and APIs
from the modules. Merging updatable_media_stub to framework, like the
stub libraries from other modules.

As a result, updatable_media_stub can be removed from DefaultLibraries.

Bug: N/A
Test: m

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

Merged-In: I7f80716119ad6ac627e5666def9fe17112dcde3b
(cherry picked from commit 4c258d282b)
Change-Id: I7f80716119ad6ac627e5666def9fe17112dcde3b
2019-12-19 11:57:47 +09:00
Colin Cross
98be1bb00f Move filesystem into Config
The filesystem object was available through ModuleContext.Fs(), but
gives too much access to the filesystem without enforicing correct
dependencies.  In order to support sandboxing the soong_build
process move the filesystem into the Config.  The next change will
make it private.

Bug: 146437378
Test: all Soong tests
Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-12-18 08:19:10 -08:00
Paul Duffin
2e3e5e3e76 Remove unused core-system-modules
Soong tests no longer need to define a dummy version of this.

Test: m checkbuild
Bug: 141613583
Change-Id: Iad12560aedc74a499808bd52d9ea09ab0d68d743
2019-09-27 10:38:06 +01:00
Paul Duffin
68289b0efd Add custom SystemModules to bootclasspath to reduce duplication
Adds a library dependency to each of the dummy system modules created
by testing.go so that any changes in the behavior were detected by
the existing tests which were then fixed.

Bug: 141359858
Test: m checkbuild
Change-Id: Id4442f4aa3931ac93049f3367b96a5b49cc075e1
2019-09-20 14:52:56 +01:00
Paul Duffin
b3438891a0 Merge changes I42cb181f,I6413c9b1 am: 33ee25466f
am: 00c2bbb0e7

Change-Id: Icca90608b256e726a9a1bd79e9cedca1a6b53f84
2019-06-17 15:25:30 -07:00
Paul Duffin
50c217c744 Add sdk_version:"core_platform" to replace no_framework_libs:true
Where possible this duplicates any tests that use no_framework_libs:true
with ones that use sdk_version:"core_platform". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"core_platform" to ensure that there is no regression in the
behavior of no_framework_libs:true.

Follow up changes will switch all usages of no_framework_libs:true over
to use sdk_version:"core_platform" at which point no_framework_libs will be
removed.

Bug: 134566750
Test: m droid

Change-Id: I42cb181f628b723c8f32a158ae4752b4c83365ae
2019-06-17 13:17:35 +01:00
Paul Duffin
a3d0986cfc Remove the no_standard_libs property
Corrects an error message that refers to no_standard_libs.

Removes any tests that use no_standard_libs:true where possible as
there are duplicate tests for sdk_version:"none". Otherwise, switches
them over to use sdk_version:"none".

The androidmk mapping from LOCAL_NO_STANDARD_LIBRARIES to
no_standard_libs has also been removed. There was little point in
updating the tool to map it through to sdk_version:"none" as there are
only a couple of places where it is used, in art's test running mk
targets and in some unbundled packages to work around some limitation
in .mk based build.

Bug: 134566750
Test: m droid
Change-Id: I6413c9b1fe3e63b93753a6a017d2981e32b7e013
2019-06-17 11:21:39 +01:00