Commit Graph

5108 Commits

Author SHA1 Message Date
Anton Hansson
5ab4286e84 Remove support for removed_dex_api_filename
Nothing uses this argument anymore, so simplify the droidstubs code by
removing the argument.

Bug: 189426360
Test: m
Merged-In: I0e4b84d73a954b3819db1149be3da287cf604eec
Change-Id: I0e4b84d73a954b3819db1149be3da287cf604eec
2021-05-27 12:50:44 +01:00
Anton Hansson
a7bb86b48e Remove support for removed_dex_api_filename
Nothing uses this argument anymore, so simplify the droidstubs code by
removing the argument.

Bug: 189426360
Test: m
Change-Id: I0e4b84d73a954b3819db1149be3da287cf604eec
2021-05-27 12:31:03 +01:00
Martin Stjernholm
6912b71c08 Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx." am: 664b2cf89a am: 5eb4b21deb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1719298

Change-Id: I72b64b8f26bdb135838f8cf735b2ac7da84cdba7
2021-05-27 10:14:36 +00:00
Martin Stjernholm
664b2cf89a Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx." 2021-05-27 09:24:55 +00:00
Colin Cross
532e863da0 Merge changes I0116f5f4,I950c9b54,I967f5c42 am: 4ab2dd1afe am: 7ca753793f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1718475

Change-Id: I864c97d90aa8f2ec4e43ac9d39464ca257b608e2
2021-05-27 01:38:25 +00:00
Colin Cross
4ab2dd1afe Merge changes I0116f5f4,I950c9b54,I967f5c42
* changes:
  Treat java libraries in classpath fragments as directly in apex
  Make CopyDirectlyInAnyApex match the documentation
  Remove unused cc.copyDirectlyInAnyApexDependencyTag
2021-05-27 00:56:52 +00:00
Colin Cross
c33e5216f1 Treat java libraries in classpath fragments as directly in apex
Coverage is applied to java libraries that are directly in an apex.
Mark java libraries that are in an apex through a bootclasspath_fragment
or a systemserverclasspath_fragment as directly in the apex by
implementing CopyDirectlyInAnyApexTag on the dependency tags used for
their contents.

Bug: 183759446
Test: TestApexJavaCoverage
Change-Id: I0116f5f415083b5194000988cb257454ef115200
2021-05-26 10:07:44 -07:00
Artur Satayev
2993e2384f Merge changes from topic "populate-bootclasspath-fragments-with-stem" into sc-dev am: b9d7ff160c
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/14717821

Change-Id: I3b6b17e51661f33490f21eef8bcee2e0153d6d90
2021-05-26 16:28:57 +00:00
Artur Satayev
8a070af279 Revert "Partial Revert "Populate individual classpath_fragments'..." am: 5cb569794e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/14717818

Change-Id: Ice91fc5b04f34e4da0919c6bfaaa79ea89ca6920
2021-05-26 16:28:55 +00:00
satayev
1c564cc9c9 Use stem when filtering boot jars.
For testing purposes, a boot jar may be provided by a test java_library
that has a different content name, but sets "stem" property to match
the original java_library.

Given that Stem() returns either the property value or module name,
it is safe to replace all content names by their stems.

Bug: 180105615
Test: atest CtsClasspathsTestCases sdkextensions_e2e_tests
Merged-In: Ic519ffa0c5b616abddf15b41c934421dfac2e78a
Change-Id: Ic519ffa0c5b616abddf15b41c934421dfac2e78a
2021-05-26 17:13:43 +01:00
Martin Stjernholm
be10503d3a Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx.
Neither InApexVariants nor InApexModules should have them. This allows
us to get rid of InApexVariantByBaseName as well.

Test: m nothing
Test: m nothing SOONG_CONFIG_art_module_source_build=false
Bug: 180325915
Change-Id: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
2021-05-26 17:05:17 +01:00
Anton Hansson
1fbf811826 Merge "Partial Revert "Populate individual classpath_fragments' classpaths.prot..."" into sc-dev am: bbe2d3db4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/14717811

Change-Id: I2857f28e17313fca7a2397f4e538a3c09de9b284
2021-05-26 11:02:17 +00:00
satayev
07753d8467 Use stem when filtering boot jars.
For testing purposes, a boot jar may be provided by a test java_library
that has a different content name, but sets "stem" property to match
the original java_library.

Given that Stem() returns either the property value or module name,
it is safe to replace all content names by their stems.

