Commit Graph

5395 Commits

Author SHA1 Message Date
Treehugger Robot
7287308ee0 Merge "Add {.aar} support for android_library" am: db3ff57368 am: 7b3130a459 am: 7181c70efb am: bc1de88b71 am: 8cbe142522
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826617

Change-Id: Idb6f92bd3aa34f899573b752d69068ee5c4fcc83
2021-09-15 00:58:43 +00: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
Ulyana Trafimovich
b8e2ddff2a Merge changes I4e7aa1a3,Ic0cd2411 am: 2e380e7971 am: b8e95806f8 am: f26abe2744 am: 3ed3b56945 am: abfd639a19
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815791

Change-Id: Ida93df21b78a70d36c007acad91ddb4ac1e55107
2021-09-02 16:43:01 +00: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
b853ecc4ef Merge "Refactor SdkMemberType.AddDependencies()" am: a36ffdead5 am: 05ac706e6f am: d8269ba38e am: ca6392382e am: 05f8c679a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808897

Change-Id: I98dcce7da0b466192658945a0ec2ef67efba9119
2021-08-31 20:24:51 +00: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
841764eb92 Merge "Skip dexbootjar check using AllowMissingDependencies flag" am: b7e5985fd5 am: ab47a767d8 am: 572842e09c am: e0eaa06d87 am: 716ecba7ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803934

Change-Id: Id970ee5cfb571ca78395ea66bfc5e23ff9df5fd2
2021-08-31 17:25:44 +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
04b819feed Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/soong" am: cc1990f564 am: e29c1e9a9c am: 4c2796f833 am: 8565e0232f am: 4758122721
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811859

Change-Id: I5da1febeeca68d0256e495571a63613680a72792
2021-08-27 22:59:27 +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
756fec0730 Merge "Make sure that classpath fragment contents appear in make vars." am: 28e5eda261 am: dbd6abe28d am: 0242867683 am: 7c61cc419d am: d95abdfbe5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1740313

Change-Id: I3e4c83daf817472de3d7e8a2112a8ad863aafda3
2021-08-24 14:33:53 +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
0887de0b21 Merge "Don't add uses_libs/optional_uses_libs to the manifest_fixer." am: 81a1adb6db am: affc7d8116 am: 4870f2b0cb am: ade9fe9d53 am: 628884193c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803744

Change-Id: Id0d1b326a41cc7873aafe43351c3131e0f3f9d7d
2021-08-24 10:57:09 +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
Lukacs T. Berki
fbaf725ed3 Rename BuildDir and NinjaBuildDir.
These are just out/ and out/soong/ and the old names were quite
confusing.

Test: Presubmits.
Change-Id: I999ca62162062f27e449f83ffb00fa580d4065b8
2021-08-23 13:46:17 +02: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
09603cd709 Merge "Propagate <uses-library> dependencies from java_library to apps." am: abcce6f1c3 am: 53dc040a2b am: 78f4fc153c am: 548ed2ae0c am: bd7a74ab9c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1799761

Change-Id: I9e653e53855c8161ba67332061f9da5dce53f591
2021-08-19 10:28:54 +00: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
b3d37ab653 Merge "Don't create a new module for bp2build conversion." am: 380dbb9327 am: 680bd2dd0a am: 429f29b360 am: d97dfbe9e6 am: 1637e4345f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792714

Change-Id: If86018fe24efdb5bbe5cce50bc20b58e0f17ded6
2021-08-18 20:32:57 +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
9b66673a5f Merge "Propagate <uses-library> dependencies from android_library to apps." am: 91436f469a am: 39e4a5170a am: a2bc6f1afa am: 16aeb5167e am: 4d519d9d5a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1798212

Change-Id: I484a7a13ddb79e8c40f4a547c0f78fb4d6514554
2021-08-18 00:49:28 +00: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
e92bc9fcbd Merge "Fix the way manifest fixer detects optional <uses-library> entries." am: 15c82a10de am: 4926ea3b85 am: 75b5b21ad2 am: 237d9d0ba2 am: 27a5a91bfe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1794528

Change-Id: I204e6ed4fabf468ae74a59ec0db19726c4284415
2021-08-13 22:46:31 +00:00
Aurimas Liutikas
75b5b21ad2 Merge "Fix the way manifest fixer detects optional <uses-library> entries." am: 15c82a10de am: 4926ea3b85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1794528

Change-Id: I34c6ec166ad18df7e215efe1130b0319db3723eb
2021-08-13 21:50:36 +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
4755baf365 Merge "Filter blocked entries from modular flag files" am: 1f0cc77010 am: 78fc6dc40a am: d483d1ac66 am: 3942461ef6 am: ac6de1f2d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788095

Change-Id: I9bc4592e14ca9ab51ad281c26d72005a292ddc5c
2021-08-11 19:50:51 +00: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
b438641e04 Merge "Fix tests to use correct fixtures for configuring (Apex)BootJars." am: 721f42d12a am: 9958b36643 am: 4d566bea9b am: e0a651cd6f am: 6e259ef3b0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1787998

Change-Id: Iffb91c2f1504bd94071ef55cdfd1457880884e7a
2021-08-11 17:22:39 +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