Commit Graph

6571 Commits

Author SHA1 Message Date
Jiakai Zhang
e700c811f7 Merge "Add a new option compilerFilter to bootImageConfig." am: 5fba88bbd6 am: 0cede10365 am: e3eb6117b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2453067

Change-Id: I474f0b0151b29f41879f86af7f7a2d31284307fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 21:59:14 +00:00
Jiakai Zhang
5fba88bbd6 Merge "Add a new option compilerFilter to bootImageConfig." 2023-02-24 16:41:52 +00:00
Treehugger Robot
467ad6c228 Merge "Revert "Revert "R8/D8 should use sdk_version prop to determine API surface stability.""" am: de1d5bc90c am: 0f03b25ba5 am: 962f77aec3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2452286

Change-Id: I8709d90c9e65dd07a8d5a62f7ef597497ea28c71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 02:08:05 +00:00
Alix Espino
e87015ded2 Merge "temporary unblock for builds using sdkSystem" am: 8393a0fcdc am: c14ab51f39 am: c23361a187
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2448142

Change-Id: I328ade676de530c6f1ac9cc722d4791c13f0b039
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 02:05:38 +00:00
Treehugger Robot
de1d5bc90c Merge "Revert "Revert "R8/D8 should use sdk_version prop to determine API surface stability.""" 2023-02-23 21:39:49 +00:00
Spandan Das
c404cc79e9 Revert "Revert "R8/D8 should use sdk_version prop to determine API surface stability.""
This reverts commit 7eb9243fa7.

Reason for revert: The original change was reverted since it was suspected to cause missing libc++.so errors. It was a red herring, and the root cause has been fixed now b/264588525

Change-Id: Ib9110c41bacf220b91f24de11589f63235895e56
2023-02-23 18:05:05 +00:00
Jiakai Zhang
8e9ea8bb83 Add a new option compilerFilter to bootImageConfig.
After this change, the compiler filter can be specified by the option,
and profiles will not be used if the compiler filter is not
a profile-guided one.

This change also allows preloadedClassesFile to be empty.

Bug: 269230245
Test: m
Change-Id: I65e6b7209d2f0510bcc784a62623ab402b7f96bb
2023-02-23 17:50:46 +00:00
Alix
79f853d7b9 temporary unblock for builds using sdkSystem
Bug: 215230098
Change-Id: I521342c676f3362d3e1db0aab7924a04602525e1
Test:  built captiveportal-lib and inspected BUILD file
2023-02-21 17:01:16 +00:00
Treehugger Robot
c9201f172b Merge changes I55a5a295,I9c09451d,I05177388 am: c004bf3b7e am: 766f6ac1c3 am: a78d49303f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2426452

Change-Id: I9b02faeffca703d7806640b3ccba7c2ba9a0a047
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-16 16:41:48 +00:00
Treehugger Robot
c004bf3b7e Merge changes I55a5a295,I9c09451d,I05177388
* changes:
  Use the profiles in the APEX to dexpreopt system server jars.
  Add tests for the ignored "profile_guided: true" property.
  Output dex_preopt to SDK snapshot.
2023-02-16 14:46:19 +00:00
Jiakai Zhang
81e468171f Use the profiles in the APEX to dexpreopt system server jars.
After this change, if "profile_guided: true" is set, profile-guided
compilation will be enabled for the jar and the ".prof" file next to
the jar in the APEX ("javalib/<name>.jar.prof") will be used as the
profile when dexpreopting for the prebuilt APEX.

Bug: 241823638
Test: m nothing
Test: -
  1. (on internal master) Patch aosp/2426453.
  2. Build the APEX bundle and the module SDK of com.android.wifi
  3. (on tm-dev) Patch this CL and aosp/2141972.
  4. Copy the APEX bundle and the module SDK built on step 2 to the
     source tree
  5. Disable hiddenapi check
  6. lunch cf_x86_64_phone-userdebug && m MODULE_BUILD_FROM_SOURCE=false com.google.android.wifi
  7. cat out/soong/.intermediates/prebuilts/module_sdk/Wifi/current/prebuilt_service-wifi/android_common_com.android.wifi/dexpreopt/oat/x86_64/javalib.invocation
  8. See the profile being used.