Bug: 180105615
Test: atest CtsClasspathsTestCases sdkextensions_e2e_tests
Change-Id: Ic519ffa0c5b616abddf15b41c934421dfac2e78a
2021-05-25 21:16:34 +01:00
Artur Satayev
5cb569794e Revert "Partial Revert "Populate individual classpath_fragments'..."
Revert submission 14717811-revert-populate-platform-bootclasspath

Reason for revert: retry with a fix
Reverted Changes:
Ib58cd0211:Revert "Add bootclasspath_fragments to platform-bo...
I13b622d6c:Partial Revert "Populate individual classpath_frag...

Bug: 180105615
Test: atest sdkextensions_e2e_tests

Change-Id: I7b6b6b980a4c6430a70394e85222f3b35c4efd5f
2021-05-25 21:00:31 +01:00
satayev
931a4488da Populate individual systemserverclasspath_fragments' proto configs.
Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Ic0ae897e9baca75dcc022d84656496563645e74e
Merged-In: Ic0ae897e9baca75dcc022d84656496563645e74e
2021-05-25 21:00:07 +01:00
Artur Satayev
f1adfb38fb Merge "Rename generate proto config file to match classpath type." into sc-dev 2021-05-25 19:40:05 +00:00
satayev
207d97ef20 Merge "Rename generate proto config file to match classpath type." am: 70975ac815 am: 0e595182a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1713996

Change-Id: Ia6d89b8c5fa22e9e073e16810ab44631f1646e2c
2021-05-25 14:42:54 +00:00
Anton Hansson
bbe2d3db4a Merge "Partial Revert "Populate individual classpath_fragments' classpaths.prot..."" into sc-dev 2021-05-25 14:18:42 +00:00
satayev
70975ac815 Merge "Rename generate proto config file to match classpath type." 2021-05-25 14:17:04 +00:00
satayev
a3fc817771 Partial Revert "Populate individual classpath_fragments' classpaths.prot..."
Reason for revert: test breakage b/189114287
Bug: 180105615
Bug: 189114287
Test: atest sdkextensions_e2e_tests

Change-Id: I13b622d6c61ea392bfcc8a40535045c87fa3a7b5
2021-05-25 15:12:23 +01:00
satayev
6f7a97eb51 Merge "Populate individual systemserverclasspath_fragments' proto configs." am: 8a7bbb5b79 am: 9a1a908ae5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716118

Change-Id: I3d2fddc13cc7ed04d2f24e4194b97c554234df4c
2021-05-25 13:58:49 +00:00
satayev
8a7bbb5b79 Merge "Populate individual systemserverclasspath_fragments' proto configs." 2021-05-25 11:38:40 +00:00
Paul Duffin
588e22a6bc Tighten bootclasspath_fragment property validation
Previously, due to legacy reasons, the property validation did not
require a contents property and allowed the image_name to be either
"art" or "boot". Those reasons no longer apply and so this change
requires a contents property and only allows the image_name to be set
to "art" if specified.

Bug: 177892522
Test: m nothing
Merged-In: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
Change-Id: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
(cherry picked from commit 8018e50ddb)
2021-05-25 09:30:20 +01:00
Paul Duffin
0788cd6038 Only export boot image files to APEX if they are actually created
Previously, the generation of the rules to create the boot image files
was separate from the code to provide those files to the APEX which
meant that it was possible for the APEX to try and use files that had
no rules to create them.

This changes avoids that by only exporting the files once the rules
have been created.

This necessitated a few changes to tests that were relying on the
previous behavior. Including removing completely the test that used an
image_name: "boot" as that is no longer a valid configuration name as
its functionality has been replaced by platform_bootclasspath.

A follow up change will make the validation of the properties of
bootclasspath_fragment stricter to prevent "boot" being used as the
image_name.

Bug: 177892522
Bug: 188680624
Test: lunch qemu_trusty_arm64-userdebug
      m droid dist
      - verify that before this change it fails and after this change
        it works.
      m com.android.art
      - verify that this change does not change the APEX contents with
        either qemu_trusty_arm64-userdebug or aosp_arm64-userdebug
Merged-In: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
Change-Id: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
(cherry picked from commit 58e0e769c9)
2021-05-25 09:30:20 +01:00
Treehugger Robot
91fb1fc40d Merge "Clarify how metalava @SuppressLint works" am: c2d8fa0515 am: 7822abf9ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1715433

