Commit Graph

4857 Commits

Author SHA1 Message Date
Paul Duffin 8255b2c5d1 Merge changes I16389102,I105f4fba am: 12206326d6 am: bbc5cbcf0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689752

Change-Id: I0fcae956aba20eb4c2db993396e74bb7949b3700
2021-04-29 12:52:54 +00:00
Paul Duffin e3ecce67c1 Make platform_bootclasspath a singleton module
This is needed in order to allow it to implement MakeVars so it can
create make variables just like the dexpreopt_bootjars and hiddenapi
singletons currently do.

Bug: 177892522
Bug: 179354495
Test: m nothing
Change-Id: Ida5bf8abeecde531e1f6430151650065445804ac
2021-04-29 13:37:16 +01:00
Paul Duffin 0c22202947 Merge "Add stub_libs properties to bootclasspath_fragment snapshot" am: 50599f7735 am: ce7396186d am: 454efed2ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686206

Change-Id: If2a3d61b51248c32c70fffc13afc39eb73f9d053
2021-04-29 10:52:40 +00:00
Paul Duffin f7a5592d38 Move dumpOatRules to platform_bootclasspath
Bug: 177892522
Test: m oat-dump-boot
      - test output to make sure that this change does not change the
        generated files, at least no more than no changes do as the
	output from this rule is not deterministic. See b/186459873.

Change-Id: Ib2b4203d9bb1fd0ee9443aee4e58b54b38b491cf
2021-04-29 11:50:48 +01:00
Paul Duffin 4c094428a7 Move generateUpdatableBcpPackagesRule to platform_bootclasspath
Changes generateUpdatableBcpPackagesRule to use ModuleContext instead
of SingletonContext and moves the call from dexpreoptBootJar's
GenerateSingletonBuildActions method to platform_bootclasspath's
GenerateAndroidBuildActions.

Bug: 177892522
Test: lunch art_module_arm64
      m out/soong/module_arm64/dex_bootjars/updatable-bcp-packages.txt
      - make sure it is not affected by this change
Change-Id: I9741ae1eb9573cafe12dd7a17dc1d8449b224dc8
2021-04-29 11:50:48 +01:00
Paul Duffin 01b463bc06 Differentiate between art, non-updatable and updatable modules
Bug: 177892522
Test: lunch art_module_arm64
      m out/soong/module_arm64/dex_bootjars/updatable-bcp-packages.txt
      - make sure it is not affected by this change
Change-Id: I3d35f1664cbbaba5df3f5809859dd9815a26d05d
2021-04-29 11:50:42 +01:00
Paul Duffin 9bacf56564 Extract logic to gather deps added for <apex>:<module> pairs
Trades having to traverse a module's direct dependencies multiple times
for reusable code. While at the minute the amount of duplicated code is
small (checking a tag and appending to a list) follow up changes will
modify the gatherApexModulePairDepsWithTag module to improve error
reporting greatly increasing the benefit of deduping.

The cost of traversing a module's direct dependencies is very small as
there will be only a very few dependencies.

Bug: 177892522
Test: m nothing
Change-Id: I16389102abd8038e1bfa52b63f4153bdf92ff553
2021-04-29 11:34:59 +01:00
Paul Duffin 454efed2ed Merge "Add stub_libs properties to bootclasspath_fragment snapshot" am: 50599f7735 am: ce7396186d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686206

Change-Id: I03ad268a1e143379747212c9724ad90c3ab5865c
2021-04-29 10:17:37 +00:00
Paul Duffin a7c96bb1e5 Merge "Add support for specifying api provided by bootclasspath_fragment" am: 0948060f50 am: 126a48b0c5 am: e30368dc81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686205

Change-Id: I4216d71d26a2e6256220359c60de0927119f5731
2021-04-29 10:02:29 +00:00
Paul Duffin e30368dc81 Merge "Add support for specifying api provided by bootclasspath_fragment" am: 0948060f50 am: 126a48b0c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686205

Change-Id: If9064df010fb534a0622024a9be8677f5ccc8b04
2021-04-29 09:46:14 +00:00
Paul Duffin 110b0add9e Treat "apex" system_ext the same as platform
Change https://r.android.com/1672245 added support to treat
system_ext:foo in the boot jars configuration the same as platform:foo,
at least for dexpreopt_bootjars.go's getBootJar.

This change replicates that mechanism in platform_bootclasspath and as
that now handles hidden API processing also made a similar change in
the isModuleInConfiguredList function.

Bug: 177892522
Bug: 154976937
Test: m nothing
Change-Id: I105f4fbaa3b0355b013b7c5618d218d888faefb6
2021-04-29 10:35:10 +01:00
Paul Duffin 895c7140a9 Add stub_libs properties to bootclasspath_fragment snapshot
Bug: 177892522
Test: m nothing
Change-Id: I7644122c4abed8e8bc2cc7b58f408bee3bdc91f6
2021-04-28 22:02:00 +01:00
Paul Duffin 1093158faf Add support for specifying api provided by bootclasspath_fragment
The hidden API processing needs access to dex stub jars for the API
scopes provided by the bootclasspath_fragment so that it can mark the
corresponding dex members as being part of that API. This change adds
the ability to specify the modules that provide those jars, resolve the
modules to dex jar stubs and make them available for other modules and
tests to use.

While the stubs are only needed for hidden API at the moment these were
not added to the hidden_api properties section as there are other parts
of the build that may need to access the stubs in future, e.g. api
fingerprint and aidl generation.

The stubs properties can be affected by coverage as when coverage is
enabled the jacoco-stubs needs adding to the list, just like how
jacocoagent is added to the contents.

Bug: 177892522
Test: m nothing
Change-Id: I31097d1ca45c84adeba4cbb38f693698cb289e99
2021-04-28 21:59:46 +01:00
Andrei-Valentin Onea bf9b4f53de Merge "Replace source based system server stubs" am: b75031e918 am: b45d115816 am: 4f4d9c9d3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642101

Change-Id: I9c3a0e3abd30743925d2019492967c6ad763fa0c
2021-04-28 20:22:58 +00:00
Andrei-Valentin Onea 4f4d9c9d3c Merge "Replace source based system server stubs" am: b75031e918 am: b45d115816
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1642101

Change-Id: Ic86a8c810b84173c2fe7f06d57a942d2b9082caa
2021-04-28 19:49:38 +00:00
Andrei-Valentin Onea b75031e918 Merge "Replace source based system server stubs" 2021-04-28 15:06:22 +00:00
Paul Duffin 388c7abb3f Merge "Extract IsModuleInVersionedSdk" am: 8d817b70e6 am: 6c101d7be6 am: 9e21db0381
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689387

Change-Id: I5db0695a6e4ff05a39d6d158aa58b3cdab539d3e
2021-04-28 14:20:34 +00:00
Paul Duffin 9e21db0381 Merge "Extract IsModuleInVersionedSdk" am: 8d817b70e6 am: 6c101d7be6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689387

Change-Id: I02f65fc878c95b33b91fb64b2dd19a9b75f3cdb0
2021-04-28 13:52:42 +00:00
Paul Duffin 8d817b70e6 Merge "Extract IsModuleInVersionedSdk" 2021-04-28 12:58:43 +00:00
Paul Duffin 08d1fab0ee Merge "Extract generateUpdatableBcpPackagesRule from updatableBcpPackagesRule" am: 0e98e86a3c am: ada6da8aa4 am: 28a48992cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686152

Change-Id: If7d4792dd003f4025f5b6f93688d5e42afb64bff
2021-04-28 12:46:24 +00:00
Paul Duffin 318e2c53b2 Merge "Remove special handling of frameworks/base/config/boot-profile.txt" am: c2477e8224 am: 497d026b5b am: 0771c16227
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686151

Change-Id: Id6f5067110e0710f2444f2d725fabad0f08b257f
2021-04-28 12:46:18 +00:00
Paul Duffin 953ee81825 Merge "Move bootFrameworkProfileRule to platform_bootclasspath" am: 9abfff5229 am: eec196310d am: c663ddce59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686150

Change-Id: Iba0466a5583e5e10b9a42f8708a09431bd7645d3
2021-04-28 12:46:06 +00:00
Paul Duffin 28a48992cd Merge "Extract generateUpdatableBcpPackagesRule from updatableBcpPackagesRule" am: 0e98e86a3c am: ada6da8aa4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686152

Change-Id: I4a75e0b1b2f8977aa3dd16ec0a135c5a06fa7c0c
2021-04-28 12:28:31 +00:00
Paul Duffin 0771c16227 Merge "Remove special handling of frameworks/base/config/boot-profile.txt" am: c2477e8224 am: 497d026b5b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686151

Change-Id: I8ca954a00664950b4a6d494ee10d45d594b29088
2021-04-28 12:28:26 +00:00
Paul Duffin c663ddce59 Merge "Move bootFrameworkProfileRule to platform_bootclasspath" am: 9abfff5229 am: eec196310d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686150

Change-Id: I9f240c97a1fbee88e51b127822791b0b7bf10f9e
2021-04-28 12:28:08 +00:00
Paul Duffin 466563d5c9 Merge "Automatically export bootclasspath_fragment stubs from sdk" am: 59dc69c2c7 am: 510e829ea5 am: 92659f37b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689068

Change-Id: Ie02075fd7521b5f1d4c10440157c0b79fa7d11f1
2021-04-28 08:07:45 +00:00
Paul Duffin 8cc2b616c1 Merge "Pass module to SdkMemberTypeDependencyTag.SdkMemberType" am: 6a77e77cf9 am: a4e28eb6ef am: ef45d2ce43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689067

Change-Id: If9d5acbb4aadab4d1b63693a919f1fdce754413b
2021-04-28 08:07:37 +00:00
Paul Duffin 44d1594081 Extract generateUpdatableBcpPackagesRule from updatableBcpPackagesRule
This simplifies the process of moving the updatableBcpPackagesRule to
the platform_bootclasspath by separating the gathering of the list of
updatable modules (which differs between the singleton and the
platform_bootclasspath module) from the gathering of the permitted
packages list and generation of the rule which are generally common.

Bug: 177892522
Test: lunch art_module_arm64
      m out/soong/module_arm64/dex_bootjars/updatable-bcp-packages.txt
      - make sure it is not affected by this change
Change-Id: I3cb64310f618059758a32cfe00d3745d52388e49
2021-04-28 09:03:46 +01:00
Paul Duffin 2ac45f019b Remove special handling of frameworks/base/config/boot-profile.txt
Previously, the method was run in repo manifests that did not include
the frameworks/base repository so it had to handle the file being
missing. However, now that this is being called from
platform_bootclasspath which is only defined in frameworks/base that
is no longer required.

