Commit Graph

43740 Commits

Author SHA1 Message Date
Paul Duffin
e5f1b2f131 Merge "Calculate widest stub dex jars per module" am: 634966767c am: f72c380726
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748467

Change-Id: Ie3fd02dda6a6de949a667c3512b89b3b6063a56b
2021-06-28 12:25:34 +00:00
Paul Duffin
f72c380726 Merge "Calculate widest stub dex jars per module" am: 634966767c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748467

Change-Id: I1323d0c33830f3ce19fa32fd4ccf46654f305d61
2021-06-28 12:07:06 +00:00
Paul Duffin
634966767c Merge "Calculate widest stub dex jars per module" 2021-06-28 11:55:07 +00:00
Paul Duffin
14c190c4b5 Merge "Add test to show issues with widest stub dex jars" am: f6d3b2aef8 am: dc2947c21f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748466

Change-Id: I2ceb38418509a8cc25b5db8d9dcd561a3e81fff9
2021-06-28 11:27:38 +00:00
Paul Duffin
0b57ca11ac Merge "Allow hiddenapi list to ignore missing classes/members" am: 9e4a27840b am: cac5c585dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1747553

Change-Id: I828d35e39750bb5f57ceb6af6a11ba92ba6fd868
2021-06-28 11:27:28 +00:00
Paul Duffin
dc2947c21f Merge "Add test to show issues with widest stub dex jars" am: f6d3b2aef8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748466

Change-Id: Ie1acf5281abfd5bf31e06d68fa1d79ae8f878d65
2021-06-28 11:17:00 +00:00
Paul Duffin
cac5c585dc Merge "Allow hiddenapi list to ignore missing classes/members" am: 9e4a27840b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1747553

Change-Id: I139cd63e4ec08ccf6ee6e6067c1768ce67a408b4
2021-06-28 11:16:12 +00:00
Paul Duffin
f6d3b2aef8 Merge "Add test to show issues with widest stub dex jars" 2021-06-28 10:58:55 +00:00
Paul Duffin
9e4a27840b Merge "Allow hiddenapi list to ignore missing classes/members" 2021-06-28 10:58:46 +00:00
Mathew Inwood
4c373c5d01 [automerger skipped] Merge "Use trimmed lint database for mainline modules" into sc-dev am: fbaa8e9d6a -s ours
am skip reason: Merged-In Ica646081b9189303c393b36b2f02914d69eee291 with SHA-1 18233a2b47 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108706

Change-Id: Ie3642f97c070a82025bf590576a5d482fe9b22b6
2021-06-28 10:27:17 +00:00
Mathew Inwood
fbaa8e9d6a Merge "Use trimmed lint database for mainline modules" into sc-dev 2021-06-28 10:17:49 +00:00
Anton Hansson
7c05246ab2 Merge "Use trimmed lint database for mainline modules" am: 8aa7beb58d am: 2e764b82b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731410

Change-Id: I45582af575f269524359d1a2b666f9aa3056479d
2021-06-28 10:06:56 +00:00
Paul Duffin
280a31aac3 Calculate widest stub dex jars per module
Previously, the stub dex jars for each HiddenAPIScope was created by
merging the stub dex jars provided by each module for that scope. Then
the widest stub dex jars were chosen. So, if module A provided public,
system and test stub dex jars and module B provided only public then
the stub dex jars for each scope would be:
* public -> A,B
* system -> A
* test -> A

So, the widest API scope for which there are stub dex jars is "test"
and so the widest stub dex jars would just come from module A and not
module B. So, when "hiddenapi list" is run for module C which depends
on modules A and B it only gets given stub dex jars for module A which
means that it cannot resolve all the types that C may use which can
lead to incorrect flags being generated.

This change does not merge the stub dex jars from each module together
and instead keeps them separate by module. The widest stub dex jars
list is constructed by asking each module in turn for their widest stub
dex jars. e.g. Given the above example we would have:

Module A:
* public
* system
* test <- widest

Module B:
* public <- widest

So, the widest stub dex jars will be A's test and B's public stub dex
jars.

Bug: 179354495
Test: m out/soong/hiddenapi-flags.csv
      - make sure that this does not change the file.
Change-Id: Ib137825ebffe94b2bf220732bae6077f7b7ac6db
2021-06-28 10:56:43 +01:00
Anton Hansson
2e764b82b8 Merge "Use trimmed lint database for mainline modules" am: 8aa7beb58d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731410

