Commit graph

5459 commits

Author SHA1 Message Date
Anton Hansson
52b99b10f5 Merge "Add annotations.zip support to java_sdk_library" am: 86da9c6a3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832255

Change-Id: Id5625d0cc95fa1d235ee5eed6c008b9f555f876b
2021-09-23 09:49:26 +00:00
Anton Hansson
86da9c6a3d Merge "Add annotations.zip support to java_sdk_library" 2021-09-23 09:39:38 +00:00
Joseph Murphy
69e65b3fcd Changes tree built Robolectric name
Bug: b/194219998
Test: locally ran all in-tree Robolectric tests
Change-Id: If13583f6a2882e2e78d3004afc476debf6692df9
Merged-In: If13583f6a2882e2e78d3004afc476debf6692df9
2021-09-23 00:48:34 +00:00
Dan Willemsen
e8273d7bb0 Merge "Add java_binary_host support for Windows" am: b13daf2ba7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832212

Change-Id: I689e0da48cde43581890a8f46e185825a9984035
2021-09-22 20:27:45 +00:00
Dan Willemsen
b13daf2ba7 Merge "Add java_binary_host support for Windows" 2021-09-22 20:13:33 +00:00
Joseph Murphy
c964841e2d Changes tree built Robolectric name
Bug: b/194219998
Test: locally ran all in-tree Robolectric tests
Change-Id: If13583f6a2882e2e78d3004afc476debf6692df9
Merged-In: If13583f6a2882e2e78d3004afc476debf6692df9
2021-09-22 17:58:07 +00:00
Anton Hansson
d78eb76f64 Add annotations.zip support to java_sdk_library
The annotations zip file is produced by the "main" sdk build and is
primarily consumed by android studio.

In order to support building the main SDK without requiring the sources
of all modules, we are adding module SDK artifacts that allows
reconstructing these outputs. The annotations zip contains XML files
which should be fairly easy to merge from all the individual parts.

Bug: 187397779
Test: unit tests in this CL
Test: m sdkextensions-sdk and inspect output
Change-Id: I955cae720e6f1382936836ee1d8fb11003f51b7d
2021-09-22 17:23:10 +01:00
Treehugger Robot
d5082754e0 Merge "Remove workaround for modules with missing BCP fragments, as they are present now." am: cd439a27e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1828596

Change-Id: I81f0280f4ef5082fb80d4d906fa766b7fb78a296
2021-09-22 10:36:55 +00:00
Treehugger Robot
cd439a27e4 Merge "Remove workaround for modules with missing BCP fragments, as they are present now." 2021-09-22 10:18:36 +00:00
Anton Hansson
825a2659e6 Merge "Add back the api_srcs argument" am: 8b1add6dd4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830032

Change-Id: I1dd0b451e8d195e7f382b649aedadebb804a429f
2021-09-21 14:57:36 +00:00
Anton Hansson
8b1add6dd4 Merge "Add back the api_srcs argument" 2021-09-21 14:45:02 +00:00
Dan Willemsen
8e6b37119a Add java_binary_host support for Windows
So that the Windows build-tools package doesn't need to manually copy
the wrapper. Also fixes enabling java modules for Windows by hiding them
from Make, as the Make code does not handle Windows java modules
properly.

Bug: 187222815
Change-Id: I13534b38b9a9f4b5ff0630e028c3b4f88a6b34f8
2021-09-20 23:29:48 -07:00
Aurimas Liutikas
2fa15f76a3 Merge "Enable compose kotlinc plugin when depending on the compose runtime" am: e992a52d0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830673

Change-Id: I8becfa1da6f0b03d0fd839b5e60b6a5f9c662821
2021-09-20 23:53:09 +00:00
Aurimas Liutikas
e992a52d0e Merge "Enable compose kotlinc plugin when depending on the compose runtime" 2021-09-20 23:28:33 +00:00
Martin Stjernholm
531d8fdc2a Remove workaround for modules with missing BCP fragments, as they are
present now.

#codehealth

