Commit Graph

5592 Commits

Author SHA1 Message Date
TreeHugger Robot
46679cdbf3 Merge "Allow skipping android.car-module library in PRODUCT_APEX_BOOT_JARS" 2021-11-02 17:33:20 +00:00
Mohammad Islam
71db0633af Merge "Add exemption for test_framework-apexd and test_service-apexd jars" am: 569f032a9e am: 509ceec200 am: 3890a127dd am: bd4d70075a am: 52977449a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1853102

Change-Id: Ia115e020ef5cabfcc5ca52ebb6d9ca5f935bd67f
2021-11-02 10:50:35 +00:00
Mohammad Islam
569f032a9e Merge "Add exemption for test_framework-apexd and test_service-apexd jars" 2021-11-02 08:51:01 +00:00
Colin Cross
9afbd8af53 Merge "Export Soong install rules to Make" am: 1caea35278 am: 7f5f69f9ba am: 5e5d6332b4 am: 71aa08677d am: 90c6322388
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1869552

Change-Id: Ice7d471e98038ab1268933dfd8fbf19ee96b2c3d
2021-11-01 23:04:01 +00:00
Colin Cross
1caea35278 Merge "Export Soong install rules to Make" 2021-11-01 21:31:56 +00:00
Treehugger Robot
7161156726 Merge "Create prebuilt system modules for all API scopes" am: 2bbd2c55c5 am: ef70b722db am: 2c812cb270 am: 9daf45125d am: ac37da7bae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875855

Change-Id: I44c97fccd8b530ec3e1531ab58360f9b6f30074e
2021-11-01 20:41:00 +00:00
Treehugger Robot
f2259d112e Merge changes I346ac9c0,I57352aa0 am: 57be76d9ac am: 061abc7259 am: 49753eca77 am: 086a0913aa am: 9b378e1739
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875854

Change-Id: I6e1cfe6f293ccc20f8b612e9996ca2b802289b57
2021-11-01 19:50:17 +00:00
Paul Duffin
460cbb7180 Dist API specific core-for-system-modules am: bce9f08d02 am: 381f698843 am: 9474d1a187 am: 245849abe6 am: 37ee2b187c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1873693

Change-Id: I3dce5ae019b72961b4a63fccac631d3461d20ed1
2021-11-01 17:34:19 +00:00
Paul Duffin
b077bcc6bc Create prebuilt system modules for all API scopes
Previously, system modules were only created for the public API scope.
This change creates them for any API scope as long as its directory has
a core-for-system-modules.jar.

It does that by hooking into the existing logic for creating a
java_import for all jars in the API directories and creating a
java_system_modules for every core-for-system-modules.jar file. That
avoids the need for extra path globs.

Test: m droid
      m sdk_public_current_system_modules
      - works as expected.
      m sdk_module-lib_current_system_modules
      - fails with missing target as expected.
      touch prebuilts/sdk/current/module-lib/core-for-system-modules.jar
      m sdk_module-lib_current_system_modules
      - fails with invalid jar file as expected.
Bug: 204189791
Change-Id: I27a264941009e03439d5d847dab14a7b4f6f119f
2021-11-01 16:37:49 +00:00
Paul Duffin
1cad3a53db Make prebuilt_api test environment realistic
Previously, the fixture preparer for prebuilt_apis would add a
core-for-system-modules.jar file in every API directory even though
currently they only exist in the public API directories.

This change makes the test environment more realistic by only creating
them for the public API. Rather than hard code that into the test code
(which would duplicate the hard coding in the decodeSdkDep func) this
extracts a function that is used by both. That ensures that any changes
to that func will be reflected in both the test and runtime behavior.

Bug: 204189791
Test: m nothing
Change-Id: I346ac9c0dcf407c61de16b6027663a05821bcf62
2021-11-01 16:36:23 +00:00
Paul Duffin
6d448b7a0a Add test for prebuilt_apis creation of system modules
Previously, there were no tests for this (outside uses in other tests).
This change adds a test that uses the fixture preparers that create a
prebuilt_api in order to make prebuilt APIs available. That ensures
that both the prebuilt_api is working as expected and the preparer
creates a realistic test environment.

Bug: 204189791
Test: m nothing
Change-Id: I57352aa00f7b268e5286be92f177764dd63ba7e8
2021-11-01 16:36:02 +00:00
Paul Duffin
bce9f08d02 Dist API specific core-for-system-modules
Previously, the dist only contained a core-for-system-modules.jar for
the public API. This change adds API specific directories containing a
core-for-system-modules.jar file for each of the following APIs:
* public
* module-lib