Change-Id: I55a5a295e9c5d6f0564afb139c5fb7da91ab8cae
2023-02-15 22:47:24 +00:00
Jiakai Zhang
9c4dc19f4e Output dex_preopt to SDK snapshot.
This is needed to determine whether we need to deapex the profile or
not.

Bug: 241823638
Test: m nothing
Test: -
  1. Patch ag/20582608 PS2.
  2. TARGET_BUILD_APPS=com.android.wifi packages/modules/common/build/mainline_modules_sdks.sh
  3. See the `dex_preopt` property being written.
Change-Id: I05177388c24be1ab315247ea85e7e3a8600cebd3
2023-02-15 22:47:23 +00:00
Jihoon Kang
3a91c02209 Merge "Add static_libs property in java_api_library soong module" am: 61e09756c2 am: f2deb3cb1f am: 41ea80e148
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2436213

Change-Id: I29b765c90496313973f3744885f7bd48253f3052
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 19:38:37 +00:00
Jihoon Kang
61e09756c2 Merge "Add static_libs property in java_api_library soong module" 2023-02-15 17:48:00 +00:00
Cole Faust
e1ef79f030 Merge "Convert RuleBuilder to static rule in buildRuleToGenerateIndex" am: 7ae8afc115 am: b1706744f3 am: 41bda3ee00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2436674

Change-Id: I83e4f2a298d14df68618b8be4ebd40189960b16c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 10:08:47 +00:00
Cole Faust
7ae8afc115 Merge "Convert RuleBuilder to static rule in buildRuleToGenerateIndex" 2023-02-15 07:27:31 +00:00
Zi Wang
7f5bea9842 Merge "Add limited bp2build converter of java_sdk_library" am: c451830446 am: 2da9f46ee8 am: 0d2eba6910
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2411046

Change-Id: Ic0652f224b85b77cd43fa91efbfc34168299dd7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 05:17:50 +00:00
Zi Wang
c451830446 Merge "Add limited bp2build converter of java_sdk_library" 2023-02-15 02:32:48 +00:00
Cole Faust
a5f64f0396 Convert RuleBuilder to static rule in buildRuleToGenerateIndex
This saves ~34kb from the build.ninja file.

Test: Presubmits
Change-Id: I8fa4974e4f1509be7938c774e536d15a63534753
2023-02-14 17:50:31 -08:00
Yike Zhang
17b39718e8 Merge "Set test config of Robolectric tests to LOCAL_FULL_TEST_CONFIG" am: bbfe9480be am: 1a6ec80b34 am: 75e9588d8d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2434852

Change-Id: I377644d0269ddee6d9938b91f6c5710987c9c555
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 01:32:03 +00:00
Julien Desprez
e6267b68b8 Merge "Revert "Reland "Target Java 17""" am: 4d3f11ccb3 am: 212860594e am: 29b58a6dab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2435953

Change-Id: Ic589a5de90db628f9f5a35d12518dcc19df1694c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 01:31:46 +00:00
Jihoon Kang
e30fff0b5c Add static_libs property in java_api_library soong module
Package private stub annotations are not part of any API surfaces, but
are included in the `android_<API_SURFACE_NAME>_stubs_current`. Since
these cannot be included in the java_api_library by api_contributions,
add static_libs property to statically include jars in the output jar
file.

Test: m
Change-Id: Icb4401f29079ba32df4c192943a7e8814599d9ba
2023-02-15 00:27:18 +00:00
Yike Zhang
bbfe9480be Merge "Set test config of Robolectric tests to LOCAL_FULL_TEST_CONFIG" 2023-02-14 23:30:39 +00:00
Julien Desprez
4d3f11ccb3 Merge "Revert "Reland "Target Java 17""" 2023-02-14 22:21:26 +00:00
Zi Wang
b2179e397a Add limited bp2build converter of java_sdk_library
Only public, system, test, module_lib and system_server are
converted in order to generate api_fingerprint.txt in Bazel.

