Commit Graph

488 Commits

Author SHA1 Message Date
Ivan Lozano a072c5ae56 Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a am: 001c11e93a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: Ifff15886dba6bda0754d086456a1db3b7524e4ed
2021-05-12 21:13:41 +00:00
Ivan Lozano 001c11e93a Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: I2826cb9898e093f5669700c8d98e314b445ee639
2021-05-12 20:55:58 +00:00
Ivan Lozano d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Jiyong Park e5ec499aa2 Merge "SdkSpec is fully using ApiLevel" am: f398995a64 am: fe24728dc9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663140

Change-Id: Idf353e3d18b3d4831d08d71cc718f305da8995e6
2021-04-14 14:42:56 +00:00
Jiyong Park dbd710c426 SdkSpec is fully using ApiLevel
Previously, SdkSpec was constructed only from the user string. It didn't
make use of the Config struct where information about the latest stable
SDK version, etc. is recorded. As a result, the build system couldn't
check if the sdk version "current" is referring to the in-development
(i.e.  not-yet-frozen) SDK version or the latest stable version.
"current" was always assumed to be in-development (IsPreview() returns
true) even when Platform_sdk_final == true.

As the first step for fixing that, this change requires
android.EarlyModuleContext to be passed when constructing SdkSpec from
the user string.

In the following changes, "current" will be mapped to either
FutureApiLevel (10000) or one of the FinalApiLevels() depending on
whether the platform SDK was finalized or not.

Bug: 175678607
Test: m
Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
2021-04-12 13:46:21 +09:00
Jiyong Park 9231537fe2 SdkSpec is fully using ApiLevel
Previously, SdkSpec was constructed only from the user string. It didn't
make use of the Config struct where information about the latest stable
SDK version, etc. is recorded. As a result, the build system couldn't
check if the sdk version "current" is referring to the in-development
(i.e.  not-yet-frozen) SDK version or the latest stable version.
"current" was always assumed to be in-development (IsPreview() returns
true) even when Platform_sdk_final == true.

As the first step for fixing that, this change requires
android.EarlyModuleContext to be passed when constructing SdkSpec from
the user string.

In the following changes, "current" will be mapped to either
FutureApiLevel (10000) or one of the FinalApiLevels() depending on
whether the platform SDK was finalized or not.

Bug: 175678607
Test: m
Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
2021-04-08 11:27:24 +09:00
Treehugger Robot 76e7452f48 Merge "Set the usesNonSdk manifest attribute whan targeting module SDKs." am: 4238c5fe07 am: c952e7fad6 am: 855b5768cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1657320

Change-Id: I4b500f3da2e6c39832ae4c93de6b4eb8667096d7
2021-04-06 19:55:03 +00:00
Treehugger Robot 855b5768cc Merge "Set the usesNonSdk manifest attribute whan targeting module SDKs." am: 4238c5fe07 am: c952e7fad6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1657320

Change-Id: Id9f34cbaf176160d68b31bf63e92c5144ecefea9
2021-04-06 19:29:20 +00:00
Treehugger Robot 4238c5fe07 Merge "Set the usesNonSdk manifest attribute whan targeting module SDKs." 2021-04-06 18:25:12 +00:00
Treehugger Robot dd62393313 Merge changes Id33bf640,I4d67b9b9 am: 8c56183fb7 am: b17e061ae9 am: a7fe23c458
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663139

Change-Id: Ic1434fc150e802f3a6e8b58a9a6f3e16e93da146
2021-04-06 05:29:49 +00:00
Treehugger Robot a7fe23c458 Merge changes Id33bf640,I4d67b9b9 am: 8c56183fb7 am: b17e061ae9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663139

Change-Id: I0128e2d5bf70a7cce8b16b78a62434c819b09de4
2021-04-06 04:42:35 +00:00
Lorenzo Colitti fa9b3f30fd Set the usesNonSdk manifest attribute whan targeting module SDKs.
From an ART perspective, calling module-lib APIs requires the
ability to bypass hiddenapi enforcement entirely. This CL ensures
that if an APK compiles against module-lib APIs, it will be able
to call those APIs. Currently, compiling against module-lib APIs
is not safe because APKs that are subject to hiddenapi protection
will crash at runtime.

Bug: 181309531
Test: made NetworkStackNext compile against module-current, and:
Test: aapt dump xmltree .../NetworkStackNext.apk AndroidManifest.xml | grep usesNonSdk
Change-Id: I5ca3328c64412078d803e0e3ffa1d8383602416f
2021-04-05 22:53:41 +09:00
Jiyong Park 54105c48f4 SdkSpec = Scope + ApiLevel
SdkSpec.Version was an int type. Now it becomes ApiLevel type which
is a better abstraction of the version (or api level).