Test: presubmits
Bug: 192868581
Change-Id: I8370525849ea589af0bf4f8d3fd081f3004516a1
2021-09-20 23:47:24 +01:00
Colin Cross
0abff32886 Merge "Add support for d8 --main-dex-rules" am: 80bb3164b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829133

Change-Id: Ib105939a0e11dae97b40cf003c75808ee1d879ec
2021-09-20 20:37:51 +00:00
Colin Cross
80bb3164b9 Merge "Add support for d8 --main-dex-rules" 2021-09-20 20:22:44 +00:00
Colin Cross
a1ff7c6926 Enable compose kotlinc plugin when depending on the compose runtime
When a module depends on the compose runtime add a -Xplugin argument
to the kotlinc flags that enables the compose compiler plugin.

Bug: 196351110
Test: TestKotlinCompose
Change-Id: I423a3c4d12df42804a24b672a40a165bc8dd165f
2021-09-20 09:12:42 -07:00
Treehugger Robot
45dd37c6e3 Merge "Add test to TestJavaStableSdkVersion for legacy core platform" am: 3769a27c5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655611

Change-Id: I752f24a2e6b9763019866402a8af6adb3e96ee2a
2021-09-20 14:20:18 +00:00
Treehugger Robot
3769a27c5e Merge "Add test to TestJavaStableSdkVersion for legacy core platform" 2021-09-20 14:04:35 +00:00
Anton Hansson
f8ea3729ca Add back the api_srcs argument
This arg provides the ability to pass sources to the metalava
invocations that are part of a java_sdk_library without affecting
the runtime library.

This is useful in various scenarios, e.g.: when javadoc in some source
files affects the metalava behavior. For example, the javadoc-generation
javadoc tags @paramDoc, @returnDoc etc. Passing these as a library does
not work because class files do not contain javadoc.

Bug: 186197911
Test: manually inspect module stub src for doc enhancements
Merged-In: I2ce98f891283514e1896c52d9335550c1f5435fb
Change-Id: I2ce98f891283514e1896c52d9335550c1f5435fb
2021-09-17 13:42:44 +00:00
Jiakai Zhang
23a5cba0af Merge changes I9c94a54a,Idc0c73a7 am: 2c6ede11cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824513

Change-Id: I1f3ce39cd3b3988e676791a59f0c70e2bc80015d
2021-09-17 11:33:22 +00:00
Jiakai Zhang
dc2c1c2625 Merge "Revert^2 "Preopt APEX system server jars."" am: c9f9d56ed4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1828115

Change-Id: I2a991341934af96455f136cbe44ef824f5e3e7f5
2021-09-17 11:33:13 +00:00
Jiakai Zhang
2c6ede11cc Merge changes I9c94a54a,Idc0c73a7
* changes:
  Preopt system server jars with updatable bootclasspath.
  Preopt APEX system server jars from prebuilts.
2021-09-17 11:20:10 +00:00
Jiakai Zhang
c9f9d56ed4 Merge "Revert^2 "Preopt APEX system server jars."" 2021-09-17 11:19:51 +00:00
Colin Cross
5ea963e60a Add support for d8 --main-dex-rules
d8 supports --main-dex-rules to replace the old mainDexClasses
script.

Test: m checkbuild
Change-Id: Ieddcf4de50cc13509c06bbffe9f1314ee3dd23b6
2021-09-16 19:14:30 -07:00
Martin Stjernholm
44cbc71c78 Merge "Remove fallback code path for missing BCP fragments that is no longer necessary." am: 33ce5d6c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821658

Change-Id: I145f398e8b22cca8e9e91a62d83cbb2014032261
2021-09-16 14:48:57 +00:00
Martin Stjernholm
33ce5d6c0e Merge "Remove fallback code path for missing BCP fragments that is no longer necessary." 2021-09-16 14:38:01 +00:00
Treehugger Robot
1bf0694fbf Merge "Prevent systemserverclasspath_fragment from depending on prebuilts" am: a66a9f1a14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818248

