Commit graph

6590 commits

Author SHA1 Message Date
Spandan Das
364c90773e Merge "Support two active sdks in EffectiveVersionString" 2023-03-02 00:52:12 +00:00
Spandan Das
ffb31afdac Support two active sdks in EffectiveVersionString
Currently it would return the default one even if the requested one is
an active sdk.

Bug: 270609292
Test: go test ./java
Test: built `rkpdapp` locally in internal and verified that its
targetSdkVersion is U and V
Test: TH

Change-Id: Idb03ff4786ff87fb7911bf31205941618a662404
2023-03-01 20:11:21 +00:00
Treehugger Robot
8c41eca698 Merge "Remove OWNERS access for non-build team people to core build system" 2023-03-01 19:45:38 +00:00
Cole Faust
917eb06be3 Merge "Give lint the correct api levels database for the current module" 2023-03-01 18:59:05 +00:00
Jihoon Kang
ece6a80b08 Merge "Rename output stubs jar file in java_api_library" 2023-03-01 17:18:53 +00:00
Sorin Basca
a05f0437fe Merge "Revert "Revert "Switch to use new Doclava""" 2023-03-01 17:15:25 +00:00
Sorin Basca
ae995aeef4 Revert "Revert "Switch to use new Doclava""
This reverts commit 32db73188d.

Reason for revert: Failing branches now have the updated Doclava (automerger encountered a conflict which led to build failure). Relanding.

Change-Id: Ib327e54898e97a93dd6140a65f2d7231ffd4cef3
2023-03-01 08:47:42 +00:00
Sorin Basca
b0dc477ef7 Merge "Reland^2 "Target Java 17"" 2023-03-01 06:20:20 +00:00
Cole Faust
69861aa57f Give lint the correct api levels database for the current module
Before this change, lint was always working off of the public
api database. Now, it will have the system, module-lib, or
system-server databases if the current module is compiling
against those SDKs.

This means that a lot more methods are going to start being
checked for NewApi issues.

Bug: 193460475
Test: Errorprone presubmit
Change-Id: I3eb2c617cd61554cd2a3f9d15fd40b3ec91f961d
2023-02-28 21:18:17 -08:00
Joe Onorato
442b6fc701 Remove OWNERS access for non-build team people to core build system
Test: treehugger
Change-Id: I0c318ddd7d78110327bbd849ed9aa3973c86de5d
2023-02-28 19:29:47 -08:00
Jihoon Kang
25857f5f42 Rename output stubs jar file in java_api_library
When generating framework.aidl, `android_*_stubs_current` are converted
to .aidl files (and created as targets) by replacing the extension from
`.jar` to `.aidl`.
Thus, when replacing `android_*_stubs_current` to java_api_library
modules, generating `android.jar` files leads to ninja error(multiple
rules for generating */android.aidl error).
Prevent this error by renaming the name of the artifact jar file as the
module name so that distinct-named ninja targets can be created.

Test: m
Change-Id: Iaa7248996d7bf5e7f98e1d1e2919870c3cccf5a6
2023-03-01 01:11:18 +00:00
Cole Faust
18994c73f1 Replace SortedStringKeys with SortedKeys
Now that we have generics.

Bug: 193460475
Test: presubmits
Change-Id: I1594fd8feb505175d5c09c03ef397e5ffd5b09cb
2023-02-28 16:51:32 -08:00
Cole Faust
20eed826fd Merge "Disable strict_updatability_linting" 2023-02-28 23:53:51 +00:00
Cole Faust
1021ccda6b Disable strict_updatability_linting
strict_updatability_linting currently only makes it so
that NewApi can't be added to the lint baseline.
However, since we're updating NewApi to work on a lot
more apis than before, we need to baseline many issues
across the android tree. Temporarily disable
strict_updatability_linting so that we can add these
baselines.

Bug: 193460475
Test: Presubmits
Change-Id: I8d92df95a46e9b903f0cc0e3be56f17722c50430
2023-02-28 11:31:15 -08:00
Treehugger Robot
15e6b1240e Merge "Omit "--compiler-filter" if the profile is disabled." 2023-02-28 18:53:44 +00:00
Spandan Das
c8054ec6ac Merge "Update usages of min_sdk_version that relies on (kind+level)" 2023-02-28 16:44:53 +00:00
Jiakai Zhang
63086d7af0 Omit "--compiler-filter" if the profile is disabled.
This fixes the Golem regression caused by aosp/2453067. On Golem, the
profile disabled and dex2oat uses the default "speed" compiler filter.

