Commit Graph

989 Commits

Author SHA1 Message Date
Spandan Das
e81fad3c7a Merge "Compile stubs to .dex" am: 709dbd08a0 am: bfbca5848b am: 0f9f20e2b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2503215

Change-Id: I09c3798da462c1ad09f1ce4b0de064f34130ab48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 00:27:00 +00:00
Spandan Das
709dbd08a0 Merge "Compile stubs to .dex" 2023-03-28 22:56:41 +00:00
Spandan Das
3362f1161a Merge "Update max_sdk_version from SdkSpec to ApiLevel" am: 5aade5f52d am: 8620bbd365 am: ab45f70472
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2494321

Change-Id: I8a5cdfd8bc72400954d9b5a3621ec4d832aeb421
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-28 20:11:16 +00:00
Spandan Das
5aade5f52d Merge "Update max_sdk_version from SdkSpec to ApiLevel" 2023-03-28 19:17:48 +00:00
Treehugger Robot
78da5815e2 Merge "Add apex_available aidl + aidl&lang libraries" am: 8fdb210be2 am: 67c5d36be5 am: 663faa6f80
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2507365

Change-Id: I3f3dc62bcd62e1a8901536ad4849285c00c86d50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-25 02:18:12 +00:00
Liz Kammer
2b3f56ed22 Add apex_available aidl + aidl&lang libraries
Test: b build com.android.neuralnetworks com.android.media.swcodec
Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
2023-03-24 15:14:53 -04:00
Spandan Das
1c03772aa9 Merge "Update target_sdk_version from SdkSpec to ApiLevel" am: f5d3906505 am: 569b1d2730 am: c52b576571
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2494320

Change-Id: I26868afda4e3e7b715b754b1aad48e7f6d0b6333
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-24 02:03:47 +00:00
Spandan Das
cb368ea88a Compile stubs to .dex
Although stubs are not installable on device, we need to compile .dex to
support hiddenapi metadata generation.

Bug: 271443071
Test: Built out/soong/hiddenapi/hiddenapi-stub-flags.txt with
aosp/2487266
(There is still some delta due to missing signatures in child classes)
(Will address them in a followup CL)
Change-Id: Iac1330c449934085a479c487a1489aa1695a75ee

Change-Id: I1baa9c0f45eb8fc93f5c3177389ea5a2b7ca0a0b
2023-03-23 20:41:22 +00:00
Spandan Das
a26eda7f2c Update max_sdk_version from SdkSpec to ApiLevel
max_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid max_sdk_version in bp
files

Bug: 208456999
Test: no change in ninja file (this should be a no-op)
Test: TH
Change-Id: I304b5ad802bde200137d8e225182828dfd6f7227
2023-03-23 19:38:56 +00:00
Spandan Das
ca70fc40bd Update target_sdk_version from SdkSpec to ApiLevel
target_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid target_sdk_version in bp
files

Test: m nothing
Test: no change in ninja files (this should be a no-op)
Bug: 208456999

Change-Id: I3c19245e29184bd9e5660ad8981966f64dfa9424
2023-03-23 19:31:17 +00:00
Spandan Das
7ab0894ea4 Merge "Update min_sdk_version from SdkSpec to ApiLevel" am: ddfab60014 am: f1058758db am: a14f1b45cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2503257

Change-Id: I02d90d724f78eec72e7e7d6f80c2c2d15e25e9f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-23 18:38:52 +00:00
Spandan Das
8c9ae7ed67 Update min_sdk_version from SdkSpec to ApiLevel
This relands aosp/2457063. The original change broke T and U since those
branches still contain soong modules of type (kind+level). Those soong
modules have been cleaned up now

Test: Used go/abtd to test T and U branches with this change

Bug: 208456999
Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c
2023-03-22 20:15:45 +00:00
Spandan Das
f4149e51ce Merge changes from topic "revert-2457063-EKFSKANQWZ" am: cd05792d06 am: d3d9c4ae59 am: 12992d3db9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2499159

Change-Id: I952f4fc41b91be9e3bd8145be9fe1d81abe2642c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-21 03:18:38 +00:00
Spandan Das
b74d1e1d91 Revert "Update min_sdk_version from SdkSpec to ApiLevel"
Revert submission 2457063

Reason for revert: Broken udc-dev

Reverted changes: /q/submissionid:2457063

Change-Id: Id6349fc1318877044af713c914a0afd437d3d2d5
2023-03-21 01:36:47 +00:00
Spandan Das
11524735b0 Merge changes Ie6ae7e26,I2fd822a2,Iddd497df,Iee5a936e,I628b443c am: ea93f64f03 am: 03ea4670b3 am: 235ed9f779
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2457063

Change-Id: I13484740359c98c077d7c11a0ee4043bdae0ef20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-21 01:18:46 +00:00
Spandan Das
e773739787 Update min_sdk_version from SdkSpec to ApiLevel
min_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid min_sdk_version in bp
files

Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a
followup CL

Test: m nothing
Test: no change in ninja files (this should be a no-op)
Bug: 208456999

Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
2023-03-20 16:51:32 +00:00
Alix Espino
671172b003 Merge "Create helper function for BazelTargetModuleProperties in java/android" am: 2eb2ecfec0 am: bc5cacedf5 am: 8d2b140206
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2494323

Change-Id: Ifac07263d11e8ffe155911b90428a704789a2f61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 19:05:54 +00:00
Romain Jobredeaux
5923a576fb Merge "Create an intermediate java library for every java_binary target" am: d3d2be2636 am: e9cee4bcf0 am: 2552659d92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2494319