Change-Id: I2567971ef60bfd037a79e218bc16e52a3fe254b2
2021-05-25 01:05:08 +00:00
Treehugger Robot
c2d8fa0515 Merge "Clarify how metalava @SuppressLint works" 2021-05-25 00:21:39 +00:00
Paul Duffin
8973a57bff Merge "Tighten bootclasspath_fragment property validation" am: 00ceb0e7f5 am: 06417a2066
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716110

Change-Id: I1d99fca44ad0a2791bdfdd5bb6fbec622bd7cac3
2021-05-24 22:58:37 +00:00
Paul Duffin
dafcf9c54d Merge "Only export boot image files to APEX if they are actually created" am: 6778edb558 am: 923bb78212
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716109

Change-Id: I5214f09a1510dc7e9072f04f3536bdde804fb69e
2021-05-24 22:58:30 +00:00
Paul Duffin
54c1f08aa9 Support removed API members in modular hidden API processing
Previously, the hidden API flags generated for a bootclasspath_fragment
did not include removed API members. That was because it did not supply
a file containing the dex signatures of the removed API members.

The monolithic hidden API processing uses combined-removed-dex which is
the output of a genrule that takes as input the *removed.txt files from
all the APIs and uses metalava to construct the dex signatures file.
This change does the equivalent for the *removed.txt files for the APIs
provided by a bootclasspath_fragment and then passes them to the rule
that generates the final all-flags.csv.

Bug: 179354495
Test: - Update packages/modules/RuntimeI18N to enable hidden API
        processing.
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - Before this change that fails as the flags generated for the
        i18n-bootclasspath-fragment differ from the monolithic flags.
	After this change that passes.
      - Verify that this change does not change any of the monolithic
        hidden API files.
      m com.android.i18n
      - Verify that the apex file before and after this change are byte
        for byte identical.
Merged-In: I6a21edb8a5231666e3f35b2c99a8687f36dd98fd
Change-Id: I6a21edb8a5231666e3f35b2c99a8687f36dd98fd
(cherry picked from commit 32cf58a8fc)
2021-05-24 20:26:02 +01:00
Paul Duffin
67c1e57551 Support hidden API processing for fragments with dependencies
Previously, a bootclasspath_fragment that depended on classes provided
by another bootclasspath_fragment did not support hidden API processing
as it would not supply information about those dependencies.

This change adds support for that as follows. Each fragment:
1. Exports the transitive sets of stub dex jars for each of the public,
   system, test and core_platform APIs (where relevant).
2. Adds dependencies onto its dependent fragments.
3. Retrieves the API stubs dex jars from its dependent fragments and
   passes them to the "hiddenapi list" tool which will use them to
   resolve dependencies but will not output them to the generated
   flags.

Once the flags are generated the existing encoding functionality
encodes the flags into the dex files of the bootclasspath_fragment's
content modules which are then packaged into the apex.

Bug: 179354495
Test: m com.android.sdkext
      - verify that this does not change the contents of the apex files
Merged-In: I3e82a6dbb437f1e417e5d7e25aeb212e378603d0
Change-Id: I3e82a6dbb437f1e417e5d7e25aeb212e378603d0
(cherry picked from commit f1b358cb57)
2021-05-24 20:26:02 +01:00
Aurimas Liutikas
b23b745e19 Clarify how metalava @SuppressLint works
Bug: 186157121
Change-Id: Ia3316b80dcf16e7fb2a41983732e0be8d0657497
Test: None
2021-05-24 18:01:17 +00:00
Paul Duffin
07bf109adf Support removed API members in modular hidden API processing am: 32cf58a8fc am: 9e94b688a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1711994

Change-Id: I0552100f3fa32093fdd1b6128e22aba03aa36db2
2021-05-24 17:59:52 +00:00
Paul Duffin
2100e6f95c Support hidden API processing for fragments with dependencies am: f1b358cb57 am: 95a64e35a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710437

Change-Id: I61c7810343ae468d68a01724f844346919551f21
2021-05-24 17:59:24 +00:00
Paul Duffin
6a58cc94d1 Remove bootclasspathApiInfo
Previously, the bootclasspathApiInfo was only used for tests and follow
up changes will need to provide the stub dex jars. This change moves
the stubJarsByKind into HiddenAPIInfo and removes bootclasspathApiInfo
and the corresponding provider.