Bug: 1655587
Test: m

Change-Id: I4d67b9b9eae45f653b6af4f5b73da9e091b3dfab
2021-04-05 09:32:06 +09:00
Jiyong Park 7f61ac4c8b Merge "Move java.sdkSpec to the android package" am: d4fa8fc107 am: 7ff95eca2f am: f19d2d57b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655587

Change-Id: I5c5d25a78c4f51876289dc450874d83c5a9c90b6
2021-04-03 13:16:03 +00:00
Jiyong Park f19d2d57b3 Merge "Move java.sdkSpec to the android package" am: d4fa8fc107 am: 7ff95eca2f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655587

Change-Id: I748c9c8d1eebacbd379121e32c54eff237ca0a80
2021-04-03 12:34:19 +00:00
Jiyong Park f1691d2a2c Move java.sdkSpec to the android package
... in preparation for making the handling of sdk versions consistent
across java and cc modules.

Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-04-03 08:25:12 +09:00
Ulyana Trafimovich f48877b046 Merge "Don't enforce <uses-library> checks if dexpreopt for apps is disabled." am: f682410cbf am: 1012c230b2 am: 42983b7316
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655690

Change-Id: Iea739178209de07d66eeab82794392d0ff378743
2021-03-29 18:26:54 +00:00
Ulyana Trafimovich 42983b7316 Merge "Don't enforce <uses-library> checks if dexpreopt for apps is disabled." am: f682410cbf am: 1012c230b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655690

Change-Id: Iabd8654c105f9db1ed18616127e90679f77938e4
2021-03-29 17:40:23 +00:00
Ulya Trafimovich 39dd0a4b87 Don't enforce <uses-library> checks if dexpreopt for apps is disabled.
Otherwise the check fails, as it depend on non-existent dexpreopt.config
files. This CL fixes broken build cf_x86_phone-userdebug_coverage.

Bug: 183931403
Bug: 132357300
Test: forrest build for cf_x86_phone-userdebug_coverage.
Change-Id: Id3ffeb742c1b82c677795fa701a7b5a867eabbbd
2021-03-29 14:57:34 +01:00
Ulyana Trafimovich 928c87711a Revert^2 "Don't depend on nonexistent manifest when manifest_check is disabled."
Reason for revert: relanding original change. The fix was to add AAPT to
the dependencies of the failed command. It didn't fail in AOSP, and on
some targets in sc-dev, because the build order happened to be different
and AAPT was built by the time it was needed. This also explains why
some builds oscillated between red and green.

Reverted Changes:
I52f00c9f4:Revert "Don't depend on nonexistent manifest when ...
I4c2d4e1c7:Revert "Reimplement verify_uses_libraries.sh in ma...
Ibebd616a7:Revert "Reimplement verify_uses_libraries.sh in ma...

Bug: 132357300
Bug: 183010666
Change-Id: I28b20308f4d68185af8ec15407b35ded1aaa2eb0
Test: treehugger
Test: forrest on git_sc-dev target aosp_blueline-userdebug
2021-03-18 11:43:06 +00:00
Ulyana Trafimovich ec22282610 Revert^2 "Reimplement verify_uses_libraries.sh in manifest_check.py."
Reason for revert: relanding original change. The fix was to add AAPT to
the dependencies of the failed command. It didn't fail in AOSP, and on
some targets in sc-dev, because the build order happened to be different
and AAPT was built by the time it was needed. This also explains why
some builds oscillated between red and green.

Reverted Changes:
I52f00c9f4:Revert "Don't depend on nonexistent manifest when ...
I4c2d4e1c7:Revert "Reimplement verify_uses_libraries.sh in ma...
Ibebd616a7:Revert "Reimplement verify_uses_libraries.sh in ma...

Bug: 132357300
Bug: 183010666
Change-Id: I6fd3935e951503b6c505b1e45b27bb8dc498665a
Test: treehugger
Test: forrest on git_sc-dev target aosp_blueline-userdebug
2021-03-18 11:42:53 +00:00
Ulyana Trafimovich 9d2c7978f2 Revert "Reimplement verify_uses_libraries.sh in manifest_check.py."
Revert submission 1614807-uses-libs-47

Reason for revert: broken build 7215516 on git_sc-dev \
  on aosp_blueline-userdebug

Reverted Changes:
Id1b66e4f3:Reimplement verify_uses_libraries.sh in manifest_c...
I386aa1a37:Reimplement verify_uses_libraries.sh in manifest_c...

