Commit graph

6711 commits

Author SHA1 Message Date
Jared Duke
91f32e7ae5 Suppress resourceshrinker stdout in soong
The resourceshrinker command prints an info log for successful runs,
which we don't really need to surface in build output. Suppress stdout
for such invocations; errors will surface through stderr.

Bug: 202959019
Test: m + compare log output
Change-Id: I08ed465bb7e3a0fa8d5e967d858f6739b5ef7fad
2023-06-16 23:12:33 +00:00
Alix Espino
9241da9662 Merge "Delete java/rules.bzl file" 2023-05-09 20:18:36 +00:00
Jiakai Zhang
90c69f71c4 Merge changes from topic "revert-2580631-revert-2574032-XXTWCJDTDQ-YJWXHQZNPJ"
* changes:
  Revert^2 "Generate app profiles even if dexpreopt is disabled."
  Revert^2 "Generate boot image profiles even if dexpreopt is disabled."
2023-05-09 13:50:55 +00:00
Jared Duke
fda5890f24 Merge "Fix Proguard configuration output from R8 invocation" 2023-05-08 22:20:11 +00:00
Jiakai Zhang
cf61e3c591 Revert^2 "Generate app profiles even if dexpreopt is disabled."
Revert submission 2580631-revert-2574032-XXTWCJDTDQ

Reason for revert: Fixed build breakages

Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ

Bug: 280440941
Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist
Test: Disable dex2oat on host (to simulate macOS) and build
Change-Id: I6090b4b74cedb6d129fcbeef58d075c8ccdcc4e2
2023-05-08 21:29:23 +01:00
Jiakai Zhang
bc698cd28a Revert^2 "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2580631-revert-2574032-XXTWCJDTDQ

Reason for revert: Fixed build breakages

Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ

Bug: 280440941
Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist
Test: Disable dex2oat on host (to simulate macOS) and build
Change-Id: I5f7f746ca1d4da660fe0c40115e6c71750dfdccc
2023-05-08 21:28:13 +01:00
Jared Duke
34c6d7d56f Fix Proguard configuration output from R8 invocation
The output when using `--pg-conf-output` seems to be flaky. In the
meantime, use `-printconfiguration` to generate full config summaries
for each R8 invocation.

Bug: 281081834
Test: m && \
      find $ANDROID_BUILD_TOP/out -name proguard_configuration -empty
Change-Id: I0c8c36212e338b50505184076f4c470a5d3d9b94
2023-05-05 21:05:33 +00:00
Qiao Yang
7081aaf874 Merge changes from topic "revert-2574032-XXTWCJDTDQ"
* changes:
  Revert "Generate boot image profiles even if dexpreopt is disabled."
  Revert "Generate app profiles even if dexpreopt is disabled."
2023-05-05 16:43:45 +00:00
Qiao Yang
8d8c660710 Revert "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: I8e99f8231639198b149ea8d822ee7f9a5b391a89
BUG: <280902279>
2023-05-05 15:03:24 +00:00
Qiao Yang
3d08c388b9 Revert "Generate app profiles even if dexpreopt is disabled."
Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: Ia9d05f3b7439604eb4a4b4100f46879fe11f5820
BUG: <280902279>
2023-05-05 15:03:24 +00:00
Treehugger Robot
c144c08d2a Merge "Provide a resource_prefix_strip for java_resources in bp2build." 2023-05-05 01:44:03 +00:00
Treehugger Robot
ee6bd5a7b2 Merge "Enable prebuilt apk checks" 2023-05-05 01:30:35 +00:00
Treehugger Robot
da8ebf235c Merge "Add genrule to build *.latest.version build target." 2023-05-05 01:00:32 +00:00
Jiakai Zhang
dbfcf85c53 Merge changes I4e721b47,I1bf05ade
* changes:
  Generate app profiles even if dexpreopt is disabled.
  Generate boot image profiles even if dexpreopt is disabled.
2023-05-04 22:13:08 +00:00
Gurpreet Singh
daa314ac97 Add genrule to build *.latest.version build target.
Build a new target *.latest.version which will contain a text file
containing the last finalized version.

Bug: 242316893
Test: atest prebuilt_apis_test
Change-Id: I41fa91c9ec273f342b7807c66c4d65ba13260124
2023-05-04 21:02:47 +00:00
Cole Faust
ccb20f47d5 Enable prebuilt apk checks
Now that existing violations set the skip flag.

Bug: 185811447
Test: Presubmits
Change-Id: Ia513b71be1cd878f36fdb28c94ef3cdc3f2a6bc6
2023-05-04 12:38:24 -07:00
Romain Jobredeaux
d5fe133077 Provide a resource_prefix_strip for java_resources in bp2build.
Although paths to resource files in a Bazel java_library should be
relative to the package, the directory structure in the resulting jar
will have resources under the full path from the top-level of the
workspace, e.g. if a library in "a/BUILD" has java_resouces as
"res/res.txt" then by default the res.txt file would appear under
"a/res/res.txt".
Fix this by adding a resource_strip_prefix in that case.