Bug: 177892522
Test: m droid
Change-Id: I77fa5a204d1426a6be24a6f0b48e18f48f3dd908
2021-04-28 09:03:46 +01:00
Paul Duffin ad19d3858e Move bootFrameworkProfileRule to platform_bootclasspath
Changes bootFrameworkProfileRule to use ModuleContext instead of
SingletonContext and moves the call from dexpreoptBootJar's
GenerateSingletonBuildActions method to platform_bootclasspath's
GenerateAndroidBuildActions.

Changing the context also allows the code to switch from
bootFrameworkProfileRule to GetGlobalSoongConfig.

Also extracts the shouldBuildBootImages function so it can be used by
platform_bootclasspath to preserve the existing behavior.

Bug: 177892522
Test: m droid
Change-Id: I30d3ca10be7f84348ad3aa9cc984dd15b8f6f4e9
2021-04-28 09:03:46 +01:00
Paul Duffin 92659f37b3 Merge "Automatically export bootclasspath_fragment stubs from sdk" am: 59dc69c2c7 am: 510e829ea5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689068

Change-Id: Id0d7393cc95b38579e11769d4c9fc61036603827
2021-04-28 07:34:58 +00:00
Paul Duffin ef45d2ce43 Merge "Pass module to SdkMemberTypeDependencyTag.SdkMemberType" am: 6a77e77cf9 am: a4e28eb6ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689067

Change-Id: Ie49d51cba706e0d5c568b5e3ef3fa8f5febc2061
2021-04-28 07:34:48 +00:00
Paul Duffin 0c2e08312c Extract IsModuleInVersionedSdk
Bug: 177892522
Test: m nothing
Change-Id: I348d380a0d29abdd6a84420be52cc1b674f2a7ab
2021-04-28 00:39:52 +01:00
Paul Duffin 976b0e5bbb Automatically export bootclasspath_fragment stubs from sdk
This change makes the tag that is used to add dependencies onto stubs
from the bootclaspath_fragment module cause the dependency to be
automatically exported from the sdk. If the dependency is a
java_sdk_library then it will be as if it was added to the
java_sdk_libs property, otherwise it will be as if it was added to the
java_header_libs property instead.

Bug: 177892522
Test: m nothing
Change-Id: I97010c4342dd39415dba81a4395db7831410436e
2021-04-27 23:27:34 +01:00
Paul Duffin eee466e439 Pass module to SdkMemberTypeDependencyTag.SdkMemberType
This change allows an SdkMemberTypeDependencyTag to select the
SdkMemberType to use to add a dependency based on the module.

Bug: 177892522
Test: m nothing
Change-Id: I2d6e51b615636dc7cd41da65808ef851dd8ae6ac
2021-04-27 23:23:20 +01:00
Paul Duffin 7fbc5842cd Merge "Extract default image specific logic from buildBootImage" am: 6d4de43833 am: 29b18b8c17 am: 8db612ebab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686149

Change-Id: Ic8a3591508399db477da9a72f21ee9619373cebc
2021-04-27 17:43:17 +00:00
Paul Duffin 6aa72dca5e Merge "Simplify missing deps handling in buildBootImage" am: c42a738bc4 am: c7cf6ac1e7 am: 3d87058cf8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686148

Change-Id: I9a4ec33c1b70563b23791588f132444cc384d7f7
2021-04-27 17:43:11 +00:00
Paul Duffin 67cb5fb7f3 Merge "Remove panics from reportMissingVariationDependency" am: a75af16878 am: b49dae2874 am: 539a24e1d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686147

Change-Id: I8e184836ffec1c13cbefc802db9761999a0f0dfd
2021-04-27 17:43:02 +00:00
Paul Duffin 8db612ebab Merge "Extract default image specific logic from buildBootImage" am: 6d4de43833 am: 29b18b8c17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686149

Change-Id: Ifd9767dc1b40ac4a5346c7528329fb314aadfddc
2021-04-27 17:42:25 +00:00
Paul Duffin 3d87058cf8 Merge "Simplify missing deps handling in buildBootImage" am: c42a738bc4 am: c7cf6ac1e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686148

Change-Id: I9d5ef5fce5a283d55e7128fd41869e6dd8db5ff0
2021-04-27 17:42:16 +00:00
Paul Duffin 539a24e1d0 Merge "Remove panics from reportMissingVariationDependency" am: a75af16878 am: b49dae2874
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686147

Change-Id: Ie70916fa9d33bf32e9e6bd41506e07d7a721e391
2021-04-27 17:41:55 +00:00
Paul Duffin 5861242a78 Extract default image specific logic from buildBootImage
Previously, buildBootImage had to be called for the default boot image
config before the art boot image config as it created some rules which
were specific to default boot image. The creation of these rules was
encapsulated in Config().Once(..) to ensure that they were only ever
created once.

This change extracts that functionality out of buildBootImage to the
calling method which means that they are only called once and so no
longer need protecting against being called again.

Bug: 177892522
Test: m droid
Change-Id: I464477de1a08df15e577873a9accf7db2bc088d1
2021-04-27 15:56:47 +01:00
Paul Duffin 57e2e7d199 Simplify missing deps handling in buildBootImage
Previously, the buildBootImage function maintained a list of
missingDeps that was returned from findAndCopyBootJars and was passed
to various other methods that created ninja rules that depended on the
files created by findAndCopyBootJars. The purpose of that list was
basically to record that findAndCopyBootJars could not find some files
so that the subsequent ninja rules could be marked as being in error.

This changes avoids having to explicitly propagate the missing deps to
each rule by instead having findAndCopyBootJars generate an error rule
instead of a Cp rule for any missing file. That means that any attempt
to build any rule that depends on the missing file will fail when the
missing file is created.

Bug: 177892522
Test: Add an unknown module to PRODUCT_BOOT_JARS
      lunch art_module_arm64
      - Run each of the following targets and made sure it failed with a
        message indicating that the unknown module was missing.
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/module_arm64/dex_bootjars/boot.prof
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/generic_arm64/dex_bootjars/boot.bprof
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/generic_arm64/dex_bootjars/updatable-bcp-packages.txt
Change-Id: Ib7196c128419fbffdfeb61c1c5d47a3b08d1e132
2021-04-27 15:56:47 +01:00
Paul Duffin 81667c8c11 Remove panics from reportMissingVariationDependency
The code that has been removed triggers in many cases when it should
not, e.g. an unknown module on the bootclasspath. The code was
originally added to try and ensure that if the attempt to add useful
error messages failed it would help debug the issue. However, it ended
up just creating more failures.

If this does become an issue then this will be revisited.

Bug: 177892522
Test: Add an unknown module to PRODUCT_BOOT_JARS
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true
Change-Id: I08dbd4b29d301f3f1f78a0fb396687062b47deb8
2021-04-27 15:56:47 +01:00
Treehugger Robot f7e6ab6eab Merge "Drop DexPreoptImages field in dexpreopt config" am: bdae1e5765 am: 73ec83be2c am: 51801ac108
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686011

Change-Id: I36a7c371baadf9c19bb7c03efcaebefee6b4b336
2021-04-27 03:23:10 +00:00
Treehugger Robot 51801ac108 Merge "Drop DexPreoptImages field in dexpreopt config" am: bdae1e5765 am: 73ec83be2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686011

Change-Id: I32468596016b597a7717eaf1e6a618b12f1a5a97
2021-04-27 02:57:14 +00:00
Treehugger Robot bdae1e5765 Merge "Drop DexPreoptImages field in dexpreopt config" 2021-04-27 01:53:45 +00:00
Paul Duffin 04c7a35a60 Merge "bootclasspath_fragment: Always output contents property in snapshot" am: aef7fcfa7e am: 817d462f97 am: b9e926f26a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686127

Change-Id: Ie02e884b4271c39c4a101e326c85eb2207434c76
2021-04-26 23:38:51 +00:00
Paul Duffin 940a777464 Merge "Automatically add bootclasspath_fragment contents to sdk" am: 56d3ea4998 am: 7d43ff1fd8 am: b157de0c84
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686126

Change-Id: I809cb2e96f550dc718886e8a78e20e7795883bd2
2021-04-26 23:37:45 +00:00
Paul Duffin d9668be58b Merge "Allow contents and image_name to be specified together" am: 3d14889c5b am: 1081c7d85e am: 143eb249d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686066

Change-Id: I0a6cce08f1c1b48aa2e9a1832212bf7aa2d8fdec
2021-04-26 23:36:31 +00:00
Paul Duffin b9e926f26a Merge "bootclasspath_fragment: Always output contents property in snapshot" am: aef7fcfa7e am: 817d462f97
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686127

Change-Id: I1963c51ffd3b4370d7fdac41d90a13a059edab55
2021-04-26 23:12:39 +00:00
Paul Duffin b157de0c84 Merge "Automatically add bootclasspath_fragment contents to sdk" am: 56d3ea4998 am: 7d43ff1fd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686126

Change-Id: I2adc481b5f3716bba1410120643e77cd91ad5c9b
2021-04-26 23:12:05 +00:00
Paul Duffin 143eb249d6 Merge "Allow contents and image_name to be specified together" am: 3d14889c5b am: 1081c7d85e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686066

Change-Id: I783a73cca2c05596477f46c9b38bf9bc3ba4b68e
2021-04-26 23:10:58 +00:00
Paul Duffin 94cc88a03c Extract java SdkMemberType instances as vars am: 2da0424b19 am: 233f0ac8eb am: 25c77484ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686125

Change-Id: Id7829a5d0f4e45085b597453d42d0d69ebfdfd1b
2021-04-26 21:00:49 +00:00
Paul Duffin 702254af25 Merge "Add coverage specific properties to bootclasspath_fragment" am: ef289f8853 am: ceeb8949f9 am: 5c11c01785
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686065

Change-Id: I342e755de9614c20eaf09f33488d58f1242db312
2021-04-26 21:00:44 +00:00
Paul Duffin 25c77484ae Extract java SdkMemberType instances as vars am: 2da0424b19 am: 233f0ac8eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686125

Change-Id: Ife206868863091d56765e9c8d85f3a6643633baf
2021-04-26 20:37:19 +00:00
Paul Duffin 5c11c01785 Merge "Add coverage specific properties to bootclasspath_fragment" am: ef289f8853 am: ceeb8949f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686065