Bug: 269230245
Test: art/tools/golem/build-target.sh --machine-type=android-armv8 --golem=art-interpreter
Change-Id: I4fc0dbf9eac8839f7bacd264ddab177956ddd58e
2023-02-28 15:37:31 +00:00
Sorin Basca
29b20ea4a8 Merge "Revert "Switch to use new Doclava"" 2023-02-27 20:41:03 +00:00
Sorin Basca
32db73188d Revert "Switch to use new Doclava"
This reverts commit 702fb3bdc9.

Reason for revert: Build breaks in some branches

Change-Id: I3502b86d1a2e1afd6bc32e02287cd903bad7b9b2
2023-02-27 20:34:18 +00:00
Spandan Das
7fa982c0ec Update usages of min_sdk_version that relies on (kind+level)
The type of min_sdk_version is being migrated from
android.SdkSpec(kind+level) to android.ApiLevel(level). This affects
`ShouldSupportSdkVersion` for java modules. This function skips the
check for modules compiling against `core`, and that requires access to
SdkVersion and not MinSdkVersion after the migration.

Skip the check explicitly using SdkVersion.

Test: go test ./java
Test: No change in ninja file
Bug: 208456999
Change-Id: I14eca4f8e8c5d7477ded00c4fe54097323fab4a2
2023-02-27 20:03:25 +00:00
Spandan Das
0cd201c6b5 Merge "Update usages of min_sdk_version that relies on (kind+level)" 2023-02-27 18:39:11 +00:00
Spandan Das
26cfa5c70d Merge "Add documentation for target-sdk-version flag" 2023-02-27 17:49:33 +00:00
Sorin Basca
6cf6f8032e Merge "Switch to use new Doclava" 2023-02-27 16:53:45 +00:00
Spandan Das
50885c0524 Update usages of min_sdk_version that relies on (kind+level)
The type of min_sdk_version is being migrated from
android.SdkSpec(kind+level) to android.ApiLevel(level). This affects the
{min|target}-sdk-version aapt2 flag for vendor modules. For these
modules, if min_sdk_version is not set in Android.bp files,
MinSdkVersion would default to SdkVersion, and therefore would get
access to the sdkKind it was compiling against.

To accomodate the upcoming change of min_sdk_version to ApiLevel,
explicitly use SdkVersion to determine the `min-sdk-version` flags for
modules targeting `current`.

Bug: 208456999
Test: no change in ninja files (this should be a noop)
Change-Id: Ie2924698687597cdd572d4bb4c687d0b1569c4b8
2023-02-25 00:24:02 +00:00
Spandan Das
6450b555b5 Add documentation for target-sdk-version flag
This is using min_sdk_version and not target_sdk_version value from
Android.bp. Add documentation on why it has been implemented as such.

Test: N/A
Change-Id: I7da38ed351562dc530cde4c0d6bf7bd6b691f01d
2023-02-25 00:04:45 +00:00
Jiakai Zhang
3830308fb8 Generate a boot image extension for mainline BCP jars.
Bug: 269230245
Test: m
Test: atest art_standalone_dexpreopt_tests
Change-Id: I253c30d938eee2cf2549ec2338425d53956e7cbb
2023-02-24 17:14:08 +00:00
Jiakai Zhang
d49324dadb Refactor platform_bootclasspath to support multiple boot images.
Bug: 269230245
Test: m
Change-Id: I223756d5481607a82732f70c51057609ec4ee43f
2023-02-24 17:14:08 +00:00
Jiakai Zhang
8fe3a415b5 Refactor dexpreopt for boot jars to allow more complex dependencies.
After this change, the dependency hierachy can be arbitrarily deep. For
example, you can have one boot image that extends another boot image
that extends yet another boot image.

Bug: 269230245
Test: m
Change-Id: I096d0b57bda36b982ecc97378647f9c59071a3bf
2023-02-24 17:13:54 +00:00
Jiakai Zhang
5fba88bbd6 Merge "Add a new option compilerFilter to bootImageConfig." 2023-02-24 16:41:52 +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
Sorin Basca
702fb3bdc9 Switch to use new Doclava
Bug: 260694901
Test: m sdk
Change-Id: I0b7331eeca3d3e66a87ddd5c3ebf6b4debbafc22
2023-02-22 19:32:48 +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
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
Sorin Basca
be302733f6 Reland^2 "Target Java 17"
This reverts commit 91ba6c7e01.

Reason for revert: Relanding Java 17

Change-Id: I6d0e64bb86b9f4a0f41baa33c3226c6316718456
2023-02-15 17:52:27 +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
7ae8afc115 Merge "Convert RuleBuilder to static rule in buildRuleToGenerateIndex" 2023-02-15 07:27:31 +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
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
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