Test: java_sdk_library_conversion_test.go and TH

Bug: 266973526
Change-Id: I67a00806165e5afad3876b6cd5cdbc6b0dd65d8b
2023-02-14 13:21:21 -08:00
Julien Desprez
91ba6c7e01 Revert "Reland "Target Java 17""
This reverts commit 1fbf7f21a4.

Reason for revert: broke docker image, pinning is incomplete it seems

Change-Id: I7102cb233a4fe5ce0f5a1ead98cfc661c3d82ce5
2023-02-14 20:26:31 +00:00
Yike
0fcf90a357 Set test config of Robolectric tests to LOCAL_FULL_TEST_CONFIG
Downstream infra needs this information to determine if a module is
testable to TradeFed.

Test: m out/target/product/coral/module-info.json
Bug: 268670243
Change-Id: Ibdf99c86cb6abe726552a6e4ffbdc756f751907b
2023-02-15 03:18:55 +08:00
TreeHugger Robot
a9713395a1 Merge "Fix Soong code, remove dead code, and clean up code for Java fuzz Test: built fuzz targets locally and tested them with Jazzer" 2023-02-14 18:23:19 +00:00
Cory Barker
fdf043a7b1 Fix Soong code, remove dead code, and clean up code for Java fuzz
Test: built fuzz targets locally and tested them with Jazzer

Change-Id: I3ff487ba4e34289e0f53f2077463f524f4bf4f11
2023-02-14 08:59:23 +00:00
Seth Moore
bc6dc9f546 Merge "Allow android tests to specify a mainline package name" 2023-02-09 15:43:08 +00:00
Ajinkya Chalke
a9728cfa39 Merge "Revert "Don't ignore R8 warnings for optimized targets"" 2023-02-09 14:37:38 +00:00
Sorin Basca
f96b899f59 Merge "Reland "Target Java 17"" 2023-02-09 14:12:14 +00:00
Ajinkya Chalke
ddad41b912 Revert "Don't ignore R8 warnings for optimized targets"
This reverts commit 5c2a1f3bda.

Reason for revert: This change is causing the build to break, see http://b/268404998

Change-Id: I9173d1aa42846831123273ef7651940f2b0d6608
2023-02-09 14:09:58 +00:00
Seth Moore
c6f4b532f3 Allow android tests to specify a mainline package name
Tests that run against mainline modules generally need to be built
twice: once for aosp (unsigned) and once for internal (signed).
The override_android_test rule is really useful for generating a
signed version of the unsigned test.

However, mainline tests need to use a MainlineTestModuleController
to only run tests on targets with the expected module. Since unsigned
and signed mainline modules have different package names, this means
the test config needs to be updated when overriding a test.

Add a new "mainline_package_name" argument so that android test rules
can update the targeted mainline package. Without this, the only way
to create a mainline package test is to instead use android_test, which
results in a lot of copy-pasta.

Test: added tests to soong
Test: manual, using a locally-modified RkpdAppUnitTest
Test: test_config_fixer_test.py
Change-Id: Idaffd63f225719a2bfda41018fda630b17db0080
2023-02-08 12:38:50 -08:00
Treehugger Robot
aa97f1dc6b Merge "Don't ignore R8 warnings for optimized targets" 2023-02-08 20:15:37 +00:00
Jiakai Zhang
3317ce725d Install system server jar profiles into the APEX.
After this change, if profile-guided compilation is enabled for an APEX
system server jar, the profile will be installed next to the jar with
the ".prof" suffix, ("javalib/<name>.jar.prof"). This file will later be
used by odrefresh and dexpreopt from prebuilt APEX.