Change-Id: Id1b8730e45818608e7727d04e01b29567cc13591
2021-04-26 20:37:13 +00:00
Paul Duffin 2dc665bb48 bootclasspath_fragment: Always output contents property in snapshot
Bug: 177892522
Test: m art-module-sdk
      - check generated snapshot contains contents property
Change-Id: I122dedba6600a199bfd83b01988da36ddfd09d63
2021-04-26 21:21:58 +01:00
Paul Duffin e95b53a55d Automatically add bootclasspath_fragment contents to sdk
Previously, both a bootclasspath_fragment and its contents had to be
explicitly added to the sdk. This change means that adding a
bootclasspath_fragment to and sdk will automatically add its contents
as if they were added using java_boot_libs.

Bug: 177892522
Test: m nothing
Change-Id: I8f7e70649f272c9a109d4606571a2d12c44b7904
2021-04-26 21:21:58 +01:00
Paul Duffin ba6afd0dba Allow contents and image_name to be specified together
Previously, only one of the contents or image_name properties could be
specified at once which meant that there was no way to create a
prebuilt which lists its fixed contents while at the same time allowing
it to check that that the contents matched what the build configuration
required.

e.g. a prebuilt_bootclasspath_fragment that had image_name: "art",
could not list its contents and also check that those contents matched
the ART_APEX_JARS which the build configuration required.

This change allows contents and image_name to be specified together and
adds a check to make sure that the contents are consistent with the
configuration appropriate to the image_name. The check is only
performed for modules that are active so that a
prebuilt_bootclasspath_fragment which was created without coverage
enabled (the default) would not cause a build failure in a coverage
build unless it was preferred.

Bug: 177892522
Test: m nothing
Change-Id: Ie601f29f707b3f6030fa7d252afa2c4826cc9f8e
2021-04-26 21:21:58 +01:00
Paul Duffin 2da0424b19 Extract java SdkMemberType instances as vars
This will allow them to be used from elsewhere in a follow up change.

Bug: 177892522
Test: m nothing
Change-Id: I60e94e148af5b1810aea7f724cba090b49ae758e
2021-04-26 21:21:58 +01:00
Paul Duffin 3f81c1c71c Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" am: 46e4a9e6b1 am: 8745a28532 am: d905f6818a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686218

Change-Id: Ifea7de140ee9c69cd6afe85bbc1dfab24e446160
2021-04-26 17:04:45 +00:00
Paul Duffin 3a351c3dbe Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9 am: 8067ee44b3 am: 9e55ae0bd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I2a559dbb5dc14cfcf52407e371a0e628ac693634
2021-04-26 17:04:27 +00:00
Paul Duffin 9d3ea7018d Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" am: 00b47c4a6e am: 5fd9799be6 am: 587c558a1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686215

Change-Id: Ie77a71113bb40ad6474b1f189f6751fc9ef7c8d9
2021-04-26 17:03:44 +00:00
Paul Duffin d905f6818a Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" am: 46e4a9e6b1 am: 8745a28532
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686218

Change-Id: Idbad33644ef2e49fe38e3317d119dfe871404200
2021-04-26 16:37:43 +00:00
Paul Duffin 9e55ae0bd8 Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9 am: 8067ee44b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I5d86b467f47dcf281a99dc157421176aa2220570
2021-04-26 16:37:33 +00:00
Paul Duffin 587c558a1a Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" am: 00b47c4a6e am: 5fd9799be6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686215

Change-Id: I075f02fdbdeed17726654508e49256402619fe53
2021-04-26 16:37:25 +00:00
Paul Duffin c7d1644b0b Add coverage specific properties to bootclasspath_fragment
This allows a bootclasspath_fragment (specifically the
art-bootclasspath-fragment) to specify additional contents to be
appended when coverage is enabled.

The art-bootclasspath-fragment will use this to add jacocoagent to its
contents to ensure that it is always consistent with the configuration.

Bug: 177892522
Test: m nothing
Change-Id: I50d05fe5e0e9b8c14bdf3dfd63bba0ac97e31d48
2021-04-26 17:22:28 +01:00
Paul Duffin 46e4a9e6b1 Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" 2021-04-26 16:12:45 +00:00
Paul Duffin 71c84696f9 Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" 2021-04-26 16:12:16 +00:00
Paul Duffin 00b47c4a6e Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" 2021-04-26 15:42:29 +00:00
Jeongik Cha b19b58a015 Drop DexPreoptImages field in dexpreopt config
The field isn't used anymore.
And DexPreoptImagesDeps will have the slice of which size is the same as
Archs to avoid an error.

Bug: 158843648
Test: m
Change-Id: I520063ff7376811febbc82e1a0a43785feb5bbb2
2021-04-26 23:41:40 +09:00
Paul Duffin 190fdef294 Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment
The dex boot jar for the apex must have had hidden API flags encoded
into it. Currently, the hidden API processing is done within the java
modules themselves so the apex gets the dex boot jar from them.

However, as part of the hidden API modularization work the hidden API
encoding will be performed by the bootclasspath_fragment so this change
prepares for that by delegating the retrieval of the dex boot jars to
the bootclasspath_fragment, via BootclasspathFragmentApexContentInfo.

For the moment that simply delegates straight back to the java module
so this change does not change the build. It will however make it
easier to switch hidden API encoding to the bootclasspath_fragment in
future.

Bug: 179354495
Test: m com.android.art
      - verify that this change does not change its contents
Change-Id: I12eba333749be976bcc72661bb9d6be6cc3c56e3
2021-04-26 11:09:25 +01:00
Paul Duffin e946b327f4 Rename BootImageInfo to BootclasspathFragmentApexContentInfo
Currently, it only contains ART boot image related information, i.e.
.art, .oat and .vdex files. However, follow up changes will extend that
to include other information from bootclasspath_fragment.

Bug: 177892522
Test: m nothing
Change-Id: I2b226131c0eccff0c739a18f265f90caa10a91d9
2021-04-26 10:05:27 +01:00
Vladimir Marko ed4839ef89 Merge "profman: Clean up output profile type options." am: fa64af9961 am: cc48381c3d am: 1560c68a3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685591

Change-Id: I5f6d74f008e3b9f0855a30a6f02f3b4aae9b28b0
2021-04-26 08:45:28 +00:00
Vladimir Marko 1560c68a3a Merge "profman: Clean up output profile type options." am: fa64af9961 am: cc48381c3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685591

Change-Id: Iaad70db39a2d21894c099123d3b04ecb604c9fc1
2021-04-26 08:20:50 +00:00
Vladimir Marko fa64af9961 Merge "profman: Clean up output profile type options." 2021-04-26 07:34:21 +00:00
Paul Duffin f13e07eee2 Remove unused setting of BootImageInfo for platform_bootclasspath
The BootImageInfo is used to populate an apex. A platform_bootclasspath
module cannot be part of an apex so does not need to provide one.

Bug: 177892522
Test: m nothing
Change-Id: I1e1c4962d9d8106a12af80107c4c35828f54ff81
2021-04-25 21:38:14 +01:00
Paul Duffin ff79fcac84 Allow exporting of sdk members to be done per tag am: a720811c38 am: 68dc0a1210 am: 7cfcf56b07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686073

Change-Id: Iaf2d2f7776ab4873ae290023ce5c783fe50eb1b6
2021-04-25 09:22:18 +00:00
Paul Duffin 7cfcf56b07 Allow exporting of sdk members to be done per tag am: a720811c38 am: 68dc0a1210
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686073

Change-Id: I66b7b1f0c254e488e3d17353c5da69e8605b0717
2021-04-25 09:02:06 +00:00
Paul Duffin a720811c38 Allow exporting of sdk members to be done per tag
Previously, every module added to an sdk directly through one of the
SdkMemberType specific properties, e.g. java_libs, was exported and
every module added automatically via a transitive dependencies was not
exported. This change allows that behavior to be customized per tag.

Bug: 186290299
Test: m art-module-sdk
      - verify that this change does not affect its contents.
Change-Id: I563b5bcd823e61c23cdb706cfcbb13337963d550
2021-04-24 22:30:26 +01:00
Paul Duffin defcca19af Merge "Remove unused boot_image module type, prebuilt and sdk member type" am: 95661aab07 am: eb2abd05b9 am: 3aa522ece3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685590

Change-Id: Ie8af346df2979b368130cde35047d5e54e6b7082
2021-04-23 23:38:46 +00:00
Paul Duffin 3aa522ece3 Merge "Remove unused boot_image module type, prebuilt and sdk member type" am: 95661aab07 am: eb2abd05b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685590

Change-Id: I0c618b0920c03bbed8d302be212818bf7fc0af44
2021-04-23 23:03:46 +00:00
Paul Duffin 94993d5ce5 Rename BootImageModule to BootclasspathFragmentModule am: 7771eba88e am: 687425b0af am: 30b9c47cb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685589

Change-Id: I1898516696beb6049ee1467832455dc1bfdab6f2
2021-04-23 18:57:27 +00:00
Paul Duffin 30b9c47cb7 Rename BootImageModule to BootclasspathFragmentModule am: 7771eba88e am: 687425b0af
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685589

Change-Id: I1d09dee1f01774f83b0ca06da3bbab5a9c7f5fe2
2021-04-23 18:35:16 +00:00
Paul Duffin d19f579cea Merge changes Ic32f02a6,Ibe358542 am: d5f8421afd am: e6e95f392a am: 3b7084417b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685586

Change-Id: Ic32a38e064ef652375c8a4da9ab7f9cb497f6da4
2021-04-23 16:38:00 +00:00
Jaewoong Jung 19ef691538 Merge "Fix minor issues in updatability lint CLs." am: 8811dcbb22 am: f623005952 am: ab6d61d1ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1684886

Change-Id: Ie315db88ce15bdbca85c2647bd4a160696b21932
2021-04-23 16:37:53 +00:00
Paul Duffin 3b7084417b Merge changes Ic32f02a6,Ibe358542 am: d5f8421afd am: e6e95f392a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685586

Change-Id: I4064c3f51a43583c2ccd4c6ea1ccfbcecc7eb545
2021-04-23 16:15:46 +00:00
Jaewoong Jung ab6d61d1ea Merge "Fix minor issues in updatability lint CLs." am: 8811dcbb22 am: f623005952
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1684886

Change-Id: I461530dd340ebb05c10206f8a8b84598a2906ff6
2021-04-23 16:15:38 +00:00
Paul Duffin 8ab3f70cab Merge "Extract general bootclasspath related code into java/bootclasspath.go" am: fbe3a73d48 am: ec874c8232 am: 698629b21e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683884