Bug: 179354495
Test: m nothing
Merged-In: I5459c56de561c053ed671dc9d5cb3ee4820c0ee8
Change-Id: I5459c56de561c053ed671dc9d5cb3ee4820c0ee8
(cherry picked from commit 18cf19745e)
2021-05-24 18:20:09 +01:00
Paul Duffin
699a00489e Fix hidden API flags in com.android.i18n
Change 70cfdff3da changed the hidden API
flags in com.android.i18n as it stopped the i18n-bootclasspath-fragment
from making the hidden API flag files available for use by
platform-bootclasspath.

This change fixes that by exporting the flag files even if hidden API
flag generation is skipped.

Bug: 179354495
Test: m com.android.i18 out/soong/hiddenapi/hiddenapi-flags.csv
      - make sure that the flags in
        packages/modules/RuntimeI18n/apex/hiddenapi/hiddenapi-max-target-o-low-priority.txt
        are reflected in the core-icu4j dex files in the apex.
Merged-In: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
Change-Id: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
(cherry picked from commit 6237092391)
2021-05-24 18:20:08 +01:00
Paul Duffin
71955b4bc3 Rename hiddenAPIFlagFileInfo to HiddenAPIInfo
This reflects that it has expanded from its initial purpose to include
more than just flag files. It is exported for use in tests in other
packages.

Bug: 179354495
Test: m nothing
Merged-In: I9f780b20e18ce3a774e4aa04a276463070a64c34
Change-Id: I9f780b20e18ce3a774e4aa04a276463070a64c34
(cherry picked from commit af99afa919)
2021-05-24 18:20:08 +01:00
Paul Duffin
5aadef8ab5 Separate input to flag generation from hiddenAPIFlagFileInfo
Encapsulating the information needed by hidden API processing in a
struct makes it easy to add additional information in future and allows
the code to populate that struct from various different sources to be
grouped together.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: I53805737dff36a3ae87aca5aad51cf46ae1361fe
Change-Id: I53805737dff36a3ae87aca5aad51cf46ae1361fe
(cherry picked from commit 1352f7c471)
2021-05-24 18:20:08 +01:00
Paul Duffin
cad63842d2 Separate output of flag generation from hiddenAPIFlagFileInfo
HiddenAPIFlagOutput encapsulates the paths to the files produced by the
hidden API flag generation of a single bootclasspath_fragment. It is
returned from hidden API flag generation and is embedded within the
hiddenAPIFlagFileInfo so they can be passed to other modules.

Unlike the fields it replaces in hiddenAPIFlagFileInfo the fields in
HiddenAPIFlagOutput are of type Path not Paths which makes it easier to
use.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: I7373ba1001cac3a75eb54a23e62fa52f5013ee7f
Change-Id: I7373ba1001cac3a75eb54a23e62fa52f5013ee7f
(cherry picked from commit 1e6f5c4e63)
2021-05-24 18:20:07 +01:00
Paul Duffin
9e3b906581 Separate monolithic hidden API processing from hiddenAPIFlagFileInfo
The hiddenAPIFlagFileInfo was being used for both the input and output
of bootclasspath_fragment and platform_bootclasspath and also to pass
information around to various hidden API rule methods. Supporting
multiple different uses in this way made it hard to reason about.

This change creates a separate structure for use by the
platform_bootclasspath. Follow up changes will split out other
functionality into separate types.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: Ia5c5f65ae5645486c42819c669a8601588217f88
Change-Id: Ia5c5f65ae5645486c42819c669a8601588217f88
(cherry picked from commit 438eb57a27)
2021-05-24 18:20:07 +01:00
Paul Duffin
b2bc52e7eb Remove bootclasspathApiInfo am: 18cf19745e am: 3c22863451
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716115

Change-Id: I4c07be9ce52ec3455ea92778070e8565ec0969f5
2021-05-24 15:55:41 +00:00
Paul Duffin
74a6d6b011 Fix hidden API flags in com.android.i18n am: 6237092391 am: 0d3c1da89b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716114

Change-Id: I36c0ed1b3081ba15ecba4deccdad0b0ea5aa05a5
2021-05-24 15:55:38 +00:00
Paul Duffin
0a677db96f Rename hiddenAPIFlagFileInfo to HiddenAPIInfo am: af99afa919 am: 02139ea746
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710436

Change-Id: Ibe96018a8531e19d49f179fb5f1f9cae90e313a4
2021-05-24 15:55:36 +00:00
Paul Duffin
51184655cf Separate input to flag generation from hiddenAPIFlagFileInfo am: 1352f7c471 am: 9d5ec5faa5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716113