Bug: 241823638
Test: m nothing
Test: -
  1. Patch ag/20581649 PS2.
  2. banchan com.android.btservices x86_64 && m
  3. Check that "javalib/service-bluetooth.jar.prof" exists in the APEX.
Change-Id: Ibcfc6257dade92bd40a6d4b7368148717d0863b9
2023-02-08 19:25:37 +08:00
Jared Duke
5c2a1f3bda Don't ignore R8 warnings for optimized targets
Ideally we'd stop ignoring warnings entirely, but this helps de-risk
optimized targets that may be more sensitive to side effects from
suppressing such warnings.

Test: m
Bug: 215530220
Change-Id: Iccd124a347d55cd8f9474ebca7e41eca27882066
2023-02-07 15:37:53 -08:00
Jihoon Kang
d48abd566b Call hook in java_sdk_library after droidstubs generation
Currently, droidstubs module create java_api_contribution module, but
when a java_sdk_library module dynamically creates a droidstubs module,
java_api_contribution is not created as the hook inside droidstubs get
lost. Therefore, call hook inside sdk_library after creating the
droidstubs module.

Test: m
Change-Id: I68bf1d796f6f9a6f81011ae35e4991b6ed1421ea
2023-02-07 18:45:38 +00:00
Alix Espino
ade518ad6e Merge "refactor android_app bp2build" 2023-02-06 19:13:02 +00:00
Jihoon Kang
800f64078c Merge "Prevent dynamically created java_api_contribution from inheriting parent modules' visibility" 2023-02-06 17:31:10 +00:00
Alix
733110e745 refactor android_app bp2build
Test: bp2build tests and locally built MusicKotlin
Change-Id: Ia5a58b26717a0252e3ae87ea68182e6f2b5c60cf
2023-02-06 15:39:16 +00:00
Jihoon Kang
42b589cd61 Prevent dynamically created java_api_contribution from inheriting
parent modules' visibility

By default, dynamically created module inherits the parent module's
visibility. When the parent module's visibility is set to
"//visibility:private" or has any other specified visibility
restrictions in the module definition,  the created
java_api_contribution module is not visible to java_api_library.
Thus, override any inherited visibility properties and set the visiblity
of the created java_api_contribution module to public.

Test: m
Change-Id: I5db60a5a1800e2ae28c9650eeb9a2f1c3b4f8989
2023-02-04 00:29:33 +00:00
Sorin Basca
1fbf7f21a4 Reland "Target Java 17"
This reverts commit 384250c7c4.

Reason for revert: Relanding the feature.

Bug: 233029164
Change-Id: Ib66deabbf6e9604798c70edaf581f46db848e6ca
2023-02-03 18:20:03 +00:00
Treehugger Robot
69ef681c13 Merge "bp2build kt for android_binary" 2023-02-02 23:34:59 +00:00
Alix
0856f9e227 bp2build kt for android_binary
Test: bp2build tests and locally built MusicKotlin
   (cannot allowlist yet due to soong/bazel custom_package differences)
Change-Id: I1cbd0fe2af0e6eeed65cf8d57dc85c1f54646c50
2023-02-02 20:26:01 +00:00
Kelvin Zhang
d60722c204 Merge "Revert "Target Java 17"" 2023-02-02 18:51:26 +00:00
Sorin Basca
384250c7c4 Revert "Target Java 17"
This reverts commit d6be9e51ca.

Reason for revert: b/267608166.

Change-Id: Ie07caa5ace3bcb290829e6fa476c5e1d47b975ba
Fixed: 267608166
2023-02-02 17:56:19 +00:00
Sorin Basca
24bfad66be Merge "Use a stub doclet instead of Doclava" 2023-02-02 11:38:32 +00:00
Sorin Basca
ac9938dddc Merge "Target Java 17" 2023-02-02 11:38:32 +00:00
Treehugger Robot
fd659ef7da Merge "Remove R8-specific flags from soong config" 2023-02-01 17:18:42 +00:00