Change-Id: I4048298a97763bcea925787907734ddf60034e92
2021-04-23 16:05:10 +00:00
Paul Duffin df160eb463 Remove unused boot_image module type, prebuilt and sdk member type
Bug: 177892522
Test: m nothing
Change-Id: I5763b55992e4113506ae5ccdaf9865ee27d8b041
2021-04-23 17:00:26 +01:00
Paul Duffin 7771eba88e Rename BootImageModule to BootclasspathFragmentModule
Also renames files, tests, module types in a similar fashion.

There are still some references to image and boot image. They are kept
for the following reasons:
* image_name - this is the name of an ART boot image, i.e. the
  collection of .art/.oat/.vdex files.
* BootImageInfo - again this is related to the ART boot image.
* .../art_boot_images/... paths - ditto.

Bug: 177892522
Test: m nothing
Change-Id: Ie1f4738061d131fee75de48bc26a7601481bad4d
2021-04-23 16:59:26 +01:00
Paul Duffin d5f8421afd Merge changes Ic32f02a6,Ibe358542
* changes:
  Export classesJars initialized in hiddenAPIExtractInformation
  Generalize the platformBootclasspathDepsMutator
2021-04-23 15:57:46 +00:00
Paul Duffin 698629b21e Merge "Extract general bootclasspath related code into java/bootclasspath.go" am: fbe3a73d48 am: ec874c8232
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683884

Change-Id: I73f3bdc0f529faa17d2917b21cc258920c5ed196
2021-04-23 15:43:24 +00:00
Treehugger Robot 0138a307a7 Merge "Don't plumb PRODUCT_*_CLASSPATH vars to make." am: 784ad87dd6 am: ae5c25073c am: 9b4279d516
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670070

Change-Id: I3829855044e86b762464cef1ca299ea0be761287
2021-04-23 15:34:16 +00:00
Jaewoong Jung 8811dcbb22 Merge "Fix minor issues in updatability lint CLs." 2021-04-23 15:31:41 +00:00
Treehugger Robot 9b4279d516 Merge "Don't plumb PRODUCT_*_CLASSPATH vars to make." am: 784ad87dd6 am: ae5c25073c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670070

Change-Id: I7ee3c678a6efe7f94c3ce704bd1cae1bd2e78df1
2021-04-23 15:11:18 +00:00
Paul Duffin fbe3a73d48 Merge "Extract general bootclasspath related code into java/bootclasspath.go" 2021-04-23 15:04:10 +00:00
Treehugger Robot 784ad87dd6 Merge "Don't plumb PRODUCT_*_CLASSPATH vars to make." 2021-04-23 14:32:33 +00:00
Vladimir Marko 230bd421a8 profman: Clean up output profile type options.
Test: m  # Check output boot profiles with hexdump.
Bug: 148067697
Change-Id: Ic20f415ad4eee1fd6396f320b757420884764d2c
2021-04-23 15:19:16 +01:00
Paul Duffin 49358086fd Merge "Add exported_bootclasspath_fragments to prebuilt_apex/apex_set" am: ed0b64f65b am: 07b9400abb am: 7c1dda11a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683869

Change-Id: I696556aa85dd3d4ca01db854cae0df92f571f999
2021-04-23 14:02:39 +00:00
Paul Duffin 7c1dda11a6 Merge "Add exported_bootclasspath_fragments to prebuilt_apex/apex_set" am: ed0b64f65b am: 07b9400abb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683869

Change-Id: Iab8bbbde2a28b760f746cba92adabc403392838b
2021-04-23 13:38:08 +00:00
Paul Duffin 023dba0a3f Add exported_bootclasspath_fragments to prebuilt_apex/apex_set
This is needed to allow a prebuilt_bootclasspath_fragment to be used
interchangeably with a bootclasspath_fragment in the
platform_bootclasspath module.

The platform_bootclasspath module depends on APEX specific variants of
bootclasspath_fragment modules. That works because the
bootclasspath_fragment modules are part of an apex and so have an APEX
specific variant which the platform_bootclasspath can specify.

Using a prebuilt_bootclasspath_fragment in place of a
bootclasspath_fragment requires that the prebuilt also has an APEX
specific variant.

Specifying exported_bootclasspath_fragments on a prebuilt_apex/apex_set
will cause it to create an APEX variant for the named module whcih will
allow it to be selected by the platform_bootclasspath module.

Bug: 186034565
Bug: 177892522
Test: m nothing
Change-Id: I7ddacc6498ec3a4a9f26c5f78b7f9a033e494d78
2021-04-23 12:12:37 +01:00
Paul Duffin 36187b2cf3 Export classesJars initialized in hiddenAPIExtractInformation
This exports classesJars constructed in hiddenAPIExtractInformation
through the hiddenAPIIntf interface for use by the
bootclasspath_fragment module type.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: Ic32f02a69229d9518772fe6b2a329501dd8cd849
2021-04-23 09:32:14 +01:00
Paul Duffin b67d878b80 Extract general bootclasspath related code into java/bootclasspath.go
The platform_bootclasspath and bootclasspath_fragment modules provide
different capabilities but are related and so have some common
functionality. This change moves some platform_bootclasspath code that
will be of use for bootclasspath_fragment in future into a separate
file.

Bug: 177892522
Test: m nothing
Change-Id: I827b85e33d16155fcc920d553100c9e99267dc4e
2021-04-23 09:32:14 +01:00
Paul Duffin 4994d26bfa Generalize the platformBootclasspathDepsMutator
Adds a BootclasspathDepsMutator that is currently only implemented by
the platform_bootclasspath but which can be implemented by
bootclasspath_fragment too.

Bug: 177892522
Test: m nothing
Change-Id: Ibe35854281004d6e40bf1f797144fb582e8c08b9
2021-04-23 09:32:14 +01:00
Treehugger Robot 1ae7fcd51c Merge "Expose "full" dexpreopt.config" am: a3693772a6 am: 375e5d7a47 am: fcf8e11732
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1666384

Change-Id: I182ab0a4ebdb80eb9ff812fb8d21607525769d80
2021-04-23 08:10:51 +00:00
Treehugger Robot fcf8e11732 Merge "Expose "full" dexpreopt.config" am: a3693772a6 am: 375e5d7a47
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1666384

Change-Id: I16478381c334c2a47b4bb193aed9c180b609c152
2021-04-23 07:46:03 +00:00
Treehugger Robot a3693772a6 Merge "Expose "full" dexpreopt.config" 2021-04-23 06:47:57 +00:00
Jaewoong Jung 3c87b1df11 Fix minor issues in updatability lint CLs.
Test: TreeHugger
Bug: 182349282
Change-Id: Ifae282d51b088d0562605b41a09696d75c5138f1
2021-04-22 13:40:41 -07:00
Paul Duffin d0283d0a5a Merge "bootclasspath_fragment: Add hidden API flag files to snapshot" am: 0f28a51669 am: b9ede6228f am: c5e960d1ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682091

Change-Id: Ic8ed89598074bc89aaef2d6081e2884b73ee6ef5
2021-04-22 17:22:42 +00:00
Paul Duffin 3b34058072 Merge "bootclasspath_fragment: Add contents to snapshot" am: 6e0a62b773 am: 889010d73a am: 855362a5da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682090

Change-Id: Ie107e8986b9b0dc4251f8e28427399854b44ec43
2021-04-22 17:22:35 +00:00
Paul Duffin d36bd335f9 Merge "Workaround build failure in coverage build" am: c69bfdd53b am: eb3fecce39 am: ab2941a932
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683873

Change-Id: If44e9885f4c1e3d7743bd7a9187f8dca30fdfcad
2021-04-22 17:22:28 +00:00
Paul Duffin c5e960d1ae Merge "bootclasspath_fragment: Add hidden API flag files to snapshot" am: 0f28a51669 am: b9ede6228f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682091

Change-Id: I4feae7a8f003604eeda442fec6b118a8596baaae
2021-04-22 17:20:27 +00:00
Paul Duffin 855362a5da Merge "bootclasspath_fragment: Add contents to snapshot" am: 6e0a62b773 am: 889010d73a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682090

Change-Id: I1a34c19f2fd2ceda3d7353f933a31957d1844d54
2021-04-22 17:10:41 +00:00
Paul Duffin ab2941a932 Merge "Workaround build failure in coverage build" am: c69bfdd53b am: eb3fecce39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683873

Change-Id: I9d3985c9bd13058a8ec1c2469b0cdc695f7e9a8d
2021-04-22 17:10:34 +00:00
Paul Duffin 0f28a51669 Merge "bootclasspath_fragment: Add hidden API flag files to snapshot" 2021-04-22 17:02:58 +00:00
Paul Duffin 6e0a62b773 Merge "bootclasspath_fragment: Add contents to snapshot" 2021-04-22 17:01:24 +00:00
Paul Duffin c69bfdd53b Merge "Workaround build failure in coverage build" 2021-04-22 16:54:12 +00:00
Paul Duffin a9dd6faae5 Workaround build failure in coverage build
The jacocoagent is special as while it is depended on by prebuilts it
is not actually a prebuilt.

Bug: 177892522
Bug: 186118711
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true nothing
      Previous command fails without this change and works with it.
Change-Id: I8fba922fc40919936d74a6f95af745e37f1ca61f
2021-04-22 17:31:50 +01:00
Jaewoong Jung abf3d40d84 Merge changes Ia74a2b83,I30a46c8f,Iac7c0149 am: d6599f5573 am: a9aa24ea33 am: c7f1d66e2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683373

Change-Id: I6cb94032c7ddb0b62dad2dbb4a3b2ac5fe31ec68
2021-04-22 16:18:18 +00:00
Paul Duffin 5bca2f26f2 Merge "Move monolithic stub flags generation to platform_bootclasspath" am: 57d13c6892 am: 5774eb9e14 am: ea69b4109b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683866

Change-Id: Id0e5e6dc8596b7d47fe65c47a66da7a86c20c6cb
2021-04-22 16:17:56 +00:00
Paul Duffin 1dfa82423f Merge "Extract common stub flags code" am: d631512659 am: d8d72e85f6 am: 9b76c7bee2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683865

Change-Id: I1225ec1b03ec04745e982918d8540298a7f6b9de
2021-04-22 16:17:20 +00:00
Jaewoong Jung c7f1d66e2c Merge changes Ia74a2b83,I30a46c8f,Iac7c0149 am: d6599f5573 am: a9aa24ea33
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683373

Change-Id: I39be09feff6fa678f31c8a131a1e66e8aa219046
2021-04-22 15:53:47 +00:00
Paul Duffin ea69b4109b Merge "Move monolithic stub flags generation to platform_bootclasspath" am: 57d13c6892 am: 5774eb9e14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683866

