Commit Graph

5673 Commits

Author SHA1 Message Date
Artur Satayev
6e8071d17a Merge "Add ModuleWithMinSdkVersionCheck type." am: a4fc08d204 am: 25f5783263 am: fe55ffd190 am: 44d0ef55da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907860

Change-Id: I147da371d445f09ca2f131df1be91545eba37772
2021-12-06 18:09:34 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Spandan Das
04dcce34b8 Merge "Set targetsdkversion to future level if TARGET_BUILD_APPS is not empty" am: 16ce4801ef am: 4b669af97c am: 1bf2cb1432 am: d426e053f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907152

Change-Id: Ic84ab8e25e297cd3846ee2f32d45c5136666dd65
2021-12-03 19:07:27 +00:00
Spandan Das
16ce4801ef Merge "Set targetsdkversion to future level if TARGET_BUILD_APPS is not empty" 2021-12-03 18:08:41 +00:00
Spandan Das
e33e25b4a5 Set targetsdkversion to future level if TARGET_BUILD_APPS is not empty
manifest_fixer transforms an AndroidManifest.xml file for use in aapt2.
For TARGET_BUILD_APPS builds, set targetSdkVersion to a FutureApiLevel

Test: In build/soong, go test ./java
Test: TH

Test: In internal, TARGET_BUILD_APPS=xyz m
out/soong/.intermediates/packages/providers/MediaProvider/MediaProvider/android_common_MediaProviderGoogle_apex30/package-res.apk
&& aapt2 dump badging
out/soong/.intermediates/packages/providers/MediaProvider/MediaProvider/android_common_MediaProviderGoogle_apex30/package-res.apk
| grep targetSdkVersion # targetSdkVersion:'10000'

Test: In internal, m
out/soong/.intermediates/packages/providers/MediaProvider/MediaProvider/android_common_MediaProviderGoogle_apex30/package-res.apk
&& aapt2 dump badging
out/soong/.intermediates/packages/providers/MediaProvider/MediaProvider/android_common_MediaProviderGoogle_apex30/package-res.apk
| grep targetSdkVersion # targetSdkVersion:'Tiramisu'

Bug: 204107787

Change-Id: Ic6f21111d5a8c61ae789a7a3a001f669257a39b2
2021-12-02 19:55:25 +00:00
Artur Satayev
2d47f75955 Merge "Use textproto format for classpaths.proto generation." am: ee594919ea am: 0b97cf8828 am: 52545e6cdf am: c326bbe3f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907854

Change-Id: If30435821941c558a924adb13acb7440437c956e
2021-12-02 17:27:52 +00:00
Artur Satayev
3a06f2205c Merge changes Ieb9aef29,I6985ebb6 am: fb0a7234d7 am: 76ab9442a1 am: f258945ced am: 75c5711c9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906590

Change-Id: I00144ca1d167db5a55f666ee9815cdfa4c58cca9
2021-12-02 16:43:12 +00:00
Artur Satayev
ee594919ea Merge "Use textproto format for classpaths.proto generation." 2021-12-02 15:43:47 +00:00
Artur Satayev
fb0a7234d7 Merge changes Ieb9aef29,I6985ebb6
* changes:
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
2021-12-02 14:53:48 +00:00
Colin Cross
f69bc6307d Merge "Only get dexpreopt config for device modules" am: c01a5cd705 am: ceb543994b am: c86a100751 am: 7dfbf703ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908170

Change-Id: I5b367850ae9699e5368ba48183d60ed85e2183f0
2021-12-02 06:55:27 +00:00
Colin Cross
c01a5cd705 Merge "Only get dexpreopt config for device modules" 2021-12-02 05:28:36 +00:00
Treehugger Robot
46c2cf3f7f Merge "Adding configuration support for Java 11" am: 5e4637dc1b am: c752b88ca8 am: 5f61c406f6 am: 06cc75d578
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904230

Change-Id: I1b98110a8843097f4e1dbe894f02feb198a58cd2
2021-12-01 23:31:18 +00:00
Treehugger Robot
5e4637dc1b Merge "Adding configuration support for Java 11" 2021-12-01 22:18:41 +00:00
Colin Cross
38310bb4ac Only get dexpreopt config for device modules
Calling dexpreopt.GetGlobalConfig can return errors, move the checks
that don't depend on dexpreopt.GetGlobalConfig first to avoid
breaking all modules when the global config is invalid, for example
in a partial branch that is missing the BootProfileImages file.