Change-Id: I49ac420f4fc5b9220d1ff57b6c55a6a9d271c5d0
2021-09-16 11:35:43 +00:00
Paul Duffin
25322e4d98 Prevent systemserverclasspath_fragment from depending on prebuilts
When TARGET_BUILD_APPS is set then TARGET_BUILD_USE_PREBUILT_SDKS=true
which causes all java_sdk_library_import modules to be treated as
prefer:true.

That breaks the build when the systemserverclasspath_fragment's content
property references a source java_sdk_library module that has a
corresponding java_sdk_library_import prebuilt module.

This fixes the issue by marking the dependency from the
systemserverclasspath_fragment to the source module as one that must
not be replaced with a reference to the prebuilt module.

Test: - update art prebuilts to include service-art
      m TARGET_BUILD_APPS=Calendar apps_only
      - fails before, works afterwards
Bug: 199116972
Change-Id: Ia2d8ce7bb7e644336a42c901f7fb8ea50fd67909
2021-09-16 11:12:51 +01:00
Paul Duffin
1ea7c9fa52 Add test to TestJavaStableSdkVersion for legacy core platform
Adds a test case to TestJavaStableSdkVersion for the case where a
module uses sdk_version: "core_platform" but is in the list of modules
that can use the legacy version.

This required storing the lookup map in the Config to allow it to be
customized for the test.

Bug: 180399951
Test: m nothing
Change-Id: I404705c3fd8a559649c6ab2624856cf78f49f85c
2021-09-16 11:12:43 +01:00
Jiakai Zhang
519c5c82e5 Revert^2 "Preopt APEX system server jars."
This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
2021-09-16 06:25:26 +00:00
Martin Stjernholm
b1e61cb8bc Remove fallback code path for missing BCP fragments that is no longer
necessary.

#codehealth

Test: m nothing
Bug: 179354495
Change-Id: Iaddf163e69b52cef82d522311e81bef9bdb4aa8d
2021-09-16 00:55:53 +01:00
Adrian Roos
755a09490f Merge "Revert "Preopt APEX system server jars."" am: 79839d94c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827535

Change-Id: I2281010a93a89b69b859272627c7eac0d7e6d3ed
2021-09-15 14:53:58 +00:00
Adrian Roos
79839d94c1 Merge "Revert "Preopt APEX system server jars."" 2021-09-15 14:31:42 +00:00
Adrian Roos
92346c4832 Revert "Preopt APEX system server jars."
This reverts commit ca9bc98e0c.

Reason for revert: breaks build
Bug: 200024131

Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
2021-09-15 14:11:07 +00:00
Paul Duffin
063ad070c0 Merge "Rename SdkMemberTypeDependencyTag to SdkMemberDependencyTag" am: c2c7f3e49b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826225

Change-Id: I304997b8488094a28ef8b75baaf0d9c4341b1512
2021-09-15 13:44:01 +00:00
Paul Duffin
c2c7f3e49b Merge "Rename SdkMemberTypeDependencyTag to SdkMemberDependencyTag" 2021-09-15 13:29:23 +00:00
Jiakai Zhang
83d0d8ac1c Preopt APEX system server jars. am: ca9bc98e0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821984

Change-Id: If42b905c0636b10881b372efafd3e2f9bc84923c
2021-09-15 10:48:53 +00:00
Jiakai Zhang
02669e8a30 Preopt system server jars with updatable bootclasspath.
Previously, we preopt system server jars without updatable bootclasspath
in the build system so that the artifacts can keep valid after a
mainline update. Things have been changed after then. We now re-compile
system server jars on the user's device after a mainline update
(b/189467174), so we no longer need the artifacts generated at build
time to keep valid. Therefore, we can preopt system server jars with
updatable bootclasspath to achieve better performance.

Bug: 199573699
Test: m services
Test: manual - 1. Build a system image and flash it into a device.
  2. adb root && adb shell grep "services" /proc/`adb shell pidof system_server`/maps
  3. See "/system/framework/oat/x86_64/services.{odex,vdex,art} in the
  output.
  4. adb logcat -d odrefresh:D odsign:D "*:S"
  5. See "odrefresh said artifacts are VALID" and no dex2oat invocation
  in the output.