Change-Id: Ia4b4ad562a0e90351334cae9a323466f6c7a569b
2021-04-22 15:53:26 +00:00
Paul Duffin 9b76c7bee2 Merge "Extract common stub flags code" am: d631512659 am: d8d72e85f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683865

Change-Id: I2aa0acb55e98e1399516f582525419d93fbadc14
2021-04-22 15:53:13 +00:00
Jaewoong Jung d6599f5573 Merge changes Ia74a2b83,I30a46c8f,Iac7c0149
* changes:
  Add lint.strict_updatability_linting
  Move Java lint tests to lint_test.go
  Forbid bypassing updatability lint checks.
2021-04-22 15:39:41 +00:00
Paul Duffin 57d13c6892 Merge "Move monolithic stub flags generation to platform_bootclasspath" 2021-04-22 15:06:16 +00:00
Paul Duffin d631512659 Merge "Extract common stub flags code" 2021-04-22 15:05:54 +00:00
Paul Duffin 677de9427b Merge changes I67589bcc,Ibcfae390 am: 7cbdf81e95 am: 33f495f305 am: 13b9d25ed4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683868

Change-Id: Idb4d7af1bf9914bf7bf0306d04daf74ee992fc5e
2021-04-22 15:05:03 +00:00
Paul Duffin 13b9d25ed4 Merge changes I67589bcc,Ibcfae390 am: 7cbdf81e95 am: 33f495f305
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683868

Change-Id: I1b3d7fae197d3e072ac205cfe8e09a1c6bf0ddc3
2021-04-22 14:41:43 +00:00
Paul Duffin 7cbdf81e95 Merge changes I67589bcc,Ibcfae390
* changes:
  Replace boot image with bootclasspath fragment in sdk package
  bootclasspath_fragment must only depend on source contents
2021-04-22 14:02:43 +00:00
Anton Hansson 67e20e2ff8 Merge "Add new stub_only_static_libs attr for sdk_library" am: 24eac476d4 am: ec47b30e0e am: 05ecab28a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682097

Change-Id: Ie716a56bd455bead4ee1bad88203cb7d24d10512
2021-04-22 13:39:57 +00:00
Paul Duffin 74431d57c6 Move monolithic stub flags generation to platform_bootclasspath
As part of that this change:
* Moves code that will be common to platform_bootclasspath and
  bootclasspath_fragment from hiddenapi_singleton.go into
  hiddenapi_modular.go.
* Fixes the tests in hiddenapi_singleton_test.go but intentionally
  does not rename them or move them into a more appropriate place so
  as to make it easier to see the differences. A TODO has been added
  and these will be cleaned up in a follow up change.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I680e4dab2e6bdf4a655fa9f255c195175904667e
2021-04-22 14:23:28 +01:00
Paul Duffin 3e7fcc3fe7 Extract common stub flags code
The stubFlagsRule does three separate tasks:
1. It computes the set of modules that provide the stubs.
2. It scans all the modules to find the stub modules and retrieves the
   paths to their dex files.
3. It constructs the ninja rule.

Of those three tasks, 1 and 3 will be same for the
platform_bootclasspath. Instead of searching all the modules for the
ones that provide the stubs it will simply add dependencies onto the
stub modules and retrieve the dex file paths from them.

This change extracts tasks 1 and 3 into separate methods for reuse. It
also parameterizes the generation of the ninja rule.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I893845dbddc4b001dfd44d0e0b1c8a31b7f3f89f
2021-04-22 14:23:08 +01:00
Anton Hansson 05ecab28a3 Merge "Add new stub_only_static_libs attr for sdk_library" am: 24eac476d4 am: ec47b30e0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682097

Change-Id: Iafe4f8df922fc2234de596b1f1c3819accc50656
2021-04-22 13:11:33 +00:00
Anton Hansson 24eac476d4 Merge "Add new stub_only_static_libs attr for sdk_library" 2021-04-22 12:41:46 +00:00
Artur Satayev a34bee0ec5 Don't plumb PRODUCT_*_CLASSPATH vars to make.
They were used to generate export values for BOOTCLASSPATH and friends;
which are now generated by derive_classpath service based on proto
configs at runtime.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: Ifbf3f076a00e084d47a48180a4286fc53e610c5d
2021-04-22 13:35:52 +01:00
Anton Hansson dae54cd84f Add new stub_only_static_libs attr for sdk_library
Allow java_sdk_libraries to include libraries statically into their
stubs. The immediate use-case of this is to embed libcore notice files
into their stubs.

Also extend the java_sdk_library tests for impl/stub-only-libs, plus
some not assert utils.

Bug: 173186484
Bug: 184839599
Test: soong tests
Change-Id: I1ebf2f35c048eab5cec5125482a0304fe660f188
2021-04-22 10:20:13 +01:00
Rupert Shuttleworth 51fbe9023c Merge "Add various test files as testSrcs, so that they run on CI." am: dac451715b am: 950c2381dd am: bd7a5537b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683265

Change-Id: I689bd1e06c0ddf6166d8ff01496898095df72c97
2021-04-22 04:17:02 +00:00
Rupert Shuttleworth bd7a5537b8 Merge "Add various test files as testSrcs, so that they run on CI." am: dac451715b am: 950c2381dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683265

Change-Id: I9e1739c19cab87cdc17bed5a88e21e52f9d0f6df
2021-04-22 03:55:31 +00:00
Treehugger Robot 684051abed Merge "Add tempPathForRestat to improve consistency" am: f434cb5c1d am: 6c1532d37e am: 5aab26cdda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683867

Change-Id: Ib5b3dc68a1af2d479bd1b09546174c7c0f8c25e6
2021-04-22 03:37:46 +00:00
Treehugger Robot 5aab26cdda Merge "Add tempPathForRestat to improve consistency" am: f434cb5c1d am: 6c1532d37e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683867

Change-Id: I014911a6d439cdb52ddcc5372eaa6e03506e8ebb
2021-04-22 03:12:43 +00:00
Rupert Shuttleworth dac451715b Merge "Add various test files as testSrcs, so that they run on CI." 2021-04-22 03:08:21 +00:00
Jaewoong Jung 48de883834 Add lint.strict_updatability_linting
The flag prevents developers from skipping updatability lint checks with
baseline files

Test: lint_test.go & manual
Bug: 182349282
Change-Id: Ia74a2b83c7ef686124128bdf16f7b85a919d9e8d
2021-04-21 16:56:49 -07:00
Jaewoong Jung 11623b6052 Move Java lint tests to lint_test.go
Test: lint_test.go
Bug: 182349282
Change-Id: I30a46c8f704e66cd04541c78d3f22a140d3284ef
2021-04-21 16:56:43 -07:00
Jaewoong Jung 79e6f6bfcc Forbid bypassing updatability lint checks.
Test: lint_test.go
Bug: 182349282
Change-Id: Iac7c01493b449c2ddd6df6c68f8a74dfe72dfd7a
2021-04-21 16:56:19 -07:00
Paul Duffin 7c95555d79 bootclasspath_fragment: Add hidden API flag files to snapshot
These are needed at the moment to ensure the hidden API processing
generates the same set of flags whether it is being generated from
source or prebuilts. Soon these will be needed to ensure that the
hidden API flags generated for the individual modules are compatible
with previous releases.

Bug: 179354495
Test: m art-module-sdk and check snapshot zip contains the files
      and the generated Android.bp references them.
Change-Id: I9a3334cc48faa381bbbcbbb59479db719042796a
2021-04-21 23:54:22 +01:00
Paul Duffin a57835e8e5 bootclasspath_fragment: Add contents to snapshot
Bug: 177892522
Test: m nothing
Change-Id: I54fe0537b758a0e3dacd34b139ef3eb21b8841fd
2021-04-21 23:54:22 +01:00
Paul Duffin d3c1513df9 Add tempPathForRestat to improve consistency
Previously, there were two approaches used to construct the temporary
path needed by the commitChangeForRestat method and neither was
suitable for general use. One was:
    android.PathForOutput(ctx, outputPath.Rel()+".tmp")
The other was:
    combinedAidl.ReplaceExtension(ctx, "aidl.tmp")

The first approach would not work if the supplied path had been created
by PathForModuleOut() or similar as it would drop the module directory.
That could lead to the same path being used for multiple rules.

The second approach would not work for files with a different
extension.

The tempPathForRestat combines the two approaches so it can be used
generally with any WritablePath.

Bug: 179354495
Test: verified that the ninja rules that used these files were not
      changed by these changes.
Change-Id: I4439dea0a823512c281eeb1366522fb49dceb4e3
2021-04-21 23:26:57 +01:00
Paul Duffin 9edf2f1ee9 Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" am: eaa432d470 am: fb57372edb am: 3fb47c846b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682094

Change-Id: I842cc48154f5508a0e27cd6ea535524be33ee6fb
2021-04-21 18:25:53 +00:00
Paul Duffin 6589805e2a bootclasspath_fragment must only depend on source contents
This change ensures that bootclasspath_fragment only depends on source
modules and prebuilt_bootclasspath_fragment only depends on prebuilt
modules.

It does that in two ways:
1. It adds the dependencies in ComponentDepsMutator method which is
   called before any renaming of prebuilts is done which makes it very
   easy to add a dependency directly onto either the source or prebuilt
   as required.
2. It uses a tag which prevents dependencies on a source module from
   being replaced with a dependency on a prebuilt module which ensures
   that a dependency on the source modules is not replaced with a
   dependency on a prebuilt module.

Bug: 177892522
Test: m nothing
Change-Id: Ibcfae39083afbc07fcf729ead3ed5f5d020845bf
2021-04-21 19:05:37 +01:00
Paul Duffin 3fb47c846b Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" am: eaa432d470 am: fb57372edb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682094

Change-Id: Ic125330d65870ec4572c0bdbe238c9e65a612fc8
2021-04-21 18:02:52 +00:00
Paul Duffin eaa432d470 Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" 2021-04-21 17:14:56 +00:00
Rupert Shuttleworth b7e30760af Add various test files as testSrcs, so that they run on CI.
Test: go test
Test: TH (now that these are hooked up to TH)

Change-Id: Ia199794ef1a64074f3f9159f8c160ba3e45fd181
2021-04-21 11:23:57 -04:00
Paul Duffin e2eaacd31b Merge "Rename propertyAccessor to propertyValueReader" am: 9a26f8cf2a am: cfc5529a40 am: 1cec92551a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682432