Change-Id: I2e40d83814c3333ad5b38f9f833ee277c8b55650
2021-06-28 09:49:35 +00:00
Anton Hansson
8aa7beb58d Merge "Use trimmed lint database for mainline modules" 2021-06-28 09:36:46 +00:00
Paul Duffin
a9c7f46118 Merge "Add sdk_library_test.go to Android.bp file" am: aed46487b0 am: e49ae4af3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748465

Change-Id: If48277205b9d227fead01970eb8f2cb9727907cc
2021-06-28 07:51:58 +00:00
Paul Duffin
e49ae4af3f Merge "Add sdk_library_test.go to Android.bp file" am: aed46487b0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748465

Change-Id: Id856fd94b237295096c3fa83574b664416104401
2021-06-28 07:37:04 +00:00
Paul Duffin
aed46487b0 Merge "Add sdk_library_test.go to Android.bp file" 2021-06-28 07:19:35 +00:00
Martin Stjernholm
8c163986ed [automerger skipped] Merge "Fix inconsistencies in the apex names used for the apex variations." into sc-dev am: 82c88ca8c6 -s ours
am skip reason: Merged-In If8612639bffdf91cbcab3387b0603bf5dffef1f5 with SHA-1 bfffae7bec is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15095930

Change-Id: I25c1c2ab3530b238fa7d39d774e9f90c93e9bd58
2021-06-27 23:19:31 +00:00
Martin Stjernholm
82c88ca8c6 Merge "Fix inconsistencies in the apex names used for the apex variations." into sc-dev 2021-06-27 23:08:48 +00:00
Paul Duffin
d2b1e0ca92 Add test to show issues with widest stub dex jars
The widest stub dex jars should include the widest stub dex jars
provided by each module. So, if module A has public, system and test
and module B has only public then the widest stub dex jars should
include module A's test and module B's public stub dex jars. Instead,
they just include module A's test.

That behaviour is needed so that when the "hiddenapi list" tool is run
against a module C that it is passed stub dex jars from both module A
and module B so that any references to the types provided by those APIs
can be resolved.

A follow up change will fix this issue.

Bug: 179354495
Test: m nothing
Change-Id: Ibd31964e8d2a33fa92fbd0b800c9fe054ee359c7
2021-06-27 22:46:14 +01:00
Paul Duffin
156b5d3b61 Allow hiddenapi list to ignore missing classes/members
When generating the stub-flags.csv for a bootclasspath_fragment the
hiddenapi list tool is not given a complete set of all classes and
members. This change causes it to ignore them by passing the new
--fragment option to it.

This does not risk changing the flags as the stub-flags.csv files
created with the --fragment option are compared with the monolithic
out/soong/hiddenapi/hiddenapi-stub-flags.txt file which is not run
with this option to ensure that they match.

Bug: 179354495
Test: m out/soong/hiddenapi-stub-flags.csv
      - make sure that this does not change the file.
Change-Id: I890c7374c445759cade4d685f51e81261b7ccea2
2021-06-27 22:46:14 +01:00
Paul Duffin
9fc208ee54 Add sdk_library_test.go to Android.bp file
When this file was initially created by extracting the test from the
java_test.go file it was not added to Android.bp file so was not being
built and tested as it should. That lead to a recent change that left
it unable to compile. This change corrects both those issues.

Bug: 186723288
Bug: 179354495
Test: m nothing
Change-Id: I06f32bb572f57b6df3c772f1d9d21fe323fbf353
2021-06-27 20:42:48 +01:00
Treehugger Robot
d9ddfa803e Merge "Move notememtag tests to sanitize_test.go" am: 7c32e223e8 am: f808be6879
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743034

Change-Id: Ibdddc9c5bfc463b15309b06445841f3479664833
2021-06-27 13:21:05 +00:00
Treehugger Robot
f808be6879 Merge "Move notememtag tests to sanitize_test.go" am: 7c32e223e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743034

Change-Id: I66062269236b8b7346029a388f464fed7c44fadd
2021-06-27 13:07:08 +00:00
Treehugger Robot
7c32e223e8 Merge "Move notememtag tests to sanitize_test.go" 2021-06-27 12:53:58 +00:00
Treehugger Robot
a2792263fa Merge "Fix inconsistencies in the apex names used for the apex variations." am: f46e95899b am: 28bbdf23f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748294

Change-Id: I930769a7d48eedace77d12cf51f1e50ebb874cbb
2021-06-25 23:33:49 +00:00
Treehugger Robot
28bbdf23f7 Merge "Fix inconsistencies in the apex names used for the apex variations." am: f46e95899b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748294