Bug: 207813628
Test: tradefed branch builds
Change-Id: Id1689de3f1ef986a41a60622cb357edb9d323b8a
2021-12-01 12:32:11 -08:00
satayev
48dae67a76 Use textproto format for classpaths.proto generation.
Test: presubmit
Change-Id: I3fea94153939f05329f02091ca4fa838ee9df93f
2021-12-01 18:24:09 +00:00
satayev
cca4ab762e Propagate min and max sdk versions to classpaths.proto configs.
These attributed define a range for dessert releases where the jars
should be active, and included in corresponding CLASSPATH varibles by
derive_classpath.

Bug: 190818041
Test: presubmit
Change-Id: Ieb9aef29657ad0694d48a63019f93faca2678252
2021-12-01 17:58:41 +00:00
satayev
0a420e771a Introduce max_sdk_version device property.
Artifacts that go into apexes should only be active on certain SDK
versions. There is now a need to upper bound the range to support
expressiong statements like "this jar should only run on platforms
30-31".

Bug: 190818041
Test: presubmit
Change-Id: I6985ebb671841cdd9f0f37f916267ac5ed76e4f4
2021-12-01 17:51:22 +00:00
Jiakai Zhang
c9ff3dc68a Merge "Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb" am: 2258b889bf am: 1d7dad1f09 am: 0cb50b1036 am: 33ea009498
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1876173

Change-Id: I9c1f63b38f151fface4001dd98800488b91e6926
2021-12-01 13:13:19 +00:00
Jiakai Zhang
cee9e19a51 Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb
This CL updates platform_systemserverclasspath,
systemserverclasspath_fragment, and
prebuilt_systemserverclasspath_fragment to write entries for
STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb. A new property
`standalone_contents` is aded to `systemserverclasspath_fragment` and
`prebuilt_systemserverclasspath_fragment` to list the standalone system
server jars in the APEX, and entries will be written to
systemserverclasspath.pb accordingly at build time.

To add more context, these entries will be consumed by derive_classpath
in order to generate an environment variable
PRODUCT_STANDALONE_SYSTEM_SERVER_JARS. The environment variable will
then be comsumed by odrefresh to determine what jars to preopt on early
boot.

Note that the variable should not end with "CLASSPATH" because the list
is not used by runtime as a classpath. It is just a colon-separated list
of jars. System server loads the jars separately with paths hardcoded in
the code.

Bug: 203198541
Test: manual -
  1. Add some jars to PRODUCT_STANDALONE_SYSTEM_SERVER_JARS
  2. Add some other jars to PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
     and standalone_contents.
  3. Build an image.
  4. Flash the image to a device.
  5. adb shell echo \$STANDALONE_SYSTEMSERVER_JARS
  6. See the correct list of jars.
Change-Id: I09a6fd1d3db85c194330da9b751702a9bf069e26
2021-11-30 10:51:10 +00:00
Sorin Basca
c0244da203 Adding configuration support for Java 11
Bug: 195387073
Test: m
Change-Id: Ibf26f35b83b300acacae800f9962a00916869412
2021-11-26 17:26:33 +00:00
Treehugger Robot
d3469e639e Merge "Do not pass --compiler-filter=speed-profile with --profile-file." am: b0879c843f am: e1ce0800cf am: cf93fbabf0 am: 312313aaba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899014

Change-Id: I378c29d19c446a0b5a07228d1b67d0152b5f8202
2021-11-25 21:40:54 +00:00
Treehugger Robot
b0879c843f Merge "Do not pass --compiler-filter=speed-profile with --profile-file." 2021-11-25 20:42:31 +00:00
Pedro Loureiro
ba6682fabf 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
Merged-In: Iecf7edd6bae98c7af908d3f320f10ae4973d0396
(cherry picked from commit bde653e5fd)
2021-11-24 17:09:20 +00:00
Pedro Loureiro
c362142438 Perform validation of shared library attributes
Perform consistency checks as per http://go/updatable-shared-libraries

These include:
  * no attribute can specified can be less than T
  * max-device-sdk can't be less than min-device-sdk
  * min and max-device-sdk need to be at least the module's
  min_sdk_version
  * using on-bootclasspath-before implies that the module's
  min_sdk_version is at least T or the library has min-device-sdk of at
  least T

Test: m nothing

Bug: 191978330

Change-Id: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
Merged-In: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
(cherry picked from commit f9e584dd20)
2021-11-24 17:09:19 +00:00
Pedro Loureiro
9956e5e281 Add support for new permissions library tag attributes
We are expanding PackageManager's supported attributes and this change
enables the developer to define them in the .bp file.

Test: m nothing

Bug: 191978330