Test: Unit tests
Change-Id: If4325126f5c19a2a8fb83ee09bc3a95a18673fe3
2023-05-04 14:54:45 -04:00
Alix
83a8bc47d2 Delete java/rules.bzl file
Bug: 277800767
Test: treehugger
Change-Id: Idc80cd51317d167fca8d5543bb53c585adeaddad
2023-05-04 18:03:23 +00:00
Sam Delmerico
717840fdfc Merge changes from topic "privapp_allowlist_prop"
* changes:
  add privapp_allowlist property to android_app
  Add script for modifying privapp permission allowlists
2023-05-04 13:57:17 +00:00
Jiakai Zhang
7b845e808f Generate app profiles even if dexpreopt is disabled.
Bug: 280440941
Test: -
  1. Patch ag/22302622 to disable dexpreopt.
  2. lunch aosp_cf_x86_64_phone-userdebug && m
  3. See app profiles still generated.
Test: -
  1. Patch ag/20592051 to enable profile for service-art.
  2. banchan com.android.art x86_64 && m
  3. See the profile for service-art generated.
Change-Id: I4e721b475b84a2f667bbccc030a8947078f26bb0
2023-05-04 13:53:22 +01:00
Andrei Onea
580636bdd2 add privapp_allowlist property to android_app
This change allows override_android_app to use the same
privapp_allowlist as the non-override module so that they will always
remain in sync.

Test: go test ./java -v -run TestPrivappAllowlist
Test: go test ./apex -v -run TestApexWithApps
Test: m com.android.permission com.google.android.permission and verify
  manually that apex_payload.img contains correct privapp_allowlist
Test: m com.android.permission before and after change &&
  `diffoscope apex_payload_reference.img apex_payload_with_change.img`
  && verify that there are no semantic changes
Bug: 242509786
Change-Id: Ifdcb28af40763aed7a4aac9a7f681153554bc256
2023-05-03 15:03:34 +00:00
Jiakai Zhang
b95f8345c8 Generate boot image profiles even if dexpreopt is disabled.
Bug: 280440941
Test: -
  1. Patch ag/22302622 to disable dexpreopt.
  2. See boot image profiles still generated.
Change-Id: I1bf05ade53fa83f3dba46f28a8f9246ba1fdf664
2023-05-03 15:25:18 +01:00
Cole Faust
9e4c6c9cc7 Merge "Use api_levels_released_versions from starlark" 2023-05-02 21:55:15 +00:00
Jeongik Cha
30208863b4 Merge "Get rid of DeviceName() from path related to dexpreopt" 2023-05-02 05:07:03 +00:00
Cole Faust
3486740cc5 Use api_levels_released_versions from starlark
Instead of exporting it to soong_injection.

Bug: 279095899
Test: m nothing
Change-Id: I7b93af233b7450848a475512b5f5682ece773c09
Merged-In: I7b93af233b7450848a475512b5f5682ece773c09
2023-05-02 01:05:07 +00:00
Spandan Das
934d5047ef Merge changes from topic "bp2build-ignore-test-apex-tags"
* changes:
  Ignore test apexes from bp2build generated tags
  Ignore test apexes from bp2build generated tags
2023-05-01 16:05:38 +00:00
Treehugger Robot
e605b39e61 Merge "target_sdk_version replacement should respect REL branches" 2023-04-28 23:18:16 +00:00
Spandan Das
fb6a1ee68b target_sdk_version replacement should respect REL branches
Currently, target_sdk_version of MTS tests were being set to 10000 even
in release branches. This should only happen in active branches.

Test: Unit test
Test: aapt2 on CtsContentTestCases in udc-dev and verified
targetSdkVersion is 34
Bug: 279507428

Change-Id: Ib79318febc0f6e771b3679c0281a97357930ec56
2023-04-28 16:23:53 +00:00
Jeongik Cha
4753b39cca Get rid of DeviceName() from path related to dexpreopt
As-is, dexpreopt config and bootjar is in the dir including
DeviceName(). It causes unnecessary dexpreopt invocation when target is
changed repeatly. To avoid it, rename dir to common name.

Bug: 278833696
Test: m
Change-Id: I2818d9ae09e6c22ca6989cc8efdb70b470ec502c
2023-04-28 11:50:18 +09:00
Spandan Das
39b6cc5336 Ignore test apexes from bp2build generated tags
Soong does not enforce apex_available on the contents of test apex. To
prevent special-casing test apexes in the apex validation aspect in
Bazel, drop the test apexes from the tags altogether.

( The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. apex validation happens
to be a nice side benefit)

