summaryrefslogtreecommitdiff
path: root/sdk/bootclasspath_fragment_sdk_test.go
AgeCommit message (Collapse)Author
2021-07-23Build updatable-bcp-packages.txt from prebuilts in sdk snapshotPaul Duffin
Previously, the java_import and java_sdk_library_import modules did not make their permitted_packages available to the rule that generates the updatable-bcp-packages.txt file. This change corrects that. Bug: 193095050 Test: m nothing - Added unit tests, which all failed and then fixed the tests. Merged-In: If0706e4551a331b48d383123088e63924dded48b Change-Id: If0706e4551a331b48d383123088e63924dded48b (cherry picked from commit 630b11e9d4d63e5fabaa20adf5d1b1c81ede6681)
2021-07-15Propagate permitted packages to sdk snapshotPaul Duffin
Previously, permitted_packages were not copied to the sdk snapshot. This change corrects that. Bug: 193763688 Test: m nothing - Added unit tests, which all failed and then fixed the tests. Merged-In: I4560987f746f78c0ae706058195b6db4bea438aa Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa (cherry picked from commit 869de147abdb2c86a91cced4fda7d27746c52af4)
2021-07-01Retry: Make bootclasspath_fragments always perform hidden API processingPaul Duffin
Previously, bootclasspath_fragment modules would only perform hidden API processing if they provided some stub libraries and fragments. That was needed because the bootclasspath_fragment modules were added before Soong supported hidden API processing on all the different modules and before they all provided the necessary information that hidden API processing required. This change stops hidden API being conditional as it is no longer required as it has been enabled on all existing bootclasspath_fragment modules. Bug: 179354495 Test: m nothing Change-Id: Ibf81a7de63b888a3ebf445528326fa6101fdb1ba
2021-07-01Revert "Make bootclasspath_fragments always perform hidden API processing"Paul Duffin
This reverts commit 2b255d7f6b1e50bc92a12e0b8e757c0eda64b173. Reason for revert: build breakage http://b/192554546 Bug: 179354495 Change-Id: Id758af3f59bc83b02d8af4b1b83b3f279a208595
2021-07-01Make bootclasspath_fragments always perform hidden API processingPaul Duffin
Previously, bootclasspath_fragment modules would only perform hidden API processing if they provided some stub libraries and fragments. That was needed because the bootclasspath_fragment modules were added before Soong supported hidden API processing on all the different modules and before they all provided the necessary information that hidden API processing required. This change stops hidden API being conditional as it is no longer required as it has been enabled on all existing bootclasspath_fragment modules. Bug: 179354495 Test: m nothing Change-Id: I0cbf11986adff1f2f967b96f86e6bfe0e9b8b1ef
2021-06-24Ensure consistent APEX variation for java_sdk_library and ↵Paul Duffin
java_sdk_library_import Previously, a java_sdk_library with shared_library = true would create a variation per APEX because it depends on an sdkLibraryXml module which generates a file containing the APEX name. However, a shared java_sdk_library_import would create a merged APEX variation. The inconsistent variations caused failures in sdkDepsReplaceMutator. This change ensures that both java_sdk_library and java_sdk_library_import create an APEX specific variation when their shared_library property is true. Bug: 190499958 Test: m nothing - ran the above command after modifying the test to reproduce the problem and then after fixing to verify that it fixed the problem. Change-Id: Iee81776a8569db3e871c40cbde14d248dfeb56e4
2021-06-22Fix monolithic hidden API processing with prebuiltsPaul Duffin
Prebuilt modules do not provide classesJars containing annotations. Previously, the monolithic hidden API processing just used classesJars from all the modules that provided them so when building against prebuilts would have fewer classesJars than when building against sources and so would produce different hidden API flags. This change will generate the monolithic files from both classesJars and files previously generated from hidden API processing. A fragment that has performed hidden API processing will contribute its generated files whereas standalone libraries and fragments which have not performed hidden API processing will contribute classesJars. Bug: 177892522 Test: m out/soong/hiddenapi/hiddenapi-flags.csv m SOONG_CONFIG_art_module_source_build=false out/soong/hiddenapi/hiddenapi-flags.csv - verify that the files are identical whether built from source or prebuilts. Merged-In: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c (cherry picked from commit d061d40eb6ffbc9d7cece2945b7276fe2f6759d1)
2021-06-18Move boot jars package check into platform_bootclasspathPaul Duffin
Bug: 177892522 Bug: 189298093 Test: m check-boot-jars m SOONG_CONFIG_art_module_source_build=false check-boot-jars - Ran both commands with and without java.lang in the package_allowed_list.txt Merged-In: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2 Change-Id: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2 (cherry picked from commit c8ead41ba9426a31c8ca3d7228991a45ccff6299)
2021-06-16Make bootclasspath_fragment_sdk_test.go tests more realisticPaul Duffin
In the input test fixture this makes sure that every bootclasspath_fragment is part of an apex and every content module for the fragment is listed in the appropriate boot jars config property. It also adds a platform_bootclasspath fragment that references the fragment. In the snapshot test fixtures this adds a prebuilt_apex that exports the fragment so that the platform_bootclasspath has access to the dex implementation files. Bug: 177892522 Test: m nothing Merged-In: I6c73651a359052858232b06229b4433799dd94db Change-Id: I6c73651a359052858232b06229b4433799dd94db (cherry picked from commit 7c47515c7f573bdfeafb9b04f240383d1dea1731)
2021-05-25Tighten bootclasspath_fragment property validationPaul Duffin
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 8018e50ddb141dea7891918c4178a7a394a788d8)
2021-05-14Generate hidden API flags for a bootclasspath_fragmentPaul Duffin
This change adds support for generating the hidden API flags for the contents of a bootclasspath_fragment. Currently, it will only work for the art-bootclasspath-fragment as it has no support for creating dependencies between bootclasspath_fragment modules which will be needed for handling any other bootclasspath_fragment. The hidden API flag generation added by this change is completely separate to the normal hidden API processing and is not as yet encoded in dex jars so will have no effect on the runtime. The generated files are provided for use by other modules and copied into the sdk snapshot. That is needed to allow the build to verify that the hidden API flags generated by the individual bootclasspath_fragment modules are consistent with the flags generated for the whole bootclasspath, whether building from source or prebuilts. Bug: 179354495 Test: m art-module-sdk m out/soong/.intermediates/art/build/boot/art-bootclasspath-fragment/android_common_apex10000/modular-hiddenapi/all-flags.csv m out/soong/hiddenapi/hiddenapi-flags.csv - test that the former file is a subset of the latter and that where they overlap they are identical. Change-Id: Ie27303e2960953db1b7abe95510e3bca4411b09a
2021-05-14Disallow shared libraries in bootclasspath_fragment contentsPaul Duffin
Bug: 177892522 Test: m nothing Change-Id: I78c8ef8664ec1eb0fe3456a2de2cb956162ca0da
2021-05-13Add java_sdk_library in bootclasspath_fragment contents to sdkPaul Duffin
A java_library specified in a bootclasspath_fragment's contents property will be automatically added to the sdk containing that bootclasspath_fragment. Previously, if that was attempted with a java_sdk_library it would be added to the sdk as if it was a normal java_boot_libs which would prevent the sdk from containing the API specific artifact such as current.txt files and stub libraries and sources. This change fixes that and adds a java_sdk_library as a java_sdk_libs module. Bug: 177892522 Test: m nothing Change-Id: Ided57b846ce5b8940c7e898c786fd77602582ea2
2021-05-13Make hidden API bootclasspath_fragment test more realisticPaul Duffin
Adds the bootclasspath_fragment to an apex and also adds an sdk library to the stub_libs property. Bug: 179354495 Test: m nothing Change-Id: I2a5fffe915eb62923cc60732352d4d050dec4398
2021-05-10Derive deapexer module properties from transitive dependenciesPaul Duffin
Previously, the deapexer module properties were simply passed through from the prebuilt_apex/apex_set modules. This change derives the properties from the transitive dependencies of the modules so that it can automatically include the contents of a bootclasspath_fragment module without having to duplicate them in the exported_java_libs property. Part of this change involves moving the addition of dependencies onto the prebuilt apex's contents from DepsMutator to ComponentDepsMutator so that they can be visited in the createDeapexerModule() function. The ComponentDepsMutator runs before prebuilts without matching sources are renamed to match the source name which simplifies the process of adding dependencies directly onto the prebuilts. The deapexerDeps method was renamed as the dependencies are added both for use by deapexer and also to create APEX variants for access by platform_bootclasspath so the name was confusing. Bug: 187266082 Test: m nothing m SOONG_CONFIG_art_module_source_build=false nothing - this fails but not because of missing APEX variants Change-Id: Icb4f883e7d2b63739e5ff0dc6edb8a906d80189b
2021-04-30Move configuration checks from getBootImageJarPaul Duffin
The getBootImageJar function will be removed once the boot image creation has been moved to the platform_bootclasspath and bootclasspath_fragment module types. However, the consistency checks that it performs are still useful so this change moves them out first. The ART boot image related checks are now performed in the bootclasspath_fragment module type. A previous change accidentally disabled the checks when the contents property was not empty which has been fixed. Also, the error messages have been tweaked to make it clear that the art-bootclasspath-fragment is now the source of truth as to its contents not the configuration. The framework boot image related checks are now performed in the platform_bootclasspath module type. Initially, this change included an extra check to make sure that UpdatableBootJars comes from updatable APEXes but that broke because framework-wifi and framework-tethering are not currently marked as updatable in AOSP. Bug: 177892522 Test: m nothing Change-Id: I80fb600fa2c7cec4566b3461c6a33c4c6f0743f4
2021-04-28Add stub_libs properties to bootclasspath_fragment snapshotPaul Duffin
Bug: 177892522 Test: m nothing Change-Id: I7644122c4abed8e8bc2cc7b58f408bee3bdc91f6
2021-04-28Remove special handling of frameworks/base/config/boot-profile.txtPaul Duffin
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-26bootclasspath_fragment: Always output contents property in snapshotPaul Duffin
Bug: 177892522 Test: m art-module-sdk - check generated snapshot contains contents property Change-Id: I122dedba6600a199bfd83b01988da36ddfd09d63
2021-04-26Automatically add bootclasspath_fragment contents to sdkPaul Duffin
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-23Add exported_bootclasspath_fragments to prebuilt_apex/apex_setPaul Duffin
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-21bootclasspath_fragment: Add hidden API flag files to snapshotPaul Duffin
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-21bootclasspath_fragment: Add contents to snapshotPaul Duffin
Bug: 177892522 Test: m nothing Change-Id: I54fe0537b758a0e3dacd34b139ef3eb21b8841fd
2021-04-21Replace boot image with bootclasspath fragment in sdk packagePaul Duffin
Bug: 177892522 Test: m nothing Change-Id: I67589bccbde426de2caf513bd643d9484df86c1e