Change-Id: I01d579190fb585662086a7fc456f3b33cb89fb57
Merged-In: I01d579190fb585662086a7fc456f3b33cb89fb57
(cherry picked from commit 826863c8e0)
2021-11-24 17:09:18 +00:00
Martin Stjernholm
9fdd87d7e4 Do not pass --compiler-filter=speed-profile with --profile-file.
It is the default, and hence unnecessary to pass explicitly. This
allows some other compiler filter to be passed through BootFlags.

Test: m out/host/linux-x86/apex/art_boot_images/javalib/x86_64/boot.oat
  on master-art and check that it doesn't change
Test: m droid
  on master and check that
  out/soong/.intermediates/art/build/apex/com.android.art/android_common_com.android.art_image/image.apex/javalib/x86_64/boot.oat
  and out/target/product/vsoc_x86_64/system/framework/x86_64/boot-framework.oat
  are identical.
Bug: 174746397
Change-Id: Ie281e55aaa641d5fd8dcc5c7e201c7870cc934c1
2021-11-22 19:05:17 +00:00
Treehugger Robot
333fe8a25d Merge "Make CompOS library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" am: 07549129e2 am: 469da3abde am: 89a66bc57e am: 18a7d7a56a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1892439

Change-Id: I9fb1eb5c00a140c77f70d23ad93b3febcef98022
2021-11-22 11:36:04 +00:00
Treehugger Robot
07549129e2 Merge "Make CompOS library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" 2021-11-22 10:31:59 +00:00
Colin Cross
1a906a2ba9 Prepend header jar for sharded javac compilation am: 3d56ed5605 am: 5336a09b91 am: 287985d4c4 am: 7e793651f5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897430

Change-Id: I2fa30b976234021f8cc20c662d9470a7e4d4e889
2021-11-20 02:46:18 +00:00
Colin Cross
3d56ed5605 Prepend header jar for sharded javac compilation
When compiling without sharding javac will prefer classes built from
source over classes in the classpath.  Compiling with sharding puts
the header classes for all the sources onto the classpath, including
the sources that are not part of the current shard.  Emulate the
behavior when building without sharding by putting the header jar
first on the classpath so classes are resolved from the rest of
the sources before the real classpath.

Also switch to using the header jar without static libs dependencies
merged in, as those will already be present in the classpath.

Test: m framework-minus-apex
Test: m services.core
Test: TestSharding
Change-Id: Id11b39c15d89ce70da27d746a5c7e6b603c3c0f9
2021-11-19 21:57:21 +00:00
Colin Cross
ea52a9204c Merge changes from topic "app_set" am: 25f15a18e5 am: cf0dd40fb3 am: 80547efe96 am: 6bf007ed59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1893517

Change-Id: Idd87ffac9012edc088dbc48cbea33241a591d128
2021-11-19 03:31:26 +00:00
Colin Cross
50ed1f9ccb Install android_app_set modules in Soong
Add support for installing extra files from a zip file when installing
a primary file, and use it to support installing android_app_set modules,
which install a primary APK and then an unknown set of additional splits
APKs.

Test: app_set_test.go
Test: install test android_app_set
Bug: 204136549
Change-Id: Ia92f7e5c427adcef3bcf59c82a2f83450905c01d
2021-11-17 19:55:33 -08:00
Colin Cross
ffbcd1d8a0 Extract primary apk from apk set zip
Extract and install the primary apk normally, and then unzip the rest
of them as a post install command.

Bug: 204136549
Test: app_set_test.go
Change-Id: I17437ff27f49df6bc91bdbbea6173b46c7d3ec4e
2021-11-17 19:55:33 -08:00
Alan Stokes
bcd567ea12 Make CompOS library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS
CompOS is an optional module so it may legitimately be omitted from
some products.

Bug: 199147668
Test: Builds if PRODUCT_ISOLATED_COMPILATION_ENABLED not set
Change-Id: I4e031ca6184d920b64f9c370d35b5525ecbe8a1f
2021-11-17 15:37:14 +00:00
Treehugger Robot
ed84476875 Merge "Update platform_apis error message" am: a7f0c39214 am: 2cfe9c9686 am: df9cd7e410 am: 8aceb7e934
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1893228

Change-Id: I84cbfab1b04c0660b3d4c3a6b227e70b290090c5
2021-11-17 02:26:42 +00:00
Treehugger Robot
a7f0c39214 Merge "Update platform_apis error message" 2021-11-17 01:29:28 +00:00
Spandan Das
60999344a2 Update platform_apis error message
The updated error message is more descriptive about the incompatibility
between platform_apis and sdk_version. Implemented as per the discussion
in b/204447559#17