Change-Id: I19bf5bcbd9d4020596c8c5c65e530503c5abc63e
2021-04-21 15:08:30 +00:00
Paul Duffin 1cec92551a Merge "Rename propertyAccessor to propertyValueReader" am: 9a26f8cf2a am: cfc5529a40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682432

Change-Id: If9edb3858b43411a2f81eb566bc0504c840f927b
2021-04-21 14:45:14 +00:00
Paul Duffin 894546d301 Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules
There is a check in initHiddenAPI that makes sure that if the source
module has been replaced by a prebuilt the prebuilt provides a boot dex
jar. The check was added to try and detect an issue with hidden API
processing early at build time rather than at runtime.

That check relies on the source module having a PrebuiltDepTag
dependency on the prebuilt module that is preferred and will be used by
hidden API processing. That is true for modules that are not in an APEX
but doesn't work for modules that are in an APEX.

The issue is that an APEX variant of a source module depends on the
non-APEX variant of the corresponding prebuilt module. However, that
variant of the prebuilt is not the one that will be used by hidden API
processing; it will use the APEX variant of the prebuilt module which
is the one that has access to the boot dex jar.

That results in the initHiddenAPI check giving a false negative as it
states that the boot dex jar is not available when it may be.

This change simply skips the check is the source module is an APEX
variant. This is a temporary work around as the hidden API processing
is being modularized for each APEX at which point initHiddenAPI will
either be removed entirely or just skipped for APEXes altogether.

Bug: 179354495
Bug: 185828824
Test: m nothing
Change-Id: I2dc3654c9aa476541855b3f0f243a181ddf8d723
2021-04-21 12:53:58 +01:00
Paul Duffin cc17bfe7de Rename propertyAccessor to propertyValueReader
Bug: 179354495
Test: m nothing
Change-Id: I956e93fdbe43e09b5460337d2eb72084440f14be
2021-04-21 10:14:02 +01:00
Jaewoong Jung abfbb7183f Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b am: cbb3825d86 am: 2c44af282d am: 51d2ef5cf1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1681228

Change-Id: I2e5630b7ad8a7c34c85a54a2ea2fa4c82b6e2d21
2021-04-20 23:54:19 +00:00
Jaewoong Jung 51d2ef5cf1 Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b am: cbb3825d86 am: 2c44af282d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1681228

Change-Id: Iddf5ae3c76e73e123342f0e2e2a3d8bd3b7c25cb
2021-04-20 23:29:46 +00:00
Jaewoong Jung cbb3825d86 Merge changes Ibdeb2e5a,I520a5af4,I0db32bec,Id3ab0f3b
* changes:
  Add lint_project_xml_test.py
  Rename lint-project-xml.py to remove dashes.
  Lint baseline file check in lint-project-xml
  Extract getBaselineFilepath method.
2021-04-20 22:59:38 +00:00
Jaewoong Jung 5a4202575e Rename lint-project-xml.py to remove dashes.
So that a future test can import it without a dirty syntax.

Test: m lint-check
Bug: 182349282
Change-Id: I520a5af49543801ab2a8ee888ff235876546dc74
2021-04-20 07:06:03 -07:00
Paul Duffin f4a24068fe Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" am: 42030eafff am: c06c6534ad am: 19257738c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675871

Change-Id: I9c8b8b7baba671fd322b0fa512e15093acde8218
2021-04-20 13:13:46 +00:00
Paul Duffin 19257738c4 Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" am: 42030eafff am: c06c6534ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675871

Change-Id: Ief66e4cffc81214e8e197c6a8d4604d2f9a86255
2021-04-20 11:26:54 +00:00
Paul Duffin 42030eafff Merge "platform_bootclasspath: aggregate hidden API flag files from fragments" 2021-04-20 11:02:23 +00:00
Paul Duffin 5c71e4255c Merge "java_sdk_library: Make dex stub jars available for hiddenapi" am: cb5d20887b am: 99e7f3354a am: bb4825abc1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1678146

Change-Id: I07839672b84caef91ef810bf2fa0b5f85c041067
2021-04-20 10:56:43 +00:00
Paul Duffin bb4825abc1 Merge "java_sdk_library: Make dex stub jars available for hiddenapi" am: cb5d20887b am: 99e7f3354a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1678146

Change-Id: Ia94ccad3365c41934a1b807a9ce5843f7c8f692c
2021-04-20 10:34:20 +00:00
Paul Duffin cb5d20887b Merge "java_sdk_library: Make dex stub jars available for hiddenapi" 2021-04-20 09:48:53 +00:00
Colin Cross fff5665f2e Merge "Reland: Add jni_libs property to java tests" am: 91fc8cbc73 am: 9f288cbe22 am: 55c7b4040a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680065

Change-Id: I02b9fcf8ef56ff66010250cee7b1311a45d6dc9a
2021-04-19 22:57:20 +00:00
Colin Cross 55c7b4040a Merge "Reland: Add jni_libs property to java tests" am: 91fc8cbc73 am: 9f288cbe22
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680065

Change-Id: I7bf54eafb384167d9d89d249bb366a87f4e41208
2021-04-19 22:18:38 +00:00
Colin Cross 82da9e5887 Merge changes Iefe133ce,I893f3dd0,I604a11c9 am: b5fa2646d8 am: 1edfe15518 am: 3e0b38d6ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675964

Change-Id: I4fd78410b40b37597497272adc081fff2b235b89
2021-04-19 18:43:13 +00:00
Colin Cross f8d9c499d4 Reland: Add jni_libs property to java tests
Add jni_libs property to java tests and treat it as test data that
should be copied to the lib or lib64 directory in the test directory.

This relands I3a118b933ab30dcd731c6dc2708da9bc63ab5520 with fixes for
the test on mac.

Fixes: 176593487
Test: java_test.go
Change-Id: I2f8c46643cff7a7ae6dc4d4dbad58f0396e45f09
2021-04-19 10:57:55 -07:00
Colin Cross 3e0b38d6ec Merge changes Iefe133ce,I893f3dd0,I604a11c9 am: b5fa2646d8 am: 1edfe15518
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675964

Change-Id: I886102e516f0862cefe6f9a39bdc93b46cf47c36
2021-04-19 16:28:27 +00:00
Jaewoong Jung 302c5b8d80 Extract getBaselineFilepath method.
Test: m nothing
Bug: 182349282
Change-Id: Id3ab0f3b7d398af9dcfd66ee3c0bda64d999178d
2021-04-19 08:54:36 -07:00
Colin Cross b5fa2646d8 Merge changes Iefe133ce,I893f3dd0,I604a11c9
* changes:
  Fix metalava api baseline update command
  sbox: print failing command line before output
  sbox: best-effort copy output files on failure
2021-04-19 15:34:57 +00:00
Jeongik Cha c6246671ea Expose "full" dexpreopt.config
1. Instead of 'slim' config, use full config even for libs
2. Define moduleJSONConfig for fields which cannot be converted to JSON
field directly(Path type field, ProfileBootListing,
DexPreoptImagesDeps are added in this CL) and exclude fields which is
convertible(DexPreoptImageLocations)

Bug: 158843648
Test: m dist
Change-Id: I3f9192ab5292bd079be1b686bb3b25735a836cbc
2021-04-19 18:24:42 +09:00
Colin Cross 289584c20c Merge "Revert "Add jni_libs property to java tests"" am: de1b891690 am: 6aaa526881 am: 964d4a4c7b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677947

Change-Id: I98779c7847902c12c1b7c4a2297764823c0542e3
2021-04-17 06:45:13 +00:00
Colin Cross 964d4a4c7b Merge "Revert "Add jni_libs property to java tests"" am: de1b891690 am: 6aaa526881
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677947

Change-Id: I0af8e86d59322272223e5ef9e0d31badc42b00ba
2021-04-17 06:17:21 +00:00
Treehugger Robot 33accf0115 Merge changes from topic "tvts-test-host-jni" am: aef14db78a am: 3640bc3f70 am: af25c6cab8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560314

Change-Id: I1894a0a5bc90eba3a8151813834864344c881790
2021-04-17 05:53:34 +00:00
Treehugger Robot af25c6cab8 Merge changes from topic "tvts-test-host-jni" am: aef14db78a am: 3640bc3f70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560314

Change-Id: I0a1531f9830b489fb04d44b23df3f895420ee41f
2021-04-17 05:29:50 +00:00
Colin Cross de1b891690 Merge "Revert "Add jni_libs property to java tests"" 2021-04-17 05:17:45 +00:00
Colin Cross 26616d4cfd Revert "Add jni_libs property to java tests"
This reverts commit 246164a055.

Reason for revert: broke the mac build
Bug: 176593487

Change-Id: Id0242e37aa40d84d291bf7b8ee46dfe98c4d5905
2021-04-17 05:17:03 +00:00
Treehugger Robot aef14db78a Merge changes from topic "tvts-test-host-jni"
* changes:
  Add jni_libs property to java tests
  Add Target to cc.SharedLibraryInfo
2021-04-17 04:35:24 +00:00
Colin Cross 246164a055 Add jni_libs property to java tests
Add jni_libs property to java tests and treat it as test data that
should be copied to the lib or lib64 directory in the test directory.

Fixes: 176593487
Test: java_test.go
Change-Id: I3a118b933ab30dcd731c6dc2708da9bc63ab5520
2021-04-16 21:59:23 +00:00
Colin Cross 63eeda027c Fix metalava api baseline update command
metalava is run inside sbox with a modified $PWD, so putting $PWD in
the output message results in an incorrect path.  It was also always
incorrect when the output directory was an absolute path.  Add a
cd $ANDROID_BUILD_TOP to the command line and use relative paths
instead.

Bug: 185516277
Test: m out/soong/.intermediates/frameworks/base/system-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp with lint error
Change-Id: Iefe133cea4c3a604ecd2b0ea20f4ba14ae13b425
2021-04-16 14:55:50 -07:00
Paul Duffin 1267d875b6 java_sdk_library: Make dex stub jars available for hiddenapi
The hidden API processing needs access to dex jars for the API stubs in
order to determine which dex members are part of an API surface. The
dex stubs used for the monolithic file are provided by normal
java_library modules for legacy reasons. However, the APEXes that
contribute to the bootclasspath, and so need to perform hidden API
processing, typically provide stubs created by a java_sdk_library.

This change adds support to java_sdk_library/_import to make the dex
stub jars available when requested, that involves:
1. Adding compile_dex property to java_sdk_library_import and
   propagating it down the the java_import modules for the stubs. That
   is already handled for java_sdk_library.
2. Propagating the java_sdk_library compile_dex property to the
   java_sdk_library_import in the generated snapshot.
3. Refactoring and wiring to make the dex stubs jar available to other
   parts of Soong.