Bug: 204189791
Test: rm -fr out/dist
      m sdk dist
      find out/dist -name core-for-system-modules.jar
      - outputted the following:
      out/dist/core-for-system-modules.jar
      out/dist/system-modules/module-lib/core-for-system-modules.jar
      out/dist/system-modules/public/core-for-system-modules.jar
Change-Id: Id1845926e2085f70d58e9fc22e9c11cb3d62b919
2021-11-01 14:01:39 +00:00
Joe Onorato
a6606c49b3 Merge "Add support for java streaming proto" am: 22e973c539 am: a224d53694 am: c1ce0ed41c am: 6cc658af6b am: 14448b4d76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874416

Change-Id: I6b2c5cd34d61dbb4fa313c86c81505866d9110de
2021-11-01 01:21:53 +00:00
Joe Onorato
22e973c539 Merge "Add support for java streaming proto" 2021-11-01 00:14:59 +00:00
TreeHugger Robot
20a1c5e8c9 Merge "Fix attribute names in generated permissions.xml" 2021-10-29 23:43:46 +00:00
Colin Cross
6301c3cffa Export Soong install rules to Make
Previously Soong's install rules have been disabled when embedded
in Make (ctx.Config().KatiEnabled() == true).  The primary blocker
for moving installation into Soong has been the `required` proeprty,
which is too vague to be easily handled in Soong.  Keeping
installation in Make has resulted in two host bin directories,
the Make-owned directory (e.g. out/host/linux-x86/bin), and the
Soong-owned directory (e.g. out/soong/host/linux-x86/bin).  The
lack of knowledge in Soong about the final, Make-owned installation
location makes it hard to support NOTICE files entirely in Soong.

This patch begins to solve this problem by supporting the creation of
the installation rules into Soong, but rather than writing the rules
to the ninja file it writes them to a Makefile and lets Kati convert
them to ninja.  This allows Kati to inject extra dependencies to
handle the `required` property.

Converting all modules to create their installation rules in Soong
would be too complex, so only modules that return true from
InstallBypassMake will use the Soong installation rules.  This
is currently only set for robolectric tests.

Bug: 204136549
Test: m checkbuild
Change-Id: I28af9fa7fadece8ea1f98f5efd140c823751cae7
2021-10-29 16:34:55 -07:00
Paul Duffin
787567f779 Merge changes I88ee9709,If2ea3fde,I657fbcde,I585a8861 am: e8412c4e7a am: fed3551805 am: 2a27960bd6 am: 8daad8f988 am: cc7a0a5a1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1873694

Change-Id: I21f7c00a945b8872224e84b88733483ec1de75f7
2021-10-29 21:06:37 +00:00
Paul Duffin
e8412c4e7a Merge changes I88ee9709,If2ea3fde,I657fbcde,I585a8861
* changes:
  Use toModule for all "standard" API surfaces
  Run TestClasspath test cases with Always_use_prebuilt_sdks=true/false
  Refactor TestClasspath to simplify follow up change
  Add tests for prebuilts of all API surfaces
2021-10-29 19:41:33 +00:00
Jiakai Zhang
feaf17900a Merge "Add a build-time check for dexpreopting system server jars." am: 65947f6fc4 am: 4e5ffa8d5c am: c5ae770e62 am: ab317cfdc7 am: 544d9fe9ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840058

Change-Id: I340b1f3f2bf32d1bd9ac2b2ccc5c856648319487
2021-10-29 19:36:32 +00:00
Pedro Loureiro
bde653e5fd Fix attribute names in generated permissions.xml
Previously it would write min_device_sdk whereas the correct name should
be min-device-sdk. This happened for all shared libs attributes.

Test: m nothing
Test: manually installed an apex with a shared lib and made sure PM used
the attributes as expected

Bug: 191978330

Change-Id: Iecf7edd6bae98c7af908d3f320f10ae4973d0396
2021-10-29 18:16:42 +00:00
Jiakai Zhang
65947f6fc4 Merge "Add a build-time check for dexpreopting system server jars." 2021-10-29 18:00:51 +00:00
Paul Duffin
e9758b0415 Use toModule for all "standard" API surfaces
For the purposes of this change a standard API surface is one of the
following:
* public
* system
* test
* module-lib
* system-server

Test: m droid
Bug: 204189791
Change-Id: I88ee9709430ca455dd6c7d1523ae22f8c22b0b7e
2021-10-29 17:57:12 +01:00
Paul Duffin
132c3e61c0 Run TestClasspath test cases with Always_use_prebuilt_sdks=true/false
Previously, the TestClasspath test cases were only run with the default
setting of Always_use_prebuilt_sdks=false. That meant that some of the
code under test that depended on the setting of that variable was not
tested properly.