Change-Id: I9c94a54aa15c46708067f4bc89ff05bc7af32a7b
2021-09-15 09:01:07 +00:00
Jiakai Zhang
ca9bc98e0c Preopt APEX system server jars.
The path to the artifacts will in the form of
/system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art},
where <encoded-jar-path> is the path to the jar file with "/" replaced
by "@". For example,
/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex

There will be a follow-up CL to update ART runtime to recognize
artifacts in that path.

Test: m com.android.art
Bug: 194150908
Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
2021-09-15 09:01:07 +00:00
Jiakai Zhang
204356f3b5 Preopt APEX system server jars from prebuilts.
Similar to the previous CL, but for jars from prebuilts.

Test: manual - 1. Patch aosp/1818020 and aosp/1810840.
  2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Bug: 194150908
Change-Id: Idc0c73a78045a602ad3a91cb5071d291bd611015
2021-09-15 09:01:07 +00:00
Treehugger Robot
32e5355bab Merge "Fix panic when a module has an invalid output path" am: cf6749630a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826960

Change-Id: I972bbb9b99121e1ee4ffb33c0278f239dd61db8f
2021-09-15 04:37:54 +00:00
Treehugger Robot
cf6749630a Merge "Fix panic when a module has an invalid output path" 2021-09-15 04:23:13 +00:00
Cole Faust
64cb7c964a Fix panic when a module has an invalid output path
dep.OutputFile().Path() can panic if the OutputFile
is invalid, so move more of the code into the check
for validity. This changes the go crash into a
build error.

Bug: 158624492
Test: Apply the patchset 1 of ag/11815659, lunch aosp_x86_64-eng, m
Change-Id: Ic8a728be1b570ac73be7b2b9461676f9fd99c266
2021-09-14 17:35:19 -07:00
Treehugger Robot
7b3130a459 Merge "Add {.aar} support for android_library" am: db3ff57368
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826617

Change-Id: I2404648a8bdea49d13f2c747a75b82002ee172b5
2021-09-15 00:23:18 +00:00
Saeid Farivar Asanjan
1fca301bd2 Add {.aar} support for android_library
Change-Id: I2c392d3dfc545c23495b03d0f236680fd59e1401
2021-09-14 21:02:43 +00:00
Paul Duffin
f7b3d0d317 Rename SdkMemberTypeDependencyTag to SdkMemberDependencyTag
Bug: 195754365
Test: m nothing
Change-Id: Id4ef6f8be54c60a1f269d7e7c46a8dcb715fcca4
2021-09-14 17:26:14 +01:00
Ulyana Trafimovich
b8e95806f8 Merge changes I4e7aa1a3,Ic0cd2411 am: 2e380e7971
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815791

Change-Id: Ie2a5d819d9e9e76a349c6b2e576e09b4c4551895
2021-09-02 15:44:57 +00:00
Ulyana Trafimovich
2e380e7971 Merge changes I4e7aa1a3,Ic0cd2411
* changes:
  Fix DONT_UNCOMPRESS_PRIV_APPS_DEXS for `android_app_import`.
  Add tests for uncompressed dex for `android_app_import`.
2021-09-02 15:20:58 +00:00
Ulya Trafimovich
0061c0d1da Fix DONT_UNCOMPRESS_PRIV_APPS_DEXS for android_app_import.
Don't uncompress priv-app dex for `android_app_import` if
DONT_UNCOMPRESS_PRIV_APPS_DEXS is true. Update expected test results.

Bug: 194504107
Test: m nothing
Change-Id: I4e7aa1a3deea856f388ae5ecd9292301f8a09a2f
2021-09-01 15:44:50 +01:00
Ulya Trafimovich
55f72d706d Add tests for uncompressed dex for android_app_import.
Some of the test cases for privileged apps currently produce incorrect
results (e.g. with DONT_UNCOMPRESS_PRIV_APPS_DEXS := true); they are
marked with TODO and will be fixed in a follow-up CL.

Bug: 194504107
Test: m nothing
Change-Id: Ic0cd24113a27850a967afa0b3deb4a6324f95347
2021-09-01 15:44:28 +01:00
Treehugger Robot
05ac706e6f Merge "Refactor SdkMemberType.AddDependencies()" am: a36ffdead5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808897