Change-Id: Ibb93b4eef47e12cbcec4b1ba3d578edf492e242a
2021-06-25 23:12:59 +00:00
Treehugger Robot
f46e95899b Merge "Fix inconsistencies in the apex names used for the apex variations." 2021-06-25 22:50:00 +00:00
Paul Duffin
dda1871598 [automerger skipped] Support hidden API processing for modules that use platform APIs am: b3821fea38 -s ours
am skip reason: Merged-In Ia8b79830ed0e6d42100de03d76b0c51b7f6c8ade with SHA-1 5cca7c44e5 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15113871

Change-Id: I052b72909303aed33a1650def076a3b96e54a260
2021-06-25 22:40:56 +00:00
Paul Duffin
accfc2aef5 [automerger skipped] Verify the modular stub flags are subsets of the monolithic stub flags am: af193429d4 -s ours
am skip reason: Merged-In I46ebb495cb093a5e3abe7571c49933c845318549 with SHA-1 2e88097152 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15113870

Change-Id: I281fe00bd28f9aeb894800db6cab1381e1abde2f
2021-06-25 22:40:18 +00:00
Paul Duffin
d319ca18b7 [automerger skipped] Make ruleToGenerateHiddenAPIStubFlagsFile build rule am: 31a6856823 -s ours
am skip reason: Merged-In I2a4455daa8a6090ed5568994b255848d063e1ab2 with SHA-1 4539a37a61 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108709

Change-Id: I95dff90bc1acf420d9dcd7cf179e5d965185dfc0
2021-06-25 22:40:17 +00:00
Paul Duffin
b3821fea38 Support hidden API processing for modules that use platform APIs
Previously, hidden API processing could only be done by those
bootclasspath_fragment modules that either did not depend on any other
fragments (e.g. art-bootclasspath-fragment) or only depended on APIs
provided by other fragments (e.g. i18n-bootclasspath-fragment). That
meant that modules like com.android.os.statsd-bootclasspath-fragment
that depended on APIs provided by parts of the platform which are not
yet part of another bootclasspath_fragment could not perform hidden
API processing.

This change adds support for a bootclasspath_fragment to specify the
additional stubs needed to perform hidden API processing. It adds a new
additional_stubs property that can be used to specify the additional
stub libraries.

Most bootclasspath_fragments that need to use the property will need
access to the APIs provided by the android-non-updatable.* libraries.
Rather than have each fragment explicitly specify the correct module
for each scope it treats "android-non-updatable" as if it was a
java_sdk_library that can provide different jars for each scope.
Soong will handle mapping that to the correct android-non-updatable.*
module.

Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-flags.csv \
        out/soong/hiddenapi/hiddenapi-index.csv \
        out/soong/hiddenapi/hiddenapi-stub-flags.txt \
        out/soong/hiddenapi/hiddenapi-unsupported.csv
      - make sure that this change does not change the contents.
      m TARGET_BUILD_APPS=Calendar nothing
Merged-In: Ia8b79830ed0e6d42100de03d76b0c51b7f6c8ade
Change-Id: Ia8b79830ed0e6d42100de03d76b0c51b7f6c8ade
(cherry picked from commit 5cca7c44e5)
2021-06-25 21:59:28 +01:00
Paul Duffin
af193429d4 Verify the modular stub flags are subsets of the monolithic stub flags
Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-stub-flags.txt
      - check that an error is reported if a modular stub-flags.csv file,
        i.e. one created by a fragment is not a subset of the monolithic
        file, e.g. because a signature in the modular file has different
        flags than it does in the monolithic or is not present there.
Merged-In: I46ebb495cb093a5e3abe7571c49933c845318549
Change-Id: I46ebb495cb093a5e3abe7571c49933c845318549
(cherry picked from commit 2e88097152)
2021-06-25 21:59:28 +01:00
Paul Duffin
31a6856823 Make ruleToGenerateHiddenAPIStubFlagsFile build rule
Previously, the func created a rule and returned it for the caller to
create with the appropriate name and description. This change passes
the name and description into the func and causes it to create the rule
itself. The func is also renamed to make it more consistent with the
other similar rules.

Bug: 179354495
Test: m nothing
Merged-In: I2a4455daa8a6090ed5568994b255848d063e1ab2
Change-Id: I2a4455daa8a6090ed5568994b255848d063e1ab2
(cherry picked from commit 4539a37a61)
2021-06-25 21:59:28 +01:00
Martin Stjernholm
d8da28ea9c Fix inconsistencies in the apex names used for the apex variations.
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.

Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.