This change runs the test cases m with Always_use_prebuilt_sdks=true as
well. Those test cases whose behavior depends on the setting of that
variable are split into two separate test cases, each of which only
runs with the appropriate setting of that variable. All other test
cases are run for both settings of the variable.

That revealed a slight issue with the test setup (a missing
prebuilts/sdk/public/core/android.jar file) which broke the
core_current test when run with Always_use_prebuilt_sdks=true which has
also been fixed.

Bug: 204189791
Test: m nothing
Change-Id: If2ea3fde40c7573262e93691af0b5a57e4d54469
2021-10-29 17:57:12 +01:00
Paul Duffin
0b3b36a402 Refactor TestClasspath to simplify follow up change
Extracts classpathTestCase and extracts the logic for creating the test
into a separate testClasspathTestCases func.

Bug: 204189791
Test: m nothing
Change-Id: I657fbcde23a18f7f5651c174fbf17a9b7b7f1a9a
2021-10-29 17:57:12 +01:00
Paul Duffin
12e311d958 Add tests for prebuilts of all API surfaces
Previously, the tests only covered checking the sdk dependencies added
when using a prebuilt current (public) and system SDKs, i.e. with
sdk_version set to "current_30" or "system_30". This change adds tests
to cover other APIs, e.g. "test_30", "module_30" and
"system_server_30". It adds tests for "module" and "system-server" up
to API level 32 as following changes will give them different behavior
as API levels less than or equal to 31 do not have a separate
core-for-system-modules.jar file for the module-lib API.

Bug: 204189791
Test: m nothing
Change-Id: I585a88615439a24abf75250114a86113b5f5da57
2021-10-29 17:57:12 +01:00
Jiakai Zhang
0a0a2fbea9 Add a build-time check for dexpreopting system server jars.
This change adds a Soong module that stores the paths to the compilation
artifacts of system server jars in a variable, which will then be
consumed by Make to check if the artifacts are installed. When the check
fails, it means that dexpreopting is not working for some system server
jars and needs to be fixed.