Change-Id: I0535c811329b9101059bf9a8953ee203335d2cb4
2021-08-31 19:08:38 +00:00
Treehugger Robot
a36ffdead5 Merge "Refactor SdkMemberType.AddDependencies()" 2021-08-31 18:53:59 +00:00
Spandan Das
ab47a767d8 Merge "Skip dexbootjar check using AllowMissingDependencies flag" am: b7e5985fd5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803934

Change-Id: I55ae4c5858330385876eb42e0fa16773ca748150
2021-08-31 16:12:21 +00:00
Paul Duffin
296701e35b Refactor SdkMemberType.AddDependencies()
Replaces the BottomUpMutatorContext parameter with a new
SdkDependencyContext type that extends BottomUpMutatorContext. This is
to allow the sdk to pass additional information to the implementations
of that method to allow the behavior to be more finely tuned.

Bug: 195754365
Test: m nothing
Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
2021-08-31 17:07:07 +01:00
Spandan Das
b7e5985fd5 Merge "Skip dexbootjar check using AllowMissingDependencies flag" 2021-08-31 16:06:10 +00:00
Treehugger Robot
e29c1e9a9c Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/soong" am: cc1990f564
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811859

Change-Id: I1f14f7e37557af3be87f8c322fc02d433cb79b4a
2021-08-27 21:56:22 +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
Lukács T. Berki
8526bc95ef Merge "Rename BuildDir and NinjaBuildDir." am: 5602d33025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1810356

Change-Id: I6af3316fb122af7a05b71de7f9cd371746bb5f21
2021-08-27 13:54:13 +00:00
Lukacs T. Berki
9f6c24a887 Rename BuildDir and NinjaBuildDir.
These are just out/ and out/soong/ and the old names were quite
confusing.

Test: Presubmits.
Merged-In: I999ca62162062f27e449f83ffb00fa580d4065b8
Merged-In: I2fcd80a9e376a6842a06aa104a9f6f5c5e16f8c7
Change-Id: Ib481d2aac40df8da1b74174dc8ec576c1cb48be0
2021-08-27 10:08:49 +02:00
Spandan Das
10ea4bf9d4 Skip dexbootjar check using AllowMissingDependencies flag
Soong checks that every module part of a bootclass_fragment provides a
dex boot jar file, even if the module is not a dependency of vendor.img

Using AllowMissingDepdencies() to skip this check allows vendors to be
more aggressive in removing projects from their source tree

Test: In build/soong, run go test ./...
Test: m nothing
Bug: 196306898
Bug: 192616764
Change-Id: I78b062afdc19a6a3251aa8552230f3fcf334b6fb
2021-08-27 02:54:07 +00:00
satayev
dbd6abe28d Merge "Make sure that classpath fragment contents appear in make vars." am: 28e5eda261
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1740313

Change-Id: I216856a16603567c623114d3b5b42506e9dc89b2
2021-08-24 13:40:05 +00:00
satayev
28e5eda261 Merge "Make sure that classpath fragment contents appear in make vars." 2021-08-24 13:29:58 +00:00
Ulyana Trafimovich
affc7d8116 Merge "Don't add uses_libs/optional_uses_libs to the manifest_fixer." am: 81a1adb6db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803744

Change-Id: Id5c9f8a14ddd00eaedde4d404d4773fc2c214c1a
2021-08-24 09:46:13 +00:00
Ulya Trafimovich
0b1c70efbc Don't add uses_libs/optional_uses_libs to the manifest_fixer.
These properties specify libraries that cannot be implicitly inferred by
Soong. If these properties are added to Android.bp, this can only be for
the reason that there is a <uses-library> tag in the manifest which is
unknown to the build system. Adding them to the manifest_fixer doesn't
make sense: if they are not in the manifest, they should be removed from
Android.bp as well.

Bug: 132357300
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
      $ adb wait-for-device && adb root && adb logcat \
        | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
        # empty grep output, no errors