Test: In build/soong, run go test ./java
Bug: 204447559
Change-Id: I826f0ce47313b337f1754a1b6bc11ce65c837a41
2021-11-16 04:15:33 +00:00
Trevor Radcliffe
ae4b8d8396 Merge "Document possible values of sdk_version" am: 8dae331d4a am: e25e42957e am: f425515dcd am: d15f16139d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1882849

Change-Id: Iad992c3dd21c8fa8c4d58763aae120a6f1950968
2021-11-15 19:23:36 +00:00
Trevor Radcliffe
8dae331d4a Merge "Document possible values of sdk_version" 2021-11-15 18:28:00 +00:00
Trevor Radcliffe
347e5e4307 Document possible values of sdk_version
Fixes: 205166295
Test: Look at docs
Change-Id: Ice6cf61b8628c529dc28c3b02e83bec93e952461
2021-11-11 15:36:53 +00:00
Treehugger Robot
e558319465 Merge changes I9e38ac73,I9412147f am: 45da465ef6 am: 0a93afc2b9 am: 331599f461 am: 76df6461c5 am: 0d3522cece
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1887532

Change-Id: Ia74c51187284aad60b8e700c488a60a0083f4cfc
2021-11-11 07:35:58 +00:00
Treehugger Robot
45da465ef6 Merge changes I9e38ac73,I9412147f
* changes:
  Honor PreventInstall for APKs and dexpreopt files
  Add dependency from hostdex installed module to Make intermediates
2021-11-11 06:10:26 +00:00
Treehugger Robot
8ebb5e9b3a Merge "Dump deps for native and java to json files." am: 008d17612a am: 17550eb4a0 am: 1dde18a42c am: 4c9cb33365 am: 43d724ab16
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878094

Change-Id: Ice7462a409b063f4b8e991c00f2233ed27b72796
2021-11-11 05:57:56 +00:00
Treehugger Robot
008d17612a Merge "Dump deps for native and java to json files." 2021-11-11 04:48:16 +00:00
Colin Cross
fa9bfcd0d2 Honor PreventInstall for APKs and dexpreopt files
Native coverage builds create a second variant of APKs and set
PreventInstall on the non-coverage variant.  Skip calling
ctx.InstallFile for APKs and in dexpreopt when PreventInstall
is set.

Fixes: 205865567
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="*" NATIVE_COVERAGE_EXCLUDE_PATHS="art bionic/libc device external/compiler-rt external/clang external/llvm external/swiftshader/third_party/llvm-10.0"
Change-Id: I9e38ac737315db12475e8f9bfb3e0e7c0327fc06
2021-11-10 16:42:38 -08:00
Colin Cross
3108ce17b0 Add dependency from hostdex installed module to Make intermediates
The art tests rely on a dependency existing from
out/host/linux-x86/framework/core-oj-hostdex.jar to
out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jar,
override LOCAL_SOONG_INSTALLED_MODULE for the hostdex modules so that
soong_java_prebuilt.mk adds the dependency.

Test: art/tools/buildbot-build.sh --host && art/tools/run-libcore-tests.sh '--mode=host' '--variant=X64' --debug
Change-Id: I9412147fc66d5e5f0dae52d522868a37251f781e
2021-11-10 14:38:50 -08:00
Treehugger Robot
00d0079ecf Merge changes from topic "soong-java-install" am: 8a709b149b am: 03a3ea3885 am: 932eda33a7 am: 3a075ff1a4 am: f9fa105279
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1881031

Change-Id: I7b1a81fc24b48ef5daeec7fcd6b9d42814655013
2021-11-10 18:10:42 +00:00
Colin Cross
89ade48766 Move java module installation into Soong am: 24cc4be60b am: e2d3d87fcd am: 865a62d8ca am: 29c7bdd685 am: 74282ccf4b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880650

Change-Id: I2dc9d7245f6659953509e2e032a0d5b38ccec938
2021-11-10 18:10:40 +00:00
Colin Cross
da9b639573 Fix ctx.InstallFile calls for java modules am: 1d0eb7a9d0 am: c871fe905e am: 406461d954 am: 0978bcd3c1 am: 57c4a25fe3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880649

Change-Id: Icd21a62944d48b02d573f109deb0333ffb63da77
2021-11-10 18:10:39 +00:00
Colin Cross
9ed82bce40 Make HostJavaToolPath use pathForInstall am: ae5330a2d9 am: a8bd977845 am: e8aadabe21 am: d1d1dea4da am: abe20bc2eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880648

Change-Id: I8cebde4dfb6bb6a0714eec2ec1e3ddc492771893
2021-11-10 18:10:37 +00:00