Change-Id: Ie3d807b9d160bc8a0712ccda3f788580747becf9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 14:24:20 +00:00
Alix
3254002a7c Create helper function for BazelTargetModuleProperties in java/android
Prevents inconsistent load locations from being added for java_library,
android_library, kt_jvm_library targets that are generated in multiple
places.

Change-Id: I66ae5af137d7dff3f6fa6660dee539cf9ab22b9e
Test: go test ./bp2build
2023-03-16 21:29:01 +00:00
Romain Jobredeaux
f5f6073ff5 Create an intermediate java library for every java_binary target
We're already doing this for kotlin libraries as java_binary does not
support kotlin sources.

Change-Id: I4967b3aca21dac8e0eaf54d48cc35d57a4c4923e
2023-03-16 21:11:30 +00:00
Alix Espino
7a8eb6a09f Merge "bp2build kotlinCFlags" am: d184706daa am: 54bfcc938f am: ea66e1bd5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2486117

Change-Id: Iecf554834e09c97103b054c8726d63715e42395e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-14 20:02:17 +00:00
Alix
f848bf8225 bp2build kotlinCFlags
for java_library, java_binary, android_app & android_library

Change-Id: Ia8dec7e7d497eb41b2d8dcd8c44c3090d1d3b4bd
Bug: 271265771
Test: go test ./bp2build
2023-03-14 13:57:22 +00:00
Alix Espino
5ae61b6e2b Merge "Update load statements in java.go bp2build" am: 686df31852 am: fd11e9ee5b am: ebf4fd11e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2480297

Change-Id: I77aa18166e04c11e5197298508c0cc5bc1cc23f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-13 17:34:10 +00:00
Alix Espino
686df31852 Merge "Update load statements in java.go bp2build" 2023-03-13 15:27:15 +00:00
Alix
82acaf545f Update load statements in java.go bp2build
load statements will all now point to rules.bzl files and won't have to
be constantly updated.

Bug: 271612705
Test: CI
Change-Id: I663b9730f1b5b333682ea301ce4d9a505626faaa
2023-03-13 15:27:01 +00:00
Romain Jobredeaux
91dc849eed Merge "Call ResolveExcludes after arch-based sources computation in java.go" am: 8062140a16 am: 81771ec3d5 am: b42297540a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2478276

Change-Id: I5282958274ca012100eefb5f32e7a1e03f8db93c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-09 17:30:42 +00:00
Romain Jobredeaux
8062140a16 Merge "Call ResolveExcludes after arch-based sources computation in java.go" 2023-03-09 14:40:58 +00:00
Alix Espino
c1dd43e6e4 Merge "Created kotlinAttributes struct" am: eb33a1d474 am: f8cf202b64 am: f736aab4fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2475004

Change-Id: I5fc5c80b09dbe2904fda3f6c09605b18adc241ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-08 22:25:55 +00:00
Romain Jobredeaux
3eaf747ae5 Call ResolveExcludes after arch-based sources computation in java.go
TEST: go test
Change-Id: I93a8ae5e0842dab03f73b0edb32841755d2ea435
2023-03-08 16:34:17 -05:00
Alix
75db7840ab Created kotlinAttributes struct
makes it clearer which attributes are kotlin specific
embedded within javaCommonAttributes since both
java_* and android_* use kotlin.

Change-Id: Ib7c9b912a9901cd1c3d150ab1e0a79011d8e07de
Test: go test ./bp2build
2023-03-08 17:15:10 +00:00
Alix Espino
b0b1af3b18 Merge changes from topic "ktResourceStrip" am: 09907dab55 am: 956e77d412 am: f0dcf6eec7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2470481

Change-Id: I95dc8e8f8c60dc8e0ef268b0f5a1385d46948a72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 20:44:05 +00:00
Alix
33cbf2d461 resource_strip_prefix support for kotlin srcs am: 4d56abf937 am: 9ba68b0ba3 am: 6722869b6c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2470480

Change-Id: I5421779dd471cfc592b75fe418bb9fd2f0cca903
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 20:44:01 +00:00
Alix
5afd9fad98 code cleanup for bp2build java_binary with kt srcs
there is now support for resoure_strip_prefix in kt_jvm_library targets.

Test: built AnalyzerKt and updated go ./bp2build tests
Change-Id: I4a6fe45276d45519186b6f40a02db990511d6def
2023-03-03 23:07:51 +00:00
Alix
4d56abf937 resource_strip_prefix support for kotlin srcs
change load locations for kt_jvm_library to be the macro

Change-Id: Id50fcb1f880013fe57647a065cd6b7149d7c5d91
Test: built kotlinx_coroutines locally and compared jar file to soong
Bug: 268519061
2023-03-03 19:38:28 +00:00
Jihoon Kang
8d66f7d693 Merge "Rename output stubs jar file in java_api_library" am: ece6a80b08 am: 43c72c157a am: f8fc1d254e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2462253

Change-Id: I33e68ae4bc14bdcd608ce4ca3f78a00fe4d8c335
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 20:09:17 +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
790574484a Merge "Reland^2 "Target Java 17"" am: b0dc477ef7 am: 8fcec519ff am: a98b719472
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2438064

Change-Id: Ia819bceff5218c94e94845f6db7846fa810b1883
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 08:23:12 +00:00
Sorin Basca
b0dc477ef7 Merge "Reland^2 "Target Java 17"" 2023-03-01 06:20:20 +00: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
Spandan Das
b6761ee2ae Merge "Update usages of min_sdk_version that relies on (kind+level)" am: c8054ec6ac am: 812fc6cc23 am: f5251b022e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2457061

Change-Id: I1f922888f8f65ce23a8ceb7f7d599f413082963e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 22:02:36 +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
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
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