Change-Id: Ic6eb5268a954ef3be7f06a181ec72af99000c547
2021-08-20 15:54:42 +01:00
Ulyana Trafimovich
53dc040a2b Merge "Propagate <uses-library> dependencies from java_library to apps." am: abcce6f1c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1799761

Change-Id: Ie123fec13c88ec20e79d9e688f31468764ab01d5
2021-08-19 09:29:15 +00:00
Ulyana Trafimovich
abcce6f1c3 Merge "Propagate <uses-library> dependencies from java_library to apps." 2021-08-19 09:14:33 +00:00
Liz Kammer
680bd2dd0a Merge "Don't create a new module for bp2build conversion." am: 380dbb9327
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792714

Change-Id: Ie7d6d5908d06f14121691f7aa0f57c7c7303e67a
2021-08-18 19:44:01 +00:00
Liz Kammer
380dbb9327 Merge "Don't create a new module for bp2build conversion." 2021-08-18 19:28:20 +00:00
Ulya Trafimovich
e4432874a9 Propagate <uses-library> dependencies from java_library to apps.
Automatically add `uses_libs`/`optional_uses_libs` properties specified
in `java_library` modules to the apps that transitively depend on these
libraries.

Note that a library may choose to specify its <uses-library> deps as
either optional or required. If this is not the right choice for an app,
it should be able to override it by specifying its own `uses_libs`/
`optional_uses_libs` properties.

Add Soong tests to cover the new cases.

Bug: 196377222
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I601f3e2830ed9699b78d911966ee70812d32b4f6
2021-08-18 16:57:11 +01:00
Aurimas Liutikas
39e4a5170a Merge "Propagate <uses-library> dependencies from android_library to apps." am: 91436f469a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1798212

Change-Id: Iba9ef35a2af0b78a4ef093070e048af2a44d9f83
2021-08-17 23:04:32 +00:00
Liz Kammer
2ada09a546 Don't create a new module for bp2build conversion.
A performance improvement for bp2build as Blueprint/Soong no longer have
the overhead of additional modules. The creation of these modules
results in:
* traversal of additional modules for each subsequent mutator
* synchronization over a go channel to collect newly created modules:
https://cs.android.com/android/platform/superproject/+/master:build/blueprint/context.go;l=2594,2600;drc=1602226f23181b8c3fbfcaf3358f0297e839d7d3

We avoid both of these by storing the information directly in the
underlying module.

Also as a fringe benefit, removes some necessary boilerplate for
conversion.

For benchmarks, reduces runtime ~1% for 1% converted, ~24% for 100%
converted. See more: go/benchmarks-for-https:-r.android.com-1792714

Test: ran benchmarks/tests in bp2build
Test: build/bazel/ci/bp2build.sh
Change-Id: Ie9273b8cbab5bc6edac1728067ce184382feb211
2021-08-17 15:57:09 -04:00
Ulya Trafimovich
42c7f0d173 Propagate <uses-library> dependencies from android_library to apps.
Automatically add `uses_libs`/`optional_uses_libs` properties specified
in `android_library` modules to the apps that transitively depend on
these libraries.

Note that a library may choose to specify its <uses-library> deps as
either optional or required. If this is not the right choice for an app,
it should be able to override it by specifying its own `uses_libs`/
`optional_uses_libs` properties.

Bug: 196377222
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I1e36c56719c0023dcd25fa6aeb92016471702b9f
2021-08-17 16:58:20 +01:00
satayev
d34eb0c4a6 Make sure that classpath fragment contents appear in make vars.
The source of truth for what jars are in BOOTCLASSPATH and
SYSTEMSERVERCLASSPATH is make; adding a classpath fragment in soong
with a new jar in the contents without having it declared in make
is wrong (excluding test apexes).

Bug: 191369843
Test: m nothing
Change-Id: Ifd313776ee7ad206031244534ed3870126e4f835
2021-08-16 12:00:25 +01:00
Xin Li
3eaa6bcecf Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I10ff6a5df76852f0a22fe3ac22df764528f07423
Change-Id: I71f2397f425a46d346e49ac422d256d7e049c7a2
2021-08-14 06:30:56 +00:00
Aurimas Liutikas
15c82a10de Merge "Fix the way manifest fixer detects optional <uses-library> entries." 2021-08-13 21:00:35 +00:00
Ulya Trafimovich
fc0f6e34ce Fix the way manifest fixer detects optional <uses-library> entries.
Previously manifest_fixer used a naive way to distiniguish optional libs
from required ones: it checked if a library is on the list of optional
compatibility libraries. This works for compatibility libs, but not for
other libs.