Bug: 201371822
Test: m nothing
Test: manual -
  1. Add "service-permission" to DEXPREOPT_DISABLED_MODULES (https://cs.android.com/android/platform/superproject/+/master:build/make/core/product_config.mk?q=DEXPREOPT_DISABLED_MODULES)
  2. m nothing
  3. See the error:
    Missing compilation artifacts. Dexpreopting is not working for some system server jars
    Offending entries:
    system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.odex
    system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.vdex
Change-Id: I4816f19668f1dae180a34adafdbfa448c97aa0db
2021-10-29 11:55:20 +00:00
Mohammad Islam
c874504988 Merge "Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" 2021-10-29 09:40:49 +00:00
Joe Onorato
83fdc94102 Add support for java streaming proto
Test: m services with ag/15937571 applied
Bug: 199427116
Change-Id: Icf262efa015900f14d9f4cabe3b8af7ec872a668
2021-10-28 15:08:34 -07:00
Samiul Islam
7b385c5677 Add exemption for test_framework-apexd and test_service-apexd jars
For testing purpose, we need to add java libraries to bootclasspath and
systemserverclasspath that are not present in PRODUCT_APEX_BOOT_JARS and
PRODUCT_APEX_SYSTEM_SERVER_JARS.

Currently, we can't unconditionally add all the contents to the config
for test APEXs. Until a formal way is introduced, hardcoding the
artifact in the build system like how it's done for
test_framework-sdkextensions.

Bug: 187444679
Test: atest ApexTestCases
Test: atest StagedInstallInternalTest
Change-Id: I1f7b01a57bc9c46163e025de2ab00e671a42b202
2021-10-28 06:12:48 +01:00
Keun young Park
d64ab233e4 Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS
- car-frameworks-service-module is added from com.android.car.framework
  apex which only exisits in car products.

Bug: 203233647
Bug: 203201931
Test: build, bootup
Change-Id: I5f13b0505c1ac4fd2fd7b6559e080c8a6fb526e0
Merged-In: I5f13b0505c1ac4fd2fd7b6559e080c8a6fb526e0
(cherry picked from commit 6e3ba9ac3b)
2021-10-28 06:12:26 +01:00
Paul Duffin
87770b6e85 Merge "Dedup use of "prebuilt_"" am: 84e644ada0 am: 6df1c9c190 am: 28537eb8db am: 31f010f152 am: b29596972a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1870489

Change-Id: I98c4cec30615e4bfbc3ac44e8c22787025184841
2021-10-26 16:45:25 +00:00
Paul Duffin
9804da0544 Dedup use of "prebuilt_"
Bug: 177893770
Test: m nothing
Change-Id: I664ee4d9c3aafda3de0a3f8985ee23f25db38680
2021-10-26 10:43:23 +01:00
Keun-young Park
131f70c34b Merge "Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" 2021-10-19 13:52:19 +00:00
Keun young Park
5979996e64 Allow skipping android.car-module library in PRODUCT_APEX_BOOT_JARS
- The library is added to bootclass path only for car product
  through com.android.car.framework apex module
- Ignore it even if it is not in PRODUCT_APEX_BOOT_JARS for
  non-car builds

Bug: 202345178
Bug: 202896428
Test: test boot up for non-car build
Change-Id: I4ba86b4c7f4d4005add9bb5c415aed39f119af0c
2021-10-19 13:13:28 +00:00
Keun young Park
6e3ba9ac3b Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS
- car-frameworks-service-module is added from com.android.car.framework
  apex which only exisits in car products.

Bug: 203233647
Bug: 203201931
Test: build, bootup
Change-Id: I5f13b0505c1ac4fd2fd7b6559e080c8a6fb526e0
2021-10-19 00:47:47 +00:00
Colin Cross
45c494ce73 Merge changes Ifa4594ea,Ia756f309 am: d26943459d am: 9fe62908b3 am: 710f9ae1b6 am: 232c3fdbc9 am: 0af4f628f5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1861274

Change-Id: I6180d5c3477c2d209c6f3816e6a0f9662b4a5f6e
2021-10-18 23:27:10 +00:00
Colin Cross
d26943459d Merge changes Ifa4594ea,Ia756f309
* changes:
  Reduce commands per shard for java protos
  Up per-product memory usage to 30 GB
2021-10-18 22:03:43 +00:00
Colin Cross
93fa5ef99d Reduce commands per shard for java protos
`m platformprotos` with a long OUT_DIR can trigger E2BIG errors in
posixspawn, reduce the commands per shard.

Test: OUT_DIR=$PWD/really-long-out-directory m platformprotos
Change-Id: Ifa4594eac7ba0e1091df0ef75e4dfc3ff366939b
2021-10-18 10:19:03 -07:00
Jiakai Zhang
182527ce57 Merge "Extract the logic of setting Uncompress_dex to a common place." am: ae9ba1c93a am: c5e71ecc55 am: 3853562adb am: fb62fad630 am: 0a97d7bae8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1853133

Change-Id: Ie7af841b4828ecef2ba1380e2b7412f2f084d264
2021-10-15 04:41:00 +00:00
Treehugger Robot
0821b3bff7 Merge "Add android_sdk_repo_host to build platform-tools&build-tools" am: adf2b3e68f am: e89cd9f2b5 am: 57fbf57305 am: 4dc404e3bc am: de46f5cc11
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1828170

Change-Id: I36da12f89cd704d3f3174490ee7f74da2c6fd959
2021-10-15 03:39:17 +00:00
Jiakai Zhang
ae9ba1c93a Merge "Extract the logic of setting Uncompress_dex to a common place." 2021-10-15 03:30:47 +00:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Steven Moreland
ba2027d6dd Merge "Allow defaults in java_genrule modules" am: 371dc53d18 am: f11c08ab55 am: 5652357cbc am: 29481a8e42 am: c2dee33c8e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1850961

Change-Id: I3d3dd2eb4bf14b86c190c211779aef8ad6e1c874
2021-10-11 19:19:25 +00:00
Steven Moreland
371dc53d18 Merge "Allow defaults in java_genrule modules" 2021-10-11 17:47:22 +00:00
Anton Hansson
bd3b0d8a6d Merge "Update reference to merged services txt" am: 6fcddda43c am: 776a2bcb7e am: 3461a8a266 am: 1e27eb95d0 am: 46296bc360
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1850001

Change-Id: Ic43ff501a1c985926e7604750c1a79dd10aa9527
2021-10-11 17:03:50 +00:00
Anton Hansson
6fcddda43c Merge "Update reference to merged services txt" 2021-10-11 15:57:02 +00:00
Jiakai Zhang
22450f25da Extract the logic of setting Uncompress_dex to a common place.
Bug: 194150908
Test: m nothing
Change-Id: Ia33965067586cfd48183e6d17f5d17626eef3c5a
2021-10-11 03:05:20 +00:00
Colin Cross
99c3ed94b8 Allow defaults in java_genrule modules
Call InitDefaultableModule in java_genrule factories to allow
the defaults property to be used.

Bug: 202547639
Test: m checkbuild
Change-Id: I3a5960304af3e9babb30d036d63016087000d773
2021-10-08 17:52:32 -07:00
Anton Hansson
f2dffd9c04 Update reference to merged services txt
The module is changing name. Update the reference.

Bug: 169103987
Test: m
Change-Id: I1e3f05b6d9c0262adcde6881ea79df9338bb363a
2021-10-08 16:15:10 +01:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00