Bug: 183010666
Change-Id: I4c2d4e1c7d865dabf31339d1a5f6aea09fdcd8ac
Test: treehugger
2021-03-17 19:21:38 +00:00
Ulyana Trafimovich 7c6c1f5c8b Revert "Don't depend on nonexistent manifest when manifest_check is disabled."
This reverts commit a76d6606ce.

Reason for revert: broken build 7215516 on git_sc-dev \
  on aosp_blueline-userdebug

Bug: 183010666
Change-Id: I52f00c9f4712dc5716be527cacd085b9f6e6e65a
Test: treehugger
2021-03-17 19:21:08 +00:00
Jaewoong Jung 300fd07df1 Merge "Improve java.go readability." am: 9f315dea28 am: b163cc04ce am: b348954705
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1627239

Change-Id: Ia988226bd3485f2e716c330fc65c914f6f068037
2021-03-17 16:19:00 +00:00
Treehugger Robot 1cf5826a85 Merge "Don't depend on nonexistent manifest when manifest_check is disabled." am: 8974f1706e am: da4eb03a9d am: 7be2dbdc41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640322

Change-Id: I6d8aeccc36dbe0853b07363d742920e52130d027
2021-03-17 16:18:45 +00:00
Ulyana Trafimovich 6256f66cd9 Merge "Reimplement verify_uses_libraries.sh in manifest_check.py." am: 2002bfa817 am: 8bd0efdef8 am: 072f40803f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614807

Change-Id: Ic40dfb25a6e02582ce1399f872cc149bf958cab4
2021-03-17 16:17:29 +00:00
Jaewoong Jung b348954705 Merge "Improve java.go readability." am: 9f315dea28 am: b163cc04ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1627239

Change-Id: Ia0b76e8b4bb0c366a9254052e2f2fe5bfc74701d
2021-03-16 22:34:59 +00:00
Jaewoong Jung 9f315dea28 Merge "Improve java.go readability." 2021-03-16 21:32:48 +00:00
Treehugger Robot 7be2dbdc41 Merge "Don't depend on nonexistent manifest when manifest_check is disabled." am: 8974f1706e am: da4eb03a9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640322

Change-Id: I493923edaea177492800a001dfd80a7d3ea17c3d
2021-03-16 21:11:26 +00:00
Ulya Trafimovich a76d6606ce Don't depend on nonexistent manifest when manifest_check is disabled.
This is a follow-up for https://android-review.googlesource.com/1614807.

Bug: 132357300
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Test: lunch qemu_trusty_arm64-userdebug && \
  m out/soong/.intermediates/packages/apps/DocumentsUI/DocumentsUI/android_common/DocumentsUI-unsigned.apk
Change-Id: I84c5d171bd976f35f342abd94b592506c71e4b1d
2021-03-16 15:34:50 +00:00
Ulyana Trafimovich 072f40803f Merge "Reimplement verify_uses_libraries.sh in manifest_check.py." am: 2002bfa817 am: 8bd0efdef8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1614807

Change-Id: I9a3125db222d9dc31cdc9241b04f4b3303326718
2021-03-16 14:45:33 +00:00
Jaewoong Jung bc15e3a798 Improve java.go readability.
Test: TreeHugger
Change-Id: I98bb7bddb740451ff2ccd28dcdaddff27e35a8cd
2021-03-15 13:58:44 -07:00
satayev b5c1a74f5d Merge "Don't track modules that are only available to APEXes." am: 2338d6f6e4 am: ebfe02a781 am: 13c655bf29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628693

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8794765359558cfee7c9d1cb2ef74674a244f283
2021-03-15 14:11:23 +00:00
Ulya Trafimovich 0aba252e15 Reimplement verify_uses_libraries.sh in manifest_check.py.
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh

Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.

Bug: 132357300

Test: lunch 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: Id1b66e4f3f30f307dba70cb111c7571762cb546a
2021-03-15 13:50:49 +00:00
satayev 13c655bf29 Merge "Don't track modules that are only available to APEXes." am: 2338d6f6e4 am: ebfe02a781
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1628693

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I468324eaa0ed012feba41cbf99809c8bd6ea397c
2021-03-15 13:28:54 +00:00
Artur Satayev 533b98cde3 Don't track modules that are only available to APEXes.
Modules that are not available for platform are developed with
updatability in mind, and do not require manual approvals.

Bug: 181223240
Test: checkbuild
Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
2021-03-11 18:13:18 +00:00
Jaewoong Jung bc098a5c26 Merge "Lineage properties support module references." am: 6df5e0307d am: c3df3c5396 am: 4bd1fc1763
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625101

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id5f3b9ab9ba11e274a4921a9ab07392b1bb891ff
2021-03-11 03:04:25 +00:00
Jaewoong Jung 4bd1fc1763 Merge "Lineage properties support module references." am: 6df5e0307d am: c3df3c5396
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625101

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8541e1e2aa1e9866e7616167f3305e2cd9c53419
2021-03-11 02:19:57 +00:00
Jaewoong Jung 1c1b6e6d95 Lineage properties support module references.
They should have had `android:"path"` tags attached so that users can
point them to filegroup modules.