For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.

Cherry-picked from https://r.android.com/1748294.

Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Merged-In: If8612639bffdf91cbcab3387b0603bf5dffef1f5
2021-06-25 21:27:14 +01:00
Paul Duffin
12ef8d8bac Merge "Support hidden API processing for modules that use platform APIs" am: 99926a2a77 am: 9d67121fff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1744417

Change-Id: I0929917000886efd04d021dd4370c66f09cca00c
2021-06-25 18:56:19 +00:00
Paul Duffin
75ca10d437 Merge "Verify the modular stub flags are subsets of the monolithic stub flags" am: 921d33d447 am: 6b923bc2c0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745334

Change-Id: I0d420d934d63008a4de087c35a5c07caff2adf5f
2021-06-25 18:55:41 +00:00
Paul Duffin
f48c06ec21 Merge "Make ruleToGenerateHiddenAPIStubFlagsFile build rule" am: 49c91f32b2 am: 3a5056f429
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745333

Change-Id: I3bb3957639442ee0e30e15d7abe230feea23547e
2021-06-25 18:54:28 +00:00
Paul Duffin
9d67121fff Merge "Support hidden API processing for modules that use platform APIs" am: 99926a2a77
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1744417

Change-Id: I279942b0772b17b3d6766d859e7c8ac7d2793817
2021-06-25 18:45:33 +00:00
Paul Duffin
0eeb82f4de [automerger skipped] Merge "Add ModuleLibHiddenAPIScope for hidden API processing" into sc-dev am: 5c6f03cfbf -s ours
am skip reason: Merged-In I3ecb80fdaeba0e66d1ee25cb57152ab546d9bfe0 with SHA-1 b51db2ed8e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108700

Change-Id: I2d122f7764248006ab898c3be6b8e7a8119ac46e
2021-06-25 18:45:21 +00:00
Paul Duffin
5c0cd9ef9e [automerger skipped] Merge "Add test for modular hiddenapi list rule" into sc-dev am: db343fa1e7 -s ours
am skip reason: Merged-In I5630075825c674b2e4f38bd459c7b061c01fc362 with SHA-1 48b6741510 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108699

Change-Id: I3aa33255c331bbb73326e0036e45e54f84e3d296
2021-06-25 18:45:16 +00:00
Paul Duffin
77eb4c4b24 [automerger skipped] Merge "Add HiddenAPIScope to replace use of SdkKind" into sc-dev am: 3ca616b9f9 -s ours
am skip reason: Merged-In I97968f58535121652852b8d25217aa288afd2bfd with SHA-1 31fad800a7 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108698

Change-Id: I42e795251fdcb869cc73a6d5dc9cc0c12ce45a42
2021-06-25 18:45:11 +00:00
Paul Duffin
d203f44d64 Merge "Ensure consistent APEX variation for java_sdk_library and java_sdk_library_import" into sc-dev am: 05fc06ebcd
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15108697

Change-Id: Ia88b936d5fcaeca919c166167deaef0e054bba59
2021-06-25 18:45:04 +00:00
Paul Duffin
6b923bc2c0 Merge "Verify the modular stub flags are subsets of the monolithic stub flags" am: 921d33d447
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745334

Change-Id: I388c9697a5011a9283fc9584449fbd61c1ccfe8d
2021-06-25 18:44:29 +00:00
Paul Duffin
3a5056f429 Merge "Make ruleToGenerateHiddenAPIStubFlagsFile build rule" am: 49c91f32b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745333

Change-Id: Ibff815e9c6575d75dfeb21054428047fac8eb1ae
2021-06-25 18:40:29 +00:00
Paul Duffin
5c6f03cfbf Merge "Add ModuleLibHiddenAPIScope for hidden API processing" into sc-dev 2021-06-25 18:30:40 +00:00
Paul Duffin
db343fa1e7 Merge "Add test for modular hiddenapi list rule" into sc-dev 2021-06-25 18:29:44 +00:00
Paul Duffin
3ca616b9f9 Merge "Add HiddenAPIScope to replace use of SdkKind" into sc-dev 2021-06-25 18:28:55 +00:00
Paul Duffin
05fc06ebcd Merge "Ensure consistent APEX variation for java_sdk_library and java_sdk_library_import" into sc-dev 2021-06-25 18:28:00 +00:00