Bug: 179354495
Test: m nothing
Change-Id: I5895d4f2ba0b684870862b9429b2364865e4afc6
2021-04-16 18:48:20 +01:00
Jeongik Cha 485c26a6a0 Merge "Made ManifestPath OptionalPath instead of Path" am: 06d6373bbe am: 86b0677262 am: 8c16e8a061
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675472

Change-Id: I5c1a2402098d9562e5f92a7c3960319f3d4c1714
2021-04-16 04:47:46 +00:00
Jeongik Cha 8c16e8a061 Merge "Made ManifestPath OptionalPath instead of Path" am: 06d6373bbe am: 86b0677262
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675472

Change-Id: Ib5f8d4203fe3803c8d9050739877abd1ff79263e
2021-04-16 04:19:41 +00:00
Jeongik Cha 06d6373bbe Merge "Made ManifestPath OptionalPath instead of Path" 2021-04-16 03:40:51 +00:00
Paul Duffin 9b381ef2b8 platform_bootclasspath: aggregate hidden API flag files from fragments
Aggregates hidden API flag files from the bootclasspath_fragments which
will allow the hidden API flag files in frameworks/base/boot/hiddenapi
to be modularized and moved to the appropriate repo.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
      also verified that changes to the fragment provided files do
      affect the monolithic files.
Change-Id: Ifce14c9ef24c58c7ab1085475d85b61cfbfefecd
2021-04-16 00:29:53 +01:00
Treehugger Robot 91a6d73a97 Merge "Handle boot jars on /system_ext correctly." am: 107f92efbe am: c04c5d3d47 am: 2154e60320
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672245

Change-Id: If7bfbe8e4fb630ee0d6f2bcf5920f82e749ccf5a
2021-04-15 17:37:58 +00:00
satayev d103e4cb3f Merge "Generate classpaths.proto config for *CLASSPATH variables." am: 76f88384c4 am: 68e73fcb62 am: 95fe7fca0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1650411

Change-Id: I890d6b67dc63d5795f0a5f962b3f39dfef44f46f
2021-04-15 17:37:52 +00:00
Paul Duffin 8d66423462 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." am: d9d1102b35 am: 3e6023da6a am: f1016c4a30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675870

Change-Id: I25a4f414dcb34bd14e0ab706021f7324ced17b63
2021-04-15 17:37:47 +00:00
Paul Duffin 0fce865c86 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" am: bca75b1f77 am: 1b9d52d01e am: 6c58d44428
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675869

Change-Id: Ifca59738c555ca5213a61025d30de19d045a9b2b
2021-04-15 17:37:36 +00:00
Treehugger Robot 2154e60320 Merge "Handle boot jars on /system_ext correctly." am: 107f92efbe am: c04c5d3d47
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672245

Change-Id: Iaa11eb02f71aaa750e6c48f264d1b0efd9fb6c89
2021-04-15 16:48:50 +00:00
satayev 95fe7fca0f Merge "Generate classpaths.proto config for *CLASSPATH variables." am: 76f88384c4 am: 68e73fcb62
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1650411

Change-Id: Icb330819a50e59b978e56fc025e55000420c1401
2021-04-15 16:48:44 +00:00
Paul Duffin f1016c4a30 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." am: d9d1102b35 am: 3e6023da6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675870

Change-Id: I8d01bc2bc9866fcd3684c9b386d8ed24a06a0d90
2021-04-15 16:48:39 +00:00
Paul Duffin 6c58d44428 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" am: bca75b1f77 am: 1b9d52d01e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675869

Change-Id: Iaa55ecf2d6a6638b64dc0d4378c1a522a4ad2a99
2021-04-15 16:48:12 +00:00
Treehugger Robot 107f92efbe Merge "Handle boot jars on /system_ext correctly." 2021-04-15 16:30:03 +00:00
satayev 76f88384c4 Merge "Generate classpaths.proto config for *CLASSPATH variables." 2021-04-15 16:07:13 +00:00
Paul Duffin d9d1102b35 Merge "Rename hidden API types ..Augmentation.. to ..FlagFile.." 2021-04-15 15:29:18 +00:00
Paul Duffin bca75b1f77 Merge "Generalize hiddenAPIAugmentationInfo to make it easier to use" 2021-04-15 15:29:07 +00:00
Ulya Trafimovich e736e13a8d Handle boot jars on /system_ext correctly.
When Soong looks for boot jars among all modules, it applies certain
constraints to each module that looks like a boot jar (e.g. that it
comes from the right apex or platform). Previously these constraints did
not handle boot jars on /system_ext correctly (they were handled like
apex jars, while they should be handled like platform jars).

Bug: 154976937
Test: m nothing (the modified Soong test would fail previously)
Change-Id: I0746a2fd276ab5ef0400340c5b61cf26c2570e5a
2021-04-15 15:07:06 +01:00
Pedro Loureiro f0ff1d5243 Merge "Introduce NewApi lint checks" am: 53d69eb028 am: 4a77ab744d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675510

Change-Id: Iff91bd3211debb0058541fcd01182d10994f695d
2021-04-15 12:27:01 +00:00
Paul Duffin 724f24e68a Merge "Move hidden API metadata file rule to platform_bootclasspath" am: fd105d469c am: c552799891 am: a9a8e07643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674033

Change-Id: I68f24d678cdd437a1672047be672338184e12cd5
2021-04-15 11:23:04 +00:00
Paul Duffin 06f7d3d4c1 Merge "Move handling of prebuilt hiddenapi-index.csv to hiddenapi singleton" am: e2243eac3a am: 0b48ba43c4 am: 86963f54bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674032

Change-Id: I01dfda491e16a257e691c10ba506a84d9f89bcf7
2021-04-15 11:22:58 +00:00
Paul Duffin b99e587b53 Merge "Move hidden API index file rule to platform_bootclasspath" am: a4b0d08b83 am: 7c03047b40 am: 3d82eade0b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674031

Change-Id: Ic8c404fde66d962f167f432322b13892a2260e7a
2021-04-15 11:22:37 +00:00
Pedro Loureiro 53d69eb028 Merge "Introduce NewApi lint checks" 2021-04-15 11:04:47 +00:00
Paul Duffin a9a8e07643 Merge "Move hidden API metadata file rule to platform_bootclasspath" am: fd105d469c am: c552799891
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674033

Change-Id: I8eee029810dffcc3f9c0c2f69419713f84ed2144
2021-04-15 10:54:33 +00:00
Paul Duffin 86963f54bc Merge "Move handling of prebuilt hiddenapi-index.csv to hiddenapi singleton" am: e2243eac3a am: 0b48ba43c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674032

Change-Id: I119f06b49f3653298a5fb4439e3a632cf1ea027c
2021-04-15 10:54:13 +00:00
Paul Duffin 3d82eade0b Merge "Move hidden API index file rule to platform_bootclasspath" am: a4b0d08b83 am: 7c03047b40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674031

Change-Id: I16b705f3690a259ececa010388dd37e973d1d201
2021-04-15 10:54:02 +00:00
Paul Duffin 4616977948 Rename hidden API types ..Augmentation.. to ..FlagFile..
Augmentation was too abstract this makes it clearer.

Bug: 177892522
Test: m nothinge
Change-Id: I60ad005e68d9e15b01bcb46bc6a9b7f84d8bfd43
2021-04-15 10:45:39 +01:00
Paul Duffin e3dc6608cb Generalize hiddenAPIAugmentationInfo to make it easier to use
Previously, each category of flag file had its own property in the
hiddenAPIAugmentationInfo struct that required a lot of repetition
to use. This change moves the flag file specific handling into a
new hiddenAPIFlagFileCategory struct which allows use of the
hiddenAPIAugmentationInfo struct to be parameterized.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: I4413134c0c9382139bef3813f847e453f426692c
2021-04-15 10:45:39 +01:00
Jeongik Cha 33a3a8182f Made ManifestPath OptionalPath instead of Path
because it is actually an optional value.

Bug: 158843648
Test: m nothing
Change-Id: If323eacf6a7aa83dcf5ce4825ad8cabeeaa97ac9
2021-04-15 09:12:49 +09:00
Paul Duffin 85dee5d8fb Move hidden API metadata file rule to platform_bootclasspath
This change moves the monolithic hidden API index file creation rule
from the hiddenAPISingleton into the platform_bootclasspath.

Bug: 179354495
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: Ib25be3618e30a83dc2929a18062eb58eefdabefb
2021-04-14 18:54:55 +01:00
Paul Duffin 22c743170d Move handling of prebuilt hiddenapi-index.csv to hiddenapi singleton
This change moves the handling of the prebuilt hiddenapi-index.csv file
from the hiddenAPIIndexSingleton and removes that as it no longer
needed.

Bug: 179354495
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: Iab1b39a57f28caa855c48538aa2230795f2c3271
2021-04-14 18:54:45 +01:00
Paul Duffin 00b2bfdea5 Move hidden API index file rule to platform_bootclasspath
This change moves the monolithic hidden API index file creation rule
from the hiddenAPIIndexSingleton into the platform_bootclasspath. It
also moves the corresponding test from java/hiddenapi_singleton_test.go
to java/platform_bootclasspath_test.go.

Bug: 179354495
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: Ia295d0f7ae9b51ea816f16921aa42339ed91704e
2021-04-14 18:54:29 +01:00
Paul Duffin 282f7ecb20 Merge "Ensure boot jar modules have been initialized properly for hidden API" am: 08abf7274a am: 45027631f3 am: c7eb9c4037
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674030

Change-Id: I8bbbdd25e87cf5df81590435c8fbf085d5d18845
2021-04-14 17:22:37 +00:00
Paul Duffin c7eb9c4037 Merge "Ensure boot jar modules have been initialized properly for hidden API" am: 08abf7274a am: 45027631f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674030

Change-Id: Ib5d41670b0fdb8dd1af0299a54fc6eadcb8ed0f5
2021-04-14 16:32:10 +00:00
Paul Duffin 08abf7274a Merge "Ensure boot jar modules have been initialized properly for hidden API" 2021-04-14 15:53:15 +00: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
Artur Satayev 97259dc625 Generate classpaths.proto config for *CLASSPATH variables.
Instead of embedding "raw" values from PRODUCT_*_CLASSPATH variables
into /etc/classpath, encode them into classpaths.proto binary format.

Existing platform_bootclasspath{} module is used to generate the whole
monolithic config to begin with. Later, the config will be split
among individual bootclasspath_fragment and
systemserverclasspath_fragment modules.