Now we properly track optionality through all stages of the build,
starting with the addition of the library as a dependency (here's where
the `uses_libs`/`optional_uses_libs` distinction kicks in), store it in
dependency tag and propagate to class loader context, and from there to
the manifest_fixer.

The tests have been updated accordingly.

Bug: 196377222
Test: lunch bertha_x86_64-userdebug && m droid dist cts mts
Change-Id: I3631ce59ebe47116ce7a9b3d33a86f636846ef0f
2021-08-13 16:10:42 +01:00
Paul Duffin
d483d1ac66 Merge "Filter blocked entries from modular flag files" am: 1f0cc77010 am: 78fc6dc40a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788095

Change-Id: I377eee1d14a930d00f944522d1cc71cd43411175
2021-08-11 19:07:45 +00:00
Paul Duffin
1f0cc77010 Merge "Filter blocked entries from modular flag files" 2021-08-11 18:36:37 +00:00
satayev
4d566bea9b Merge "Fix tests to use correct fixtures for configuring (Apex)BootJars." am: 721f42d12a am: 9958b36643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1787998

Change-Id: Id9248b6b54547e55c28bb386c867294ec20df873
2021-08-11 16:42:47 +00:00
Paul Duffin
280bae6d20 Filter blocked entries from modular flag files
Previously, the sdk snapshot would include all the entries from the
stub-flags.csv and all-flags.csv modular files generated by a single
bootclasspath_fragment. That included implementation details, i.e.
class members that are not part of a stable API or the hidden API which
meant that the sdk snapshots were implementation dependent.

This change removes the implementation details from the modular flag
files, i.e. those entries that are only marked as "blocked". When
comparing the files against the corresponding subset of the monolithic
files it assumes that any entries missing from the modular flag files
are blocked.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: I6b67b2253cf029d6830b58a06ebb0c8fcaa0dd71
2021-08-11 17:29:47 +01:00
satayev
721f42d12a Merge "Fix tests to use correct fixtures for configuring (Apex)BootJars." 2021-08-11 16:13:20 +00:00
Colin Cross
390babfeae Merge "Collect lint reports from apps in apexes" am: 7131982a76 am: 3dc9d726ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792871

Change-Id: Ibc44f45a5a8a5ecb977943a2beb26e6e1e465862
2021-08-11 14:44:08 +00:00
Colin Cross
8355c1524f Collect lint reports from apps in apexes
Lint reports were only being collected from jars in apexes, not
apps.

Bug: 188772607
Test: mainline_modules_arm64 build
Change-Id: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
2021-08-10 19:25:59 -07:00
satayev
abcd59731e Fix tests to use correct fixtures for configuring (Apex)BootJars.
This is in preparation to r.android.com/1740313 where setting correct
variables would be enforced (i.e. apex and non-apex boot jars must be in
config.ApexBootJars and config.BootJars correspondingly).

Bug: 191369843
Test: m nothing
Change-Id: Ic86680c1f7af53d229083b2cc58beb3ceccb4b6a
2021-08-10 15:35:52 +01:00
Colin Cross
f1a6c775c2 Merge "Reland: Pass jars with resources to R8" am: 795a9f99f4 am: bb5e173587
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788754

Change-Id: I77b353b14f7f86b36ce7db8cc946a9c11c4f6b81
2021-08-06 19:15:47 +00:00
Colin Cross
795a9f99f4 Merge "Reland: Pass jars with resources to R8" 2021-08-06 18:33:23 +00:00
Colin Cross
f2b08a4d4e Merge changes Ia0c3826a,I92ad6635 am: 03349188bc am: f1338a63f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788753