Bug: 277651159
Test: go test ./bp2build
Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
2023-04-27 23:24:49 +00:00
Cole Faust
03cf3181d3 Merge "Expand preprocessed flag to work on android_app_imports" 2023-04-27 17:18:59 +00:00
Cole Faust
2f1da168ab Expand preprocessed flag to work on android_app_imports
Setting the preprocessed flag will now also verify that the apk is
zip-aligned and does not have compressed JNI libs or dex files.

Bug: 185811447
Test: m nothing
Change-Id: I01b7c25f390345b14385f6f9e1640f48a5d9dc93
2023-04-25 15:04:58 -07:00
Jihoon Kang
b420705230 Merge "Utilize from text core platform api surface jar in build" 2023-04-25 17:48:25 +00:00
Jihoon Kang
fb502593cd Add additional java_api_library module to java testing
Module lib surface is comprised of contributions from art, conscrypt,
and i18n api domains. On top of this, the module lib api surface generates an additional stub library containing the contributions of the non-updatable api domains. Adding this additional module to the testing module enables more thorough testing of module lib api scope java_api_library modules.

Test: m
Change-Id: Ia648651fb9e6cba2642de7e8d39047d888bf49ce
2023-04-17 21:28:47 +00:00
Cole Faust
d580613a0e Remove special handling of prebuilt_framework-res
prebuilt_framework-res doesn't appear to exist anymore.

Bug: 185811447
Test: m nothing
Change-Id: Ib1aa929fbe007f87d03bdc85e4d54c6fae4e510b
2023-04-13 15:48:30 -07:00
Romain Jobredeaux
a3c029e7d5 Merge "Bp2build support for sdk_version and java_version." 2023-04-13 20:53:07 +00:00
Romain Jobredeaux
2eef2e13e9 Bp2build support for sdk_version and java_version.
This CL adds java_version and sdk_version support to bp2build
converters for
   - java library
   - java binary
   - android library
   - android binary
   - android library import

Although java import doesn't support java_version and sdk_version, the
neverlink java_library wrapper around a java_import must specify a
sdk_version when targetting a device. "none" is used by convention.

Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea
Bug: 215230098
Test: Presubmits
2023-04-11 21:05:48 -04:00
Jihoon Kang
b507831b71 Utilize from text core platform api surface jar in build
Use JavaApiLibraryName function to redirect the usage
of core platform api stubs from .txt files based on config.

Test: m --build-from-text-stub
Change-Id: I926a0a455fed301ba4ff9dfa509d4dbbbd076029
2023-04-06 18:34:32 +00:00
Jihoon Kang
3bfba4c723 Merge "Update java_api_library in testing modules" 2023-04-05 23:27:50 +00:00
Romain Jobredeaux
15807fa7ed Merge "Bp2build converter for java_host_for_device." 2023-04-05 13:32:29 +00:00
Romain Jobredeaux
b2539d08ed Merge "Support arch variants in java's StaticLibs in bp2build" 2023-04-05 13:32:29 +00:00
Romain Jobredeaux
eb711b9f7c Support arch variants in java's StaticLibs in bp2build
Test: Presubmits
Bug: 276901800
Change-Id: I6058a726833ef10a5f470946e2d265b20fa547ce
2023-04-04 19:50:13 -04:00
Romain Jobredeaux
e7370eabe4 Bp2build converter for java_host_for_device.
Change-Id: I70a345c641bbed3223dc6222062fb6948f7dc6cb
Bug: 276710283
Test: Presubmit
2023-04-04 19:49:17 -04:00
Jihoon Kang
c0a24205a7 Update java_api_library in testing modules
The full api surface java_api_library modules are currently defined as
java_library modules instead of java_api_library modules. This change
corrects this and modifies the DepsInfo of java_api_library so that it
can be compatible in tests.

Test: go ./java
Change-Id: I540b5a930f506ce5f7663ab6e07c6df49af15cf9
2023-04-04 22:52:37 +00:00
Treehugger Robot
28ba80665d Merge changes I0ab8459b,I2ef90f4d
* changes:
  Create core-lambda-stubs from .txt files
  Fix the suffix used in names of java_system_modules
2023-04-04 17:54:56 +00:00
Victor Chang
32952b975d Merge "Add com.android.tools.r8.emitRecordAnnotationsExInDex flag" 2023-04-04 11:12:05 +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
Jihoon Kang
01e522cac5 Add dep_api_srcs property to java_api_library module
Users can pass the jar-file creating module via dep_api_srcs property in
java_api_library to create the jar file not by compiling the stubs
generated from metalava but by extracting and zipping the class files
from the jar file of the input module.

Test: m android-non-updatable.stubs.from-text
Bug: 273381329
Change-Id: Id1b75179111cc7ff45faaff58388db1347bb18e5
2023-04-03 17:53:40 +00:00
Treehugger Robot
71585a0187 Merge changes Ib9ff4eb5,If27a050c
* changes:
  add *.from-text modules to the java test fixture
  Create a SetBuildFromTextStub method
2023-04-03 16:44:08 +00:00