Change-Id: Ic21630625e3f013c3495d48e245a025b39e2e391
2021-05-24 15:55:25 +00:00
Paul Duffin
81fc4cd058 Separate output of flag generation from hiddenAPIFlagFileInfo am: 1e6f5c4e63 am: 58a6a96c9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716112

Change-Id: Iac9dd8f28f1ba686bd3af3d2d7631fb1bb49caf2
2021-05-24 15:55:23 +00:00
Paul Duffin
250ae03830 Separate monolithic hidden API processing from hiddenAPIFlagFileInfo am: 438eb57a27 am: 1249b6ba12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716111

Change-Id: I4864236d5d25b5f4a02fb06bdc914668a207dc4f
2021-05-24 15:55:20 +00:00
Paul Duffin
8018e50ddb Tighten bootclasspath_fragment property validation
Previously, due to legacy reasons, the property validation did not
require a contents property and allowed the image_name to be either
"art" or "boot". Those reasons no longer apply and so this change
requires a contents property and only allows the image_name to be set
to "art" if specified.

Bug: 177892522
Test: m nothing
Change-Id: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
2021-05-24 16:22:47 +01:00
Paul Duffin
58e0e769c9 Only export boot image files to APEX if they are actually created
Previously, the generation of the rules to create the boot image files
was separate from the code to provide those files to the APEX which
meant that it was possible for the APEX to try and use files that had
no rules to create them.

This changes avoids that by only exporting the files once the rules
have been created.

This necessitated a few changes to tests that were relying on the
previous behavior. Including removing completely the test that used an
image_name: "boot" as that is no longer a valid configuration name as
its functionality has been replaced by platform_bootclasspath.

A follow up change will make the validation of the properties of
bootclasspath_fragment stricter to prevent "boot" being used as the
image_name.

Bug: 177892522
Bug: 188680624
Test: lunch qemu_trusty_arm64-userdebug
      m droid dist
      - verify that before this change it fails and after this change
        it works.
      m com.android.art
      - verify that this change does not change the APEX contents with
        either qemu_trusty_arm64-userdebug or aosp_arm64-userdebug
Change-Id: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
2021-05-24 16:22:43 +01:00
Paul Duffin
32cf58a8fc Support removed API members in modular hidden API processing
Previously, the hidden API flags generated for a bootclasspath_fragment
did not include removed API members. That was because it did not supply
a file containing the dex signatures of the removed API members.

The monolithic hidden API processing uses combined-removed-dex which is
the output of a genrule that takes as input the *removed.txt files from
all the APIs and uses metalava to construct the dex signatures file.
This change does the equivalent for the *removed.txt files for the APIs
provided by a bootclasspath_fragment and then passes them to the rule
that generates the final all-flags.csv.

Bug: 179354495
Test: - Update packages/modules/RuntimeI18N to enable hidden API
        processing.
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - Before this change that fails as the flags generated for the
        i18n-bootclasspath-fragment differ from the monolithic flags.
	After this change that passes.
      - Verify that this change does not change any of the monolithic
        hidden API files.
      m com.android.i18n
      - Verify that the apex file before and after this change are byte
        for byte identical.
Change-Id: I6a21edb8a5231666e3f35b2c99a8687f36dd98fd
2021-05-24 15:05:21 +01:00
Paul Duffin
f1b358cb57 Support hidden API processing for fragments with dependencies
Previously, a bootclasspath_fragment that depended on classes provided
by another bootclasspath_fragment did not support hidden API processing
as it would not supply information about those dependencies.

This change adds support for that as follows. Each fragment:
1. Exports the transitive sets of stub dex jars for each of the public,
   system, test and core_platform APIs (where relevant).
2. Adds dependencies onto its dependent fragments.
3. Retrieves the API stubs dex jars from its dependent fragments and
   passes them to the "hiddenapi list" tool which will use them to
   resolve dependencies but will not output them to the generated
   flags.

Once the flags are generated the existing encoding functionality
encodes the flags into the dex files of the bootclasspath_fragment's
content modules which are then packaged into the apex.

Bug: 179354495
Test: m com.android.sdkext
      - verify that this does not change the contents of the apex files
Change-Id: I3e82a6dbb437f1e417e5d7e25aeb212e378603d0
2021-05-24 14:56:10 +01:00
satayev
703c67a0a9 Populate individual systemserverclasspath_fragments' proto configs.
Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Ic0ae897e9baca75dcc022d84656496563645e74e
2021-05-24 13:41:20 +01:00