Change-Id: I0c3816d2606531aa25e35c433719876a52df511c
2021-08-06 18:17:43 +00:00
Colin Cross
03349188bc Merge changes Ia0c3826a,I92ad6635
* changes:
  Revert "Time out and dump stacks from R8 processes after 30 minutes"
  Add more debugging to run_with_timeout
2021-08-06 17:47:49 +00:00
Paul Duffin
9569137e33 Export signature patterns to sdk snapshot am: 8d007e9919 am: 3e2c442d58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788092

Change-Id: I196e1c4f176c7c3b6b43fd9fd3cfa193a6c1d0f7
2021-08-06 16:39:20 +00:00
Paul Duffin
b32b624d71 Separate creation of signature patterns from overlap checking am: 67b9d61ac2 am: 0623c3e8f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788091

Change-Id: If9d75256940429dbf6890ca5a07d1806b81e6c53
2021-08-06 16:39:14 +00:00
Paul Duffin
8d007e9919 Export signature patterns to sdk snapshot
Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: Ic819def9b0c41e3b22fb98582cd39f6d27080a32
2021-08-06 14:11:14 +01:00
Paul Duffin
67b9d61ac2 Separate creation of signature patterns from overlap checking
Previously, the signatures used to select the subset of the monolithic
flags were simply the signatures read from the modular flags file. This
change moves the creation of the signature list into a separate script
that outputs the signatures to a file and then passes the path through
Soong from the bootclasspath_fragment modules that create it to the
platform_bootclasspath module that uses it to compare the modular
flags against the monolithic flags.

Currently, the signatures are the full signatures but follow up changes
will replace them with patterns (hence the name) that avoids having to
include implementation details in the hidden API flags that are output
as part of a bootclasspath_fragment's snapshot.

This change moves the stub flags related code next to the all flags
related code as they are treated in a similar way.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: I2855bf6d05c91b8a09591664185750361c7e644f
2021-08-06 13:40:34 +01:00
Colin Cross
a79a52c7c4 Reland: Pass jars with resources to R8
R8 will parse proguard files out of resources in injars.  Use the jar
with resources instead of the classes jar so that R8 can see the
proguard files.

R8 fails when an input jar contains dex files, so filter out dex files
from the input jar before passing it to r8.

This relands Ibb870ee9c70470336f542a3b7542dab86716dbf8 with a fix to
move the temporary input jar outside the output directory.  Putting it
in the output directory interacted poorly with RBE in local comparison
mode, which incorrectly deleted the output directory.

Bug: 195558228
Test: m checkbuild
Change-Id: Id4b091c3bd72d4c2904883e8793ec4b9499e4b78
2021-08-05 23:16:38 -07:00
Colin Cross
a832a04db2 Revert "Time out and dump stacks from R8 processes after 30 minutes"
This reverts commit 29c294b2cf.

The deadlock in R8 was fixed, and the timeout causes problems when
RBE is enabled and the R8 action gets stuck in a queue for 30
minutes.

Test: checkbuild
Change-Id: Ia0c3826aea3288e9db3bdbd4955e1e16c0a38fe3
2021-08-05 17:04:06 -07:00
Colin Cross
4175ce628e Merge "Revert "Pass jars with resources to R8"" am: 93fb53f5d0 am: e8332a9fde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788367

Change-Id: I97069bca283f0f68c4f14ad1db15ea6ca3254b86
2021-08-05 15:54:07 +00:00
Colin Cross
93fb53f5d0 Merge "Revert "Pass jars with resources to R8"" 2021-08-05 15:25:25 +00:00
Colin Cross
1d73c7316c Revert "Pass jars with resources to R8"
This reverts commit 05ca7c8769.

Reason for revert: b/195644067

Flaky failure with "missing in.jar" error.

Change-Id: Id2d6452de1e43951bc58f0bfb8e20d5ad65ce830
2021-08-05 15:16:11 +00:00
Colin Cross
a818133f24 Merge "Pass jars with resources to R8" am: ac33aac0aa am: 7f47b50ef6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1786607

Change-Id: Id5782f3903cf4b29e22da3f0ee4ab3f0c6e518a4
2021-08-05 02:11:16 +00:00