Commit graph

24 commits

Author SHA1 Message Date
Jihoon Kang
6416a71211 Remove TxtStubLibraries.bp
The modules defined in TxtStubLibraries.bp are currently not in the
critical path of the from-text stub build, because the from-text vs
from-source switching is encapsulated within the stub library modules.
Therefore, remove the modules altogether.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: I249edcdf596c8a82058e1bfb17da863c2b5dd7a7
2023-11-02 01:02:40 +00:00
Jihoon Kang
bfa2f9ec69 Move core.module_lib.stubs.from-text closer to source
This change moves the core.module_lib.stubs.from-text closer to its
from-source equivalents and its top level module core/module_lib.stubs.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: Ida6dd613834b36490b1ad79773b9404b1d0d9efc
2023-11-02 01:02:28 +00:00
Jihoon Kang
063ec003f9 Add current api check as validation for from-text stub generation
Currently, there is no build action ensuring that the API text files are
up to date, unless a user runs `m checkapi` or `m update-api`. This
means that the user must run `m update-api` after making a change that
modifies api surface(s), so that the API text file reflects the local
change. This adds additional layer of action to developers, and it is
not guaranteed that the developer will always run `m update-api` after
making an api surface-affecting changes.

To prevent such mistake, this change adds droidstub-level api check as
validation for from-text stub generation. With this change, the build
will fail if the API text file is not up to date and the user must run
`m update-api` when making api surface-affecting local changes.

The validation is done by adding all droidstubs modules associated with
the java_api_contributions passed to java_api_library via
`api_contributions` as dependency and setting the current api timestamp
files as the validations for the from-text stubs generating build rule.

The full api surface libraries will not run the validations to avoid
circular dependency. However, all java_sdk_library generated
java_api_library modules will run validations, mapped to the droidstubs
in the same api domaion.

If the user sets the environment variable `DISABLE_STUB_VALIDATION=true`, validation
actions are not run. Validation actions run by default.

Test: m nothing --build-from-text-stub and run ninja query to verify `check_current_api.timestamp`s are listed as validation \
      DISABLE_STUB_VALIDATION=true m nothing --build-from-text-stub and run ninja query to verify that validation actions are not added
Bug: 288624417
Change-Id: I329e6438fe8f3ac30d8c6a971d57853ed6b0d150
2023-10-13 18:24:41 +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
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
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
Romain Jobredeaux
9d54fdac3d Enable from-source vs from-text toggling for core.module_lib.stubs.
Also fix a typo in legacy core for system modules

Change-Id: I0b3bb04773d7ee616b94252711053d5be396b84a
2023-07-28 16:02:12 -04:00
Jihoon Kang
67b6443258 Redefine core and core platform API surface java_library
Redefined core and core platform API surface java_library using the
product variable build_from_text_stub so that the correct static libs
are linked based on build configuration

Test: m --build-from-text-stub and verify no ninja path between "core.current.stubs" and "core.current.stubs.from-source"
Bug: 285410821
Change-Id: I26febc65697be6278624a504ffbb61be0953d798
2023-06-05 21:44:33 +00:00
Jihoon Kang
b34bb06780 Enable java_api_library modules in TxtStubLibraries.bp
Since the stubs generation from text file feature has been merged,
enable the java_api_library modules in TxtStubLibraries.bp file.

Test: m --build-from-text-stub
Change-Id: Idc77d01882f136c4e255fb4284f9dc058fafe44d
2023-05-23 07:32:04 +00:00
Spandan Das
760f880495 Create core-lambda-stubs from .txt files
APIs to compile lambda are part of art's toolchain api surface.
Generating stubs from .txt files allows us to prune the remaining sdk
dependencies on libcore/ that are not api files

Test: m core-lambda-stubs.from-text
(On top of change containing core.current.stubs.from-text
and turning enabled: true)

Change-Id: I0ab8459b9317cb055a434eb635ba06d38da5b92e
2023-04-03 23:42:08 +00:00
Spandan Das
0cb803a5d6 Fix the suffix used in names of java_system_modules
Test: N/A (enabled flag is still off)
Change-Id: I2ef90f4d9099bf183d65dcf8ebdf532d5fa445b6
2023-04-03 23:29:57 +00:00
Treehugger Robot
1c102d34b7 Merge "Remove stub-annotations from art stubs system modules" 2023-04-03 10:49:15 +00:00
Spandan Das
a335e1de36 Remove stub-annotations from art stubs system modules
This system module is used to compile conscrypt and icu stubs. These
have migrated to java_sdk_library that set `annotations_enabled: true`
explicitly.

Test: m
Test: TH
Change-Id: I65ceb1fbf0dcdbb3504b69ebce6ca8f0b67e964d
2023-03-31 19:28:55 +00:00
Spandan Das
a032c35320 Create core_platform system modules from .txt files
Create a parallel set of java_system_modules that build using stubs from
.txt files. decodeSdkDep will be updated to use these system modules
behind a flag.

Since stub generation from .txt is not available at ToT yet, these
modules have been marked "enabled: false"

Test: None (will test when the enabled flag is turned on)
Change-Id: Ie9d465f5542a5430f03ba2e0861325011ac8e8c5
2023-03-30 00:34:36 +00:00
Spandan Das
4f771f144c Create system modules using .txt stubs
Create a parallel set of java_system_modules provided by the SDK. This
parallel set will build using stubs of core libraries generated from
.txt files. Since stub generation from .txt is not available at ToT yet,
these modules have been marked "enabled: false". decodeSdkDep will be
updated to use these systemModules behind a flag.

(Will create java_system_modules for core_platform in a future CL)

Test: None (will test when the enabled flag is turned on)
Change-Id: Idd89d656fcbc87e8698fe05d65a685ade4488546
2023-03-30 00:34:36 +00:00
Spandan Das
b0f3d42df2 Create a defaults module for stripping out annotations
This reduces code duplication in preparation for checking in a
java_system_modules created using stubs from .txt files

Test: No diff in the 4 java_system_modules
Change-Id: I0a13a0e7bf402cbe8f0dd3942b1f737cc6ac0de7
2023-03-30 00:34:36 +00:00
Spandan Das
7fb3d436f4 Add j.a.p.Generated to ART's Public API surface
Since this class is now part of ART's public API, we do not need to add
it separately to the relevant system modules

Bug: 261244752
Test: TH

Change-Id: Ib318ef006b868d482b2cb8ff4820afe3f352483d
2023-01-12 18:51:52 +00:00
Spandan Das
fe85ca255d Move art's java_system_modules into a shared inner tree
These will be built using the toolchains of the respective inner tree.
This will eventually allow us to drop them from the module SDK (albeit
we still need to make them work for S/T builds)

Test: TH
Bug: 261476442
Change-Id: I43726a2a171d25ace90dc3ddc73e228ffadfb37c
2022-12-08 02:42:25 +00:00
Sorin Basca
bdbae604b0 Strip annotations from copy of core-current-stubs-for-system-modules
Bug: 233029164
Test: m
Change-Id: I4d497b1072d1184cf3dce660992632eb01f4016d
2022-08-22 08:10:16 +01:00
Sorin Basca
69f4b082b9 Strip annotations from library stubs
Bug: 222743634
Test: m
Change-Id: Ic44bd7c4c163b723295eb369664432d3651b8597
2022-05-10 19:41:59 +01:00
Paul Duffin
10fb76f467 Rename core-current-stubs-system-modules to be more consistent
Renames to core-public-stubs-system-modules so that it is of the format
core-<sdk-kind>-stubs-system-modules.

Bug: 204189791
Test: m nothing
Change-Id: Iac565c940c2ef92be9cc64c0c6b8102a26afe0dd
2021-11-03 16:58:29 +00:00
Paul Duffin
bce9f08d02 Dist API specific core-for-system-modules
Previously, the dist only contained a core-for-system-modules.jar for
the public API. This change adds API specific directories containing a
core-for-system-modules.jar file for each of the following APIs:
* public
* module-lib

Bug: 204189791
Test: rm -fr out/dist
      m sdk dist
      find out/dist -name core-for-system-modules.jar
      - outputted the following:
      out/dist/core-for-system-modules.jar
      out/dist/system-modules/module-lib/core-for-system-modules.jar
      out/dist/system-modules/public/core-for-system-modules.jar
Change-Id: Id1845926e2085f70d58e9fc22e9c11cb3d62b919
2021-11-01 14:01:39 +00:00
Bob Badour
36dc7c60b5 [LSC] Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  java/core-libraries/Android.bp
  mk2rbc/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Iaf8546fc945b04b71cd5cb1c7c16a9e15f608d02
2021-08-27 13:30:35 -07:00
Paul Duffin
bb360c32b6 Move modules containing ART, conscrypt and i18n from libcore
This change moves the definitions of the following libraries which
directly include ART, conscrypt and i18n stubs, and their associated
java_system_modules from libcore to build/soong/java/core-libraries.
* core.current.stubs
* core-current-stubs-system-modules
* core.module_lib.stubs
* core-module-lib-stubs-system-modules
* legacy.core.platform.api.stubs
* legacy-core-platform-api-stubs-system-modules
* stable.core.platform.api.stubs
* stable-core-platform-api-stubs-system-modules

Bug: 193311122
Test: m droid
Change-Id: I42c4a0b5322897d40ecf41de088152dbdc526c96
2021-07-12 10:10:42 +01:00