Test: app_test.go & app_import_test.go
Bug: 182175153
Change-Id: I5580408488ffe5fc12c869cbfb7a468713dcbc96
2021-03-09 15:14:34 -08:00
Ulyana Trafimovich c22f36a4db Merge "Disable verify_uses_libraries check if dexpreopt is globally disabled." am: 35570c14ce am: 3d7489c1e1 am: 6afbccdbc8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615200

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id28e0bea7b5b114c8073fa8ebb289f29969b2968
2021-03-09 10:50:12 +00:00
Ulyana Trafimovich 6afbccdbc8 Merge "Disable verify_uses_libraries check if dexpreopt is globally disabled." am: 35570c14ce am: 3d7489c1e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615200

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4bc1508470878ca1cdefe4978854642001d029ab
2021-03-09 10:06:19 +00:00
Ulya Trafimovich 6e55ef157c Disable verify_uses_libraries check if dexpreopt is globally disabled.
Without dexpreopt the check is not necessary, and although it is good to
have, it is difficult to maintain on non-linux build platforms where
dexpreopt is generally disabled (the check may fail due to various
unrelated reasons, such as a failure to get manifest from an APK).

Bug: 181570790
Bug: 132357300
Test: m nothing
Change-Id: Ie012690e8f047ae9256e26565d162c19af4e8921
2021-03-04 18:40:40 +00:00
Ulyana Trafimovich 70de658eb1 Merge "Respect `provides_uses_lib` for modules added via `[optional_]uses_libs`" am: ae5cdfffa3 am: a9860b8a8f am: 939809b6ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609480

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b3a08efc7c173054d0530777f17a7aa3e0dd8d7
2021-03-03 00:23:29 +00:00
Ulyana Trafimovich 939809b6ce Merge "Respect `provides_uses_lib` for modules added via `[optional_]uses_libs`" am: ae5cdfffa3 am: a9860b8a8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609480

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib5b3fe2b21b9b2186196e0b38a43cdf561f36a56
2021-03-02 23:24:52 +00:00
Ulyana Trafimovich ae5cdfffa3 Merge "Respect `provides_uses_lib` for modules added via `[optional_]uses_libs`" 2021-03-02 13:47:03 +00:00
Ulya Trafimovich eea486a580 Respect `provides_uses_lib` for modules added via `[optional_]uses_libs`
Previously `provides_uses_lib` property affected only those
<uses-library> dependencies that are automatically deduced by Soong as
implicit Java SDK libraries reachable from the `libs` property. Other
<uses-library> dependencies that are explicitly added in `uses_libs` and
`optional_uses_libs` properties ignored `provides_uses_lib`.

As TestUsesLibraries shows (see the TODOs), Soong behaviour is still
incorrect in two ways (to be addressed in follow-up CLs):

- `uses_libs`/`optional_uses_libs` are passed to manifest_fixer
- verify_uses_libraries check is based on `uses_libs`/
  `optional_uses_libs`, and not on the CLC as it should be

Bug: 132357300
Test: m nothing
Change-Id: I0ec7aab9dcd44554d1a79ddd382491c562266fa3
2021-03-01 17:31:23 +00:00
Treehugger Robot 2dcfbcbccf Merge "Propagate java resources in apps with no code" am: 2ee47272f5 am: f6316c4b1c am: 5541754e5a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610973

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic0bcc631c3927ef7cbfeaba4e44435eaf41f74c5
2021-03-01 09:00:18 +00:00
Treehugger Robot 5541754e5a Merge "Propagate java resources in apps with no code" am: 2ee47272f5 am: f6316c4b1c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610973

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9f21c21508658da4cad91202315e3589b939c7f
2021-02-28 02:09:14 +00:00
Colin Cross b014f0787e Propagate java resources in apps with no code
Use the java resources jar as the dex jar when building apps that
have no code.

Also remove maybeStrippedDexJar, the dex jar is never stripped now.

Fixes: 176305357
Test: TestAppJavaResources
Change-Id: Ic8b1165bd35d71237d307e7f5f895764e203a10d
2021-02-26 16:28:12 -08:00
Jaewoong Jung 098080d812 Merge "Fix the releax_check flag format verb." am: fc3bfe54c3 am: cfeffdc6ec am: f4f0d09eb8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607177

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11407e6152ec04a58cfa9c857bbf7361b43de4cc
2021-02-25 17:49:15 +00:00