Bug: 180105615
Test: m && launch_cvd
Change-Id: Ia66f521f8976ff78a62ecf91131d26db21064de7
2021-04-14 15:03:23 +01:00
Jiyong Park f398995a64 Merge "SdkSpec is fully using ApiLevel" 2021-04-14 13:27:05 +00:00
Anton Hansson f57d624f2d Merge "Remove special case code for obsolete files" am: e9d2f9fcda am: ad0ffa9f98 am: 62f49d1ea7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674037

Change-Id: I672937c1a5f8e53a9d0d728955d902106a733bf1
2021-04-14 11:38:53 +00:00
Anton Hansson 62f49d1ea7 Merge "Remove special case code for obsolete files" am: e9d2f9fcda am: ad0ffa9f98
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674037

Change-Id: I83b307277946b613df3f464f7c08e8cc648e6ada
2021-04-14 10:51:47 +00:00
Paul Duffin 1711f4e539 Merge "prebuilt_apex created ApexInfo must not include prebuilt_ prefix" am: 35584eeb93 am: 1cc6122b55 am: 303eed8e87
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674029

Change-Id: I3b96d66b67b26a3035c43b48c6b32e237b452346
2021-04-14 10:13:42 +00:00
Paul Duffin 303eed8e87 Merge "prebuilt_apex created ApexInfo must not include prebuilt_ prefix" am: 35584eeb93 am: 1cc6122b55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674029

Change-Id: I56a4b2aeacef0b4f4a96af90f88c2b25bfee8f9d
2021-04-14 09:23:43 +00:00
Anton Hansson e9d2f9fcda Merge "Remove special case code for obsolete files" 2021-04-14 09:22:51 +00:00
Paul Duffin 1ba246732d Ensure boot jar modules have been initialized properly for hidden API
Checks to make sure that every module that is part of the platform
bootclasspath has been initialized property for hidden API processing.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: Ic4368963f2011784b537b8aebf5ef97ea22b2db5
2021-04-14 09:08:02 +01:00
Paul Duffin ce858caec5 Merge "Improve realism of boot jar tests" am: 21fb92d7f6 am: 590a50fe8f am: 401eaf7dd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674028

Change-Id: I5b5b42c6583290af8510bfe1a45bcd11f61960d6
2021-04-13 21:12:40 +00:00
Paul Duffin 401eaf7dd9 Merge "Improve realism of boot jar tests" am: 21fb92d7f6 am: 590a50fe8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674028

Change-Id: I7fc246996b751bb748b33877f8e758bf5a9a3516
2021-04-13 19:46:44 +00:00
Paul Duffin 9a117ac0cb Merge "Support UNSAFE_DISABLE_HIDDENAPI_FLAGS in platform_bootclasspath" am: 6050c3c31e am: 58a26e96b7 am: a2f33cc96e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674036

Change-Id: I362404f58342fc1b04cd011197c24e4970043e93
2021-04-13 19:12:27 +00:00
Paul Duffin 37b54b73c8 Merge "Remove noop code from generateHiddenAPIBuildActions" am: 149e19ef70 am: ee207a67e8 am: 97838afd6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674035

Change-Id: I1cb631e1095ae429917972a600566521b46c9c54
2021-04-13 19:12:20 +00:00
Paul Duffin a2f33cc96e Merge "Support UNSAFE_DISABLE_HIDDENAPI_FLAGS in platform_bootclasspath" am: 6050c3c31e am: 58a26e96b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674036

Change-Id: Iffa71d25dea6845866854cbb2e72036a64c330e0
2021-04-13 18:25:38 +00:00
Paul Duffin 97838afd6f Merge "Remove noop code from generateHiddenAPIBuildActions" am: 149e19ef70 am: ee207a67e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674035

Change-Id: I27758217e5dfd1660729e39125d4a5d9224bd25b
2021-04-13 18:25:04 +00:00
Paul Duffin 8f146b99e6 prebuilt_apex created ApexInfo must not include prebuilt_ prefix
As part of the work to modularize the hiddenAPI processing the
generation of the monolithic hidden API index file needs to be moved
to the platform_bootclasspath module type. Doing that broke the
TestBootDexJarsFromSourcesAndPrebuilts tests which checks the inputs to
the rule that creates that file. Fixing that required added a
platform_bootclasspath module to the test fixture for those tests which
highlighted an issue with the prebuilt_apex module.

Previously, when the prebuilt_apex created apex variants it would use
its own name as the apex variant name, even when that name included the
prebuilt_ prefix. That broke the platform_bootclasspath logic as it was
looking for apex variants for "myapex" but the only ones available were
"prebuilt_myapex".

This change ensures that it always uses the unprefixed name and fixes
the TestNoUpdatableJarsInBootImage to match. This also adds some
improved error reporting in platform_bootclasspath which helped debug
this problem.

Bug: 177892522
Test: m nothing
Change-Id: I3e88b5cec767f77dcc0e94b3ae38b499d07eadf0
2021-04-13 19:15:27 +01:00
Anton Hansson fa5e6b50aa Remove special case code for obsolete files
incompatibilities.txt doesn't exist anymore, only
"<module>-incompatibilities.txt". Clean up the associated logic that
mapped incompatibilities.txt to android-incompatibilities.txt.

Bug: 178171189
Test: m
Change-Id: I61eeb5dcc82770fa2af356bad11b7205551d6d83
2021-04-13 19:09:48 +01:00
Pedro Loureiro f4a88b1633 Introduce NewApi lint checks
We are enabling NewApi lint check where the min sdk != compile sdk.
At the same time, we are introducing baseline files for existing
projects that fail this check in order to keep the build running.

At the very least we stop introducing new problems and teams might
realise of risks in their projects they were not aware of.

Bug: 150847901

Test: m lint-check
Change-Id: Icfa5eb98cc6b6708149f0c52fac8fc1440d9c3b0
Merged-In: Icfa5eb98cc6b6708149f0c52fac8fc1440d9c3b0
2021-04-13 15:19:02 +00:00
Pedro Loureiro d1618e3ff4 Merge "Introduce NewApi lint checks" into sc-dev 2021-04-13 14:12:41 +00:00
Paul Duffin 60264a0b99 Improve realism of boot jar tests
Boot jars, updatable boot jars and art apex jars are part of two
separate but related configuration objects, the main Config struct
(actually the nested productVariables struct) and the dexpreopt
specific GlobalConfig. The fields in both are initialized from the same
data in the make config files but handled separately.

Previously each test that used one of the configuration objects would
generally just initialize the one it used. That would make the test
sensitive to the specific configuration object that was used. A
refactoring that change the code from using one configuration object to
the other would cause the test to fail.

Also, some tests would inadvertently create invalid configurations by
setting ArtApexJars without also setting BootJars. While the ability to
create invalid configurations is useful (and there are some tests that
exist to verify the behavior in that case) most tests should not be
using them.

This change simplifies the configuration of the tests and improves
their realism by:
1. Providing a new FixtureConfigureBootJars method that takes a set of
   boot jars and sets ArtApexJars, and BootJars in the
   dexpreopt.GlobalConfig and BootJars in the product variables too.
2. Providing a new FixtureConfigureUpdatableBootJars method that takes
   a set of boot jars and sets UpdatableBootJars in both the
   dexpreopt.GlobalConfig and productVariables.
3. Migrating existing tests to use these new methods.

Some tests still use the dexpreopt.FixtureSet...Jars() methods directly,
generally to create invalid configurations.

Bug: 177892522
Test: m nothing
Change-Id: I4d8f0b9762cfcc7ae6383bef08563d7c3fa13955
2021-04-13 14:48:34 +01:00
Paul Duffin 0b659866e8 Support UNSAFE_DISABLE_HIDDENAPI_FLAGS in platform_bootclasspath
Previously attempting to use m UNSAFE_DISABLE_HIDDENAPI_FLAGS would
cause a build failure.

It is necessary when UNSAFE_DISABLE_HIDDENAPI_FLAGS=true to create
empty files for the monolithic files so that those usages which are not
protected by the build flag, e.g. in dists or CTS tests like
CtsHiddenApiBlocklistTestApiTestCases do not cause ninja failures due
to reliance on a file that does not exist and has no rule to create it.

Bug: 177892522
Test: m nothing
      m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true CtsHiddenApiBlocklistTestApiTestCases
Change-Id: I05d0b3680dbc0b5b7c7c0d792550faf848829647
2021-04-13 14:19:51 +01:00
Paul Duffin 90b8ad38e0 Remove noop code from generateHiddenAPIBuildActions
Change https://r.android.com/1673266 introduced some code that does
nothing. This change removes that.

Bug: 177892522
Test: m nothing
Change-Id: I349b17c7fe7e2f68a807dab43a4300da7fe0ad4d
2021-04-13 14:18:34 +01:00
Paul Duffin 3e56a08adb Merge "Remove unused hiddenapi_flags module type" am: 99e4fc13bf am: 93391542f9 am: 51ae64962d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674027

Change-Id: I936eba4dbc4f19a3542511a9845d1263db05ce99
2021-04-13 13:09:20 +00:00
Paul Duffin 3d37a3b111 Merge "Export monolithic hidden API files from platform_bootclasspath" am: db173510d3 am: 64e6f0ff5d am: 703509119f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1673266

Change-Id: Ia7d8fa1dd41a2ce4da9630d65ec867e24eb586df
2021-04-13 13:08:09 +00:00
satayev 84ea699fcc Merge "Introduce classpath_fragment.go." am: 86628403e9 am: 94a783223d am: f92ad57372
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670069

Change-Id: I101ad1b1446fde0583833c8a36a07a962b7e0aa1
2021-04-13 13:07:53 +00:00
Paul Duffin 51ae64962d Merge "Remove unused hiddenapi_flags module type" am: 99e4fc13bf am: 93391542f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674027

Change-Id: I5c46593a38ede8963eeb6287f4ff1588ef3bccb9
2021-04-13 12:15:29 +00:00
Paul Duffin 703509119f Merge "Export monolithic hidden API files from platform_bootclasspath" am: db173510d3 am: 64e6f0ff5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1673266

Change-Id: I35021b0746a5aa9ac071ca488ae530f950634159
2021-04-13 12:15:17 +00:00
satayev f92ad57372 Merge "Introduce classpath_fragment.go." am: 86628403e9 am: 94a783223d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670069

Change-Id: Id9da955035530a1b64b987f83cebf8c729df65df
2021-04-13 12:15:02 +00:00
Jiyong Park 3db6f99780 Merge "SdkSpec is fully using ApiLevel" into sc-dev 2021-04-13 11:02:38 +00:00