Commit graph

6514 commits

Author SHA1 Message Date
Spandan Das
92b6e8ec72 Merge "Java API export of CorePlatformApi surface" 2023-02-01 01:20:11 +00:00
Jared Duke
8e0ae8e960 Merge "Enable same-file policy for R8 optimizations" 2023-01-31 16:54:42 +00:00
Spandan Das
da97755329 Java API export of CorePlatformApi surface
API export currently uses a naming convention to determine the api
surface of a droidstubs module. Add platform.api to this naming
convetion for CorePlatformApi surface

Test: N/A
Bug: 262014796
Change-Id: I1255e7e54d4a1dfb9e040184b90d6e8b7146c028
2023-01-30 23:54:11 +00:00
Cole Faust
5c503d1c43 Precompile python sources
This signifigantly improves the startup time of soong-built
python binaries. For example, running
`m apexer && time out/host/linux-x86/bin/apexer` gives
0.734s before this cl, and 0.094s after.

Fixes: 259718110
Test: Presubmits
Change-Id: Ib19e83e2c60c39a849525be117279c318de3afa7
2023-01-27 15:43:38 -08:00
Jared Duke
a1b8b9bab9 Enable same-file policy for R8 optimizations
While this does increase dex size for optimized targets by limiting the
scope of class merging, it also
  1) improves actionability of unretraced stack frames
  2) improves accountability for size increases
  3) tends to decrease compiled code sizes for impacted targets
  4) marginally (~1%) decreases RSS

Improvements in tooling should mitigate (1) and (2), and more targeted
use of @NeverInline can mitigate (3). Until such time, the pros seem to
outweigh the cons, so we enable the policy as a temporary measure.

Bug: 264916934
Test: m
Change-Id: Id63a17955692b75b16c42d9c85b55bae409c0da4
2023-01-27 11:25:26 -08:00
Jihoon Kang
b6690d21ae Merge "Generate java_api_contribution module from droidstubs module" 2023-01-26 23:54:14 +00:00
Alix Espino
1db2ff3eaf Merge "arch variant support for libs property" 2023-01-26 19:11:23 +00:00
Jihoon Kang
3198f3cb52 Generate java_api_contribution module from droidstubs module
Context
- droidstubs module are either generated from the java_sdk_library
  module or defined in the bp files.
- Since droidstubs module contains API text file property,
  java_api_contribution module can by dynamically created from
  droidstubs.

Implementation
- Add `api_surface` property in droidstubs module. This property is
  either inherited from the java_sdk_library or written in the module
  definition in the bp file.
- Add defaultable hook in droidstubs module to generate the child
  java_api_contribution module.

Test: m
Change-Id: Ica43d65614723c623cd0c155266f9844e69e5d5e
2023-01-26 18:44:25 +00:00
Ian Zerny
9002605d72 Merge "Add default output location for full proguard configuration." 2023-01-26 07:16:03 +00:00
Ian Zerny
82044f1327 Add default output location for full proguard configuration.
Test: n/a
Change-Id: I1d022ff138d14f6b6960811320436c7e5660e6e2
2023-01-25 19:56:22 +01:00
Sam Delmerico
41f9b734bb Merge "transitive Java deps for r8" 2023-01-25 16:05:43 +00:00
Treehugger Robot
7c30b6bad7 Merge "bp2build support .kt in android_library" 2023-01-25 15:47:49 +00:00
Jihoon Kang
6cf5e0d9cb Merge "Add libs property to java_api_library module" 2023-01-24 18:08:49 +00:00
Spandan Das
82a9e8fe03 Merge "Add j.a.p.Generated to ART's Public API surface" 2023-01-24 16:40:17 +00:00
Alix
36795a74dc bp2build support .kt in android_library
Bug: 258690851
Test: bp2build tests and built target renderscript_toolkit
Change-Id: I43ddf5637c97e4849b63abd2423f29519d44c28f
2023-01-24 14:53:44 +00:00
Jihoon Kang
362aa9db12 Add libs property to java_api_library module
Module Lib API surface takes modules that are not part of the API
surface as classpath during compilation of the JAR file. Thus, add libs
property to add deps in bp module definition.

Test: m
Change-Id: I8967d53430fa4cc8e4aa431770ba4e97893f8c61
2023-01-24 00:44:22 +00:00
Sam Delmerico
9f9c0a22fa transitive Java deps for r8
The -libraryjars argument to r8 was missing transitive dependencies, and
so complained when there were classes used in the program JAR which were
not provided via libraries. This CL propagates transitive dependencies
to the r8 command to reduce the warnings that are generated for missing classes.

Bug: 242088131
Change-Id: Ifad7bc7c5d406e3de8d98ea963c97e88c84b45a1
2023-01-20 17:05:14 -05:00
Alix
495cc8a6ff arch variant support for libs property
Test: bp2build tests and manually inspected Build file for libprotobuf-java-lite
Bug: 244210934
Change-Id: Id60d859eea2c23fa7a29784faeed5cb050d4193e
2023-01-19 20:42:24 +00:00
Alix
684f63ab5a Getting rid of old hacky Libs conversion
Now that libs conversion is happening for the needed module_types,
removing if statement with old hacky libs conversion

Test: Presubmit
Bug: 244210934
Change-Id: I92bb2080eeb7dcb85d087a3ff6054bdf8675ec54
2023-01-19 15:39:49 +00:00
Alix Espino
fbd7fabf0a Merge "bp2build support libs for *->android_library_import" 2023-01-19 15:21:07 +00:00
Cole Faust
bbe929c31e Merge "Replace RuleBuilder usages with static rules in app_import.go" 2023-01-17 23:13:12 +00:00
Alix
14101de2e1 bp2build support libs for *->android_library_import
Test: bp2build tests
Bug: 258688914
Change-Id: Ibeae04e4c006f84f902774821c92f463a7c709eb
2023-01-17 15:55:07 +00:00
Alix
53fae383d6 support libs for java_plugin -> *
Test: bp2build tests
Bug: 244210934
Change-Id: I7dbc820b23c4129485b0991aefb41e00e434d94e
2023-01-17 14:57:57 +00:00
Alix Espino
f02c7d882e Merge "libs support for android_app->* edge" 2023-01-17 14:31:18 +00:00
Cole Faust
4ec178c5db Replace RuleBuilder usages with static rules in app_import.go
RuleBuilder creates a new rule in the ninja file every time
it's used, but in this case the rules were all exactly the same
except that the input/output file paths were different.

This can be converted to a single static rule instead.

Bug: 262629589
Test: m nothing
Change-Id: Iaa887c66a757da13293a3614c000d3be02a2a1b0
2023-01-13 17:45:17 -08:00
Jihoon Kang
cd08ae402b Merge "Add java_api_library properties to java_defaults" 2023-01-12 18:57:41 +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
Romain Jobredeaux
3095d8e7bc Merge "Use centralized rules.bzl file for android rules in bp2build." 2023-01-12 18:46:48 +00:00
Alix
6c087cf01a libs support for android_app->* edge
Test: bp2build tests
Bug: 258688914
Change-Id: I2e24c484019c994b43509f350b3c090a40c3ba6a
2023-01-12 15:19:55 +00:00
Alix Espino
ed2491cf20 Merge "java_binary with kotlin sources" 2023-01-12 14:40:46 +00:00
Treehugger Robot
7def86db45 Merge "Update app tests to set Unbundled_build" 2023-01-12 14:12:10 +00:00
Romain Jobredeaux
5ccb460c42 Use centralized rules.bzl file for android rules in bp2build.
Change-Id: I6e4837d8b6715960337d0db9b36f8137efb5673e
2023-01-11 16:29:12 -05:00
Treehugger Robot
4bf6a9ee50 Merge "Fix ALLOW_MISSING_DEPENDENCIES builds for prebuilt JNI libraries" 2023-01-11 21:09:30 +00:00
Harshit Mahajan
18845d0f7a Update app tests to set Unbundled_build
Based on the description for UnbundledBuildApps(), UnbundledBuild()
should always be true when UnbundledBuildApps() is true.
Updating the test to match this condition.
More details: https://android-review.git.corp.google.com/c/platform/build/soong/+/2380693/comment/54f172b4_2eee54fa/


Bug: b/227460469
Test: m nothing
Change-Id: I3a93edb781522da5af201f6864e157e7bab2195a
2023-01-11 18:44:53 +00:00
Inseob Kim
48aa22380e Consider only preferred modules for jdeps
Bug: 263327259
Test: run atest and see modules to be built
Change-Id: I208a07e2453b924f8af25db340d970ec039c5f32
2023-01-11 13:26:04 +09:00
Spandan Das
3dfb939243 Merge "Create a "Toolchain" API surface" 2023-01-11 01:08:25 +00:00
Jihoon Kang
1c51f50120 Add java_api_library properties to java_defaults
Context
- Some Java API surfaces have subset relationships (i.e. public API
  surface is a subset of system API surface). Thus, simply listing
  all API files that contributes to hierarchical API surfaces when
  defining java_api_library modules can lead to repetition of code in
  Android.bp files.
- Utilizing java_defaults can resolve this problem by
  grouping java_api_contribution modules by API surfaces, and reduce
  code repetition and enhance readability.

Implementation
- Modify java_api_library module to utilize java_defaults modules.

Test: m
Change-Id: I6adead208ca36c21de72ee39c4f532b84af8a153
2023-01-10 22:34:31 +00:00
Harshit Mahajan
8f202ad925 Move target sdk version enforcement check
Enforce target sdk version flag could only be used by `android_app`,
moving the check into a common function `generateAndroidBuildActions`.
This would ensure that the `enforce_target_sdk_version` flag
can also be set by `android_test` and `android_test_helper_app`.

Bug: b/227460469
Test: m nothing

Change-Id: I86e0bf684a5083221dae53907d9f548a0390b673
2023-01-09 20:54:39 +00:00
Alix
7c8eaebc4f java_binary with kotlin sources
Test:  bp2build conversion tests and inspected build file for AnalyzerKt
Change-Id: I0f6d5c3d371a9dbd000b74144ad68d5d8bd156cf
2023-01-09 20:09:37 +00:00
Spandan Das
64b0fbd151 Merge "Move art's java_system_modules into a shared inner tree" 2023-01-09 17:47:20 +00:00
Matt Gilbride
016d22487f Merge "Configure ObsoleteLintCustomCheck lint as fatal" 2023-01-09 15:48:25 +00:00
Treehugger Robot
4520481c6a Merge changes I07db8afc,Ia89e0239
* changes:
  Stop module types being SdkAware
  Replace usages of SdkAware in sdk module with Module
2023-01-07 14:46:22 +00:00
Treehugger Robot
3c867b6ce8 Merge "Remove SdkAware.SdkMemberComponentName" 2023-01-07 14:36:24 +00:00
Paul Duffin
e76fa00998 Merge "Remove IsModuleInVersionedSdk" 2023-01-06 22:37:59 +00:00
Paul Duffin
5366821635 Merge "Dedup checks for module being in versioned sdk snapshot" 2023-01-06 22:37:15 +00:00
Treehugger Robot
6228be4cd4 Merge "support libs for android_library" 2023-01-06 19:30:02 +00:00
Alix
82fb94e91e support libs for android_library
adds support for *-> android_library and android_library->* edges

Change-Id: I41d4e1d1b8106a17e67951d47e67b59ef3170d17
Test: manually inspected build files for libWallpaperPicker & android-suppor-v4
2023-01-05 21:13:57 +00:00
mattgilbride
69f04a150c Configure ObsoleteLintCustomCheck lint as fatal
Lint raises an issue ObsoleteLintCustomCheck if it detects
incompatibilities between a custom lint check jar and the lint api
itself.

This is a warning by default, but in AOSP it should be fatal.
Any custom checks are expected to run. If they don't, there is risk
of introducing bugs.

ObsoleteLintCustomCheck will now cause build breakage so that it will
be investigated immediately.

Bug: N/A
Test: TH
Change-Id: I3a46c93d5b53ee0e1add7c287af791bd1b41f1c1
2023-01-05 17:44:24 +00:00
Spandan Das
85333078aa Merge "Revert "R8/D8 should use sdk_version prop to determine API surface stability."" 2023-01-05 02:24:16 +00:00
Spandan Das
7eb9243fa7 Revert "R8/D8 should use sdk_version prop to determine API surface stability."
This reverts commit daa220ae8c.

Reason for revert: Suspected to be a cause for build failure (b/264446640). Will use go/abtd to verify

Change-Id: Ibfdf893f2426b1119923467027e0acedd08808c1
2023-01-04 22:14:59 +00:00