Commit Graph

7964 Commits

Author SHA1 Message Date
Alix
289e9c607b support for multiple filegroups and resource_dirs
Test: tests in bp2build and b build //external/emma:emma

Change-Id: I57e60389aec926c55d01818a6a3b1ec33e9c53b8
2023-08-25 16:12:15 +00:00
Ian Zerny
c26029b473 Translate SDK level 10000 to a valid compiler min-api
Targets with the special level 10000 are compiled using the current
platform SDK level. They are also compiled as a "platform build" which
will disable features such as API modeling and method backports.

Bug: 295591477
Test: manual inspection of the updated build commands
Change-Id: Ifda8859396b33dde4c46a9b212ddb855b012bf07
2023-08-25 13:48:21 +02:00
Spandan Das
e8a90c57e0 Handle proto.include_dirs for java
The proto_library(s) created for include_dirs will be added to
transitive_deps

This also fixes an existing bug for java_library containing .protos in
srcs via filegroups.
```
java_library {
  name: "foo",
  srcs: ["foo.proto", "foo_filegroup"],
}
```

At ToT, foo_filegroup was missing from the equivalent proto_library in
bp2build workspace.

Bug: 285140726
Test: allowlisted pandora-proto-java and built that
Change-Id: I2657d8cdef2e47434bc3e0d09a074c8e27299afc
2023-08-24 19:21:10 +00:00
Mark White
82831c0c25 Merge changes from topic "empty-framework-location" into main
* changes:
  Created empty framework-location non-updatable module
  java_library support for building headers-only
2023-08-23 17:25:39 +00:00
Mark White
6aac22ac49 Merge "java_library support for building headers-only" into main am: 03fe33ad1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2721996

Change-Id: Iadd049c8516dc54027e897c23f9d0d2ea3135e96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-23 15:24:18 +00:00
Mark White
03fe33ad1c Merge "java_library support for building headers-only" into main 2023-08-23 15:03:21 +00:00
Mark White
a15790ac1e java_library support for building headers-only
Flag for java_library modules to build just the Turbine headers and
skip building an impl jar.

Test: go test java
Bug: 289776578
Change-Id: Iad0babf951710476bc32df93c25d17065a14ab84
2023-08-22 21:29:05 +00:00
Treehugger Robot
57b385508a Merge changes from topic "aconfig_framework_circle" into main am: a9dbd27afa am: a8a24d90dc am: 603a5b7415 am: 2ad90706b3 am: d353ab3f60
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2717352

Change-Id: I7d2635bfb390f4e8bca60dce74d4b6ef1f38f894
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21 19:24:46 +00:00
Joe Onorato
c807d043d0 Allow access to the generated srcjars for GeneratedJavaLibrary am: ffac9be887 am: 4eff29bafc am: 3e6bc32eb4 am: 532a227e15 am: 4cc0171807
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2717351

Change-Id: I5bdc5f1d3467a2f9c729cc56080551371aaa945c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21 19:24:43 +00:00
Treehugger Robot
a8a24d90dc Merge changes from topic "aconfig_framework_circle" into main am: a9dbd27afa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2717352

Change-Id: Ie41f1a066b9d164047d61a50375a9981c95e4463
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21 17:09:16 +00:00
Joe Onorato
4eff29bafc Allow access to the generated srcjars for GeneratedJavaLibrary am: ffac9be887
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2717351

Change-Id: Ib1b3f486ab23e67dc13a9a8b163a1879654610ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21 17:09:13 +00:00
Joe Onorato
9e3716caea Allow generated java libs to specify libraries.
Not having them before was just being conservative, and now libs at
least is needed.

Bug: 293195086
Test: m
Change-Id: Ieaa66d11fc983751fd302a21e17802748a535fa7
2023-08-20 07:41:31 -07:00
Joe Onorato
ffac9be887 Allow access to the generated srcjars for GeneratedJavaLibrary
Bug: 293195086
Test: m
Change-Id: I42cf0238241314376f5fe0091cde9bef196f4b9d
2023-08-20 07:41:17 -07:00
Treehugger Robot
2444405e7a Merge "export_proguard_spec for libs deps" into main am: b4cd93ccc0 am: 671d826bba am: 69ecb6812f am: fe966999ba am: 1421dac199
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2691152

Change-Id: I2b7029ea7d610f541586029459bbaae7ddb1a839
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-18 20:14:15 +00:00
Treehugger Robot
671d826bba Merge "export_proguard_spec for libs deps" into main am: b4cd93ccc0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2691152

Change-Id: I9dc3ac50540799a64b709bfb5509aed671436cdb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-18 18:39:06 +00:00
Treehugger Robot
b4cd93ccc0 Merge "export_proguard_spec for libs deps" into main 2023-08-18 18:17:19 +00:00
Sam Delmerico
95d709402a export_proguard_spec for libs deps
Add a property to export proguard flags files for libs dependencies.
Currently only proguard flags files from static deps are propagated up
to reverse dependencies, but it is necessary sometimes to have flags
from libs dependencies also be propagated.

Bug: 289087274
Test: go test ./java
Change-Id: Ic0aa22b086792bf322041aa5780db6c4f4eb2770
2023-08-18 15:43:56 +00:00
Treehugger Robot
cc259040b5 Merge "Revert "Revert "Move from-text stub java_api_library modules clo..."" into main 2023-08-17 23:50:00 +00:00
Jihoon Kang
b281ddc8a2 Revert "Revert "Move from-text stub java_api_library modules clo..."
Revert submission 2713677-revert-2655262-move_java_api_libraries-JTESUMBERD

Reason for revert: Initial revert was created to resolve build breakage, but the breakage was caused because not all CLs included in the topic were being included in the build, and was not a problem of the CLs itself.

Reverted changes: /q/submissionid:2713677-revert-2655262-move_java_api_libraries-JTESUMBERD

Merged-In: If66b5bba719bb389a69f2353d2218a89b2b96b90
Change-Id: I879c9d3fb7427cfeff45fff423d4d536548e766f
2023-08-17 20:51:46 +00:00
Romain Jobredeaux
f0f822d4dc Merge "Support asset_dirs property in bp2build for android_{app,library}" into main am: 491fa2fe50 am: 67a98d3520 am: 6a5370155c am: ed541ef3d1 am: dfdd351c73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2715093

Change-Id: I7927ebe2107ee9bd9faab397ab6296f9fc7656fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-17 20:06:08 +00:00
Romain Jobredeaux
491fa2fe50 Merge "Support asset_dirs property in bp2build for android_{app,library}" into main 2023-08-17 17:43:18 +00:00
Romain Jobredeaux
7a71e07040 Support asset_dirs property in bp2build for android_{app,library}
Bug: 276928228
Test: Unit Tests
Change-Id: I6a2899de21e046e54cd0cd71314bf7aec4a470f6
2023-08-17 10:18:55 -04:00
Jihoon Kang
4434b7132c Revert "Move from-text stub java_api_library modules closer to s..."
Revert submission 2655262-move_java_api_libraries

Reason for revert: Breaking build

Reverted changes: /q/submissionid:2655262-move_java_api_libraries

Change-Id: I2719de4d35e5a4131468d7e84b369631ec86eb2b
2023-08-17 01:26:23 +00:00
Mark White
8bf29fd473 Created empty framework-location non-updatable module
Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: presubmit
Change-Id: Iebc6d016b8313759ac1f6f3ab6f4834f5ad7b93e
2023-08-16 23:22:50 +00:00
Mark White
c9b16799b5 java_library support for building headers-only
Flag for java_library modules to build just the Turbine headers and
skip building an impl jar.

Test: m framework-minus-apex-headers
Bug: 289776578
Ignore-AOSP-First: Change stacked with changes in internal repos

Change-Id: If8b4033462d39c689cba0ed38cc343e4786ea280
2023-08-16 23:22:50 +00:00
Jihoon Kang
b6ec2c8ea0 Move from-text stub java_api_library modules closer to source
This change moves java_api_library modules that were previously defined
in build/orchestrator closer to where their from-source equivalents are
defined.

Test: m (default to from-text stub build)
Bug: 274805756
Merged-In: If66b5bba719bb389a69f2353d2218a89b2b96b90
Change-Id: If66b5bba719bb389a69f2353d2218a89b2b96b90
2023-08-16 22:12:11 +00:00
Jihoon Kang
662e2c5e98 Move from-text stub java_api_library modules closer to source
This change moves java_api_library modules that were previously defined
in build/orchestrator closer to where their from-source equivalents are
defined.

Ignore-AOSP-First: Resolve merge conflict

Test: m (default to from-text stub build)
Bug: 274805756
(cherry picked from https://android-review.googlesource.com/q/commit:fb5331fd3eff558b5f0751692db38cd77018f1b6)
Change-Id: If66b5bba719bb389a69f2353d2218a89b2b96b90
2023-08-16 19:22:28 +00:00
Paul Duffin
f654a0db64 Merge "Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"" into udc-dev-plus-aosp am: 33008518e1 am: 1987d4da6c am: 33c3e55d45
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/24441311

Change-Id: I163a6670ce62601f2a88b1a60063b23c3b5b0b7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-16 13:32:50 +00:00
Paul Duffin
33008518e1 Merge "Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"" into udc-dev-plus-aosp 2023-08-16 11:11:55 +00:00
Paul Duffin
58c2388f92 Revert "Re-enable checks that pass in udc-dev-plus-aosp and downstream"
This reverts commit bdc0578df1.

Reason for revert: b/296088866

Change-Id: I053314736758f48ea99920a141443c1489d2477b
2023-08-16 08:04:26 +00:00
Treehugger Robot
0cc296c9bc Merge "Stop sdk_library generated api_library to depend on full surface api_library" into main am: f5ee8e3ffc am: b880908c09 am: 740c5a4011 am: 0454473c23 am: d0b1fdbc26
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2674197

Change-Id: Ib790eeecaf2dd39badbdc5c7dc16da5145ecbbcf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 23:38:47 +00:00
Mark White
4fac9ea8b2 Merge "SdkTestCore for non-updatable modules" into main 2023-08-15 21:47:25 +00:00
Treehugger Robot
740c5a4011 Merge "Stop sdk_library generated api_library to depend on full surface api_library" into main am: f5ee8e3ffc am: b880908c09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2674197

Change-Id: I2c6de2f158b111dd103c50584cb88d5cd9cb8eac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-15 20:38:35 +00:00
Mark White
beb6e9ffdb SdkTestCore for non-updatable modules
Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
2023-08-15 12:37:37 +00:00
Jihoon Kang
ba0b8e9a7e Merge "Add previous_api property to java_api_library module" into main am: 9a3cd19bee am: 7bdc85175f am: 706d31cb27 am: 83ca3ce0ec am: e31d2662fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2685826

Change-Id: I0bd40cbfd962c79275f862a2959ce0c74ef4f1cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 22:56:54 +00:00
Jihoon Kang
706d31cb27 Merge "Add previous_api property to java_api_library module" into main am: 9a3cd19bee am: 7bdc85175f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2685826

Change-Id: Ia9d23a2c145a0172ad22dc44a0916854a508e818
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 21:46:17 +00:00
Jihoon Kang
e7ee256746 Stop sdk_library generated api_library to depend on full surface api_library
Since full_api_surface_libs extract class files instead of srcjar file,
full_api_surface_stub can be replace with android_*_stubs_current,
instead of the api_library android_*_stubs_current.from-text.
Functionally, the class files of the two modules are identical (in
from-text stub build), but depending on the from-text java_api_library
leads to missing dependency errors in partial branches (especially ART
branches). To resolve this problem, make sdk_library generated
api_library depend on the missing dependency handled
android_*_stubs_current.

Since android_module_lib_stubs_current.from-text does not have its
from-source equivalent, this can remain as dependency as the module is
moved to build/soong in aosp/2674196

Test: m (default to from-text stub build)
Bug: 274805756
Change-Id: Ic8bbd25252e5f9f1dc7c059ce6b00a951188985d
2023-08-14 21:18:13 +00:00
Jihoon Kang
e52590be2a Convert additional sdk_library stub libraries to from stub generation am: 0c705a448f am: 965d58af92 am: 5803ca5737 am: be62f141cc am: 8382920b4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2689126

Change-Id: I91db0ba1829fc4c9114baca108233db704f6359e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 20:26:04 +00:00
Jihoon Kang
5803ca5737 Convert additional sdk_library stub libraries to from stub generation am: 0c705a448f am: 965d58af92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2689126

Change-Id: I3ad5fd10ceeea803a0964fda38d311b74464cfa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-14 18:19:39 +00:00
Jihoon Kang
862da6f233 Add previous_api property to java_api_library module
`Previous_api` is used to migrate nullness information in metalava (i.e.
convert @Nullable and @NonNull to @RecentlyNullable and @RecentlyNonNull
for some methods). The input is required to generate loosely equivalent
from-text stubs.

Test: m && compare nullness annotations between from-source stubs and from-text stubs
Bug: 293962901
Change-Id: Ic7a0868415fdb2c65d0d472e527fe73280b7651d
2023-08-14 17:18:40 +00:00
Jihoon Kang
0c705a448f Convert additional sdk_library stub libraries to from stub generation
legacy.i18n.module.platform.api, stable.i18n.module.platform.api and
conscrypt.module.platform.api contributes to api surfaces, but the
corresponding stub libraries were being generated from source during
from-text stub build. This discrepancy may lead to hiddenapi failure.
Thus, enable these modules to be built from txt files during from-text
stub build.

Test: m
Bug: 274805756
Change-Id: I940dc8484b210bb8aea57ead1055983be7cdf5ec
2023-08-14 17:17:48 +00:00
Paul Duffin
a0436a88dc Merge "Pass the current API file to the metalava --use-same-format-as option" into main am: 64876012de am: 41ce7e62e1 am: 4ea34ac332 am: 0ca0c697bc am: c2c0065996
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2706154

Change-Id: I7eaceee55fdc7a5fe6bf48af475cdd0a18ae94e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 17:33:06 +00:00
Treehugger Robot
8bbe824e77 Merge changes I33846cdb,I1eb1f4bf into main am: 69ea5b8267 am: a823f9da87 am: 3d0e7d57b4 am: 5a4b14effe am: e9ec119291
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2705698

Change-Id: I8481e93853f5522fc0124e9da7796033a49c1b58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 17:32:47 +00:00
Paul Duffin
4ea34ac332 Merge "Pass the current API file to the metalava --use-same-format-as option" into main am: 64876012de am: 41ce7e62e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2706154

Change-Id: I4f6628e36a899fd5956a07e1dad1de930f1075aa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 14:56:50 +00:00
Treehugger Robot
3d0e7d57b4 Merge changes I33846cdb,I1eb1f4bf into main am: 69ea5b8267 am: a823f9da87
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2705698

Change-Id: Ic64a65e649c2482702c89046f3e155c64d1dfecd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-12 14:56:34 +00:00
Paul Duffin
64876012de Merge "Pass the current API file to the metalava --use-same-format-as option" into main 2023-08-12 13:27:37 +00:00
Jihoon Kang
478ca5b79e Move scopeOrderedSourceFileNames as outside var
This change enables scopeOrderedSourceFileNames to be not computed
everytime when the function is called, but instead is computed once.

Test: m
Bug: 295429988
Change-Id: I33846cdb7a750e44e45049dbd342aa6ab8b70c4c
2023-08-11 23:36:11 +00:00
Paul Duffin
10a23c29e2 Pass the current API file to the metalava --use-same-format-as option
That will allow the format of a file to be changed by simply modifying
the signature format in the current API file (e.g. from `2.0` to `3.0`)
and then running `m update-api` and it will just update the current API
file (and the corresponding removed API file).

Bug: 295577788
Test: m checkapi && m update-api
      # Also did as described above and modified the
      # `libcore/api/current.txt` file from `2.0` to `3.0` and ran
      # `m update-api` and checked that only that file and the
      # corresponding `removed.text` file was changed.
Change-Id: I20c9bc151677502cf09b0c06fb442fd385caccdd
2023-08-12 00:06:42 +01:00
Jihoon Kang
84473f55d7 Sort api files by api scope in java_api_library
Recent changes in metalava (aosp/2704325) enforces api files passed as
inputs to generate stubs from txt to be sorted in the order from the
narrower api scope to the wider api scope. In order to comply with this
change, all api files passed as inputs to metalava invocations need to
be sorted in the respective order.

Test: m out/soong/.intermediates/packages/modules/IPsec/tests/cts/CtsIkeTestCases/android_common/e10894d3da5db41239526c9048962355/javac/CtsIkeTestCases.jar --build-from-text-stub --skip-soong-tests (Failing module from incorrect class hierarchy when building from text stub)
Bug: 295429988
Change-Id: I1eb1f4bf8fa34fd7dc8a0e4c04aa056258a975c5
2023-08-11 22:58:54 +00:00
Treehugger Robot
4189ebdbd5 Merge "Re-enable checks that pass in udc-dev-plus-aosp and downstream" into udc-dev-plus-aosp am: b2ddb1dba6 am: bbfb393d25 am: c297bae679
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/24376335

Change-Id: I89f272f444615a3928d3fcfa4d0fc19e6175b590
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11 00:05:54 +00:00