aboutsummaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix monolithic hidden API processing with prebuiltsPaul Duffin2021-06-201-6/+37
| | | | | | | | | | | | | | | | | | | | | 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. Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
* Make CheckHiddenAPIRuleInputs more reusablePaul Duffin2021-06-201-6/+5
| | | | | | | | | Adds a message parameter and allows leading spaces in the expected file string to allow them to be nicely indented. Bug: 177892522 Test: m nothing Change-Id: I33df26610738c48879fa0b8250dc377dd04bb07d
* Move TestPlatformBootclasspath_Fragments to apex packagePaul Duffin2021-06-101-112/+0
| | | | | | | | | | | | | | | This test checks that fragments which are referenced from a platform_bootclasspath module contribute their hidden API flags to those used by platform_bootclasspath module. Previously, it was unrealistic because the bootclasspath_fragment does not belong in an APEX. This change moves the test from the java package to the apex package to allow it to be modified to make the bootclasspath_fragment part of an apex. Bug: 179354495 Test: m nothing Change-Id: Icb57f2e1eaea4b14aab5f47f3af7d05ea0555816
* Export hidden api related types and fieldsPaul Duffin2021-06-101-3/+3
| | | | | | | | | | | This will export some hidden api related types and fields so they can be used from outside the java package. This is needed to allow a follow up change to move the TestPlatformBootclasspath_Fragments from the java to the apex package. Bug: 179354495 Test: m nothing Change-Id: Ib69eea9d79cc83b8e3fc29919a29f071e1ec17b5
* Merge "Rename generate proto config file to match classpath type."satayev2021-05-251-2/+2
|\
| * Rename generate proto config file to match classpath type.satayev2021-05-241-2/+2
| | | | | | | | | | | | | | | | There is no need to leak soong module names. Bug: 180105615 Test: m && launch_cvd; atest CtsClasspathsTestCases Change-Id: I04f4e181d2f42b9d71641980a2c7c4e8cbc8e426
* | Separate monolithic hidden API processing from hiddenAPIFlagFileInfoPaul Duffin2021-05-241-2/+2
|/ | | | | | | | | | | | | | | | The hiddenAPIFlagFileInfo was being used for both the input and output of bootclasspath_fragment and platform_bootclasspath and also to pass information around to various hidden API rule methods. Supporting multiple different uses in this way made it hard to reason about. This change creates a separate structure for use by the platform_bootclasspath. Follow up changes will split out other functionality into separate types. Bug: 179354495 Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt - verify that this does not change the contents of the apex files Change-Id: Ia5c5f65ae5645486c42819c669a8601588217f88
* Generate monolithic hidden API files direct from class jarsPaul Duffin2021-05-141-11/+5
| | | | | | | | | | | | | | | | | | | | | Previously, the monolithic hidden API files, e.g. hiddenapi-index.csv file, were generated in two steps. First, each module created its own files using the information in its class jars. Then, the monolithic files were created by merging those module specific files into a larger file. This change switches to generating the monolithic files directly from the class jar files and bypassing the intermediate files. In order to ensure that this change did not change the monolithic files it is necessary for the hiddenapi-metadata.csv to go through a reformatting step. Hopefully, this will be able to be removed in a follow up change. Bug: 179354495 Test: verified that the monolithic out/soong/hiddenapi/... files are unchanged by this change Change-Id: I5a78e747516014b7c0f402a4b4431b14be6a84b2
* Generate hidden API flags for a bootclasspath_fragmentPaul Duffin2021-05-141-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Support dex_import on platform_bootclasspathPaul Duffin2021-05-041-0/+17
| | | | | | | | | Maintain compatibility with previous behavior by ignoring dex_import during hidden API processing. Bug: 179354495 Test: m nothing Change-Id: I976b02129bf981b7b61dce233567d6f89e04f92d
* Treat "apex" system_ext the same as platformPaul Duffin2021-04-291-1/+2
| | | | | | | | | | | | | | | 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
* platform_bootclasspath: aggregate hidden API flag files from fragmentsPaul Duffin2021-04-161-0/+92
| | | | | | | | | | | | | 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
* Merge "Generate classpaths.proto config for *CLASSPATH variables."satayev2021-04-151-0/+83
|\
| * Generate classpaths.proto config for *CLASSPATH variables.Artur Satayev2021-04-141-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Move hidden API metadata file rule to platform_bootclasspathPaul Duffin2021-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* | Move hidden API index file rule to platform_bootclasspathPaul Duffin2021-04-141-0/+59
|/ | | | | | | | | | | | 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
* Improve realism of boot jar testsPaul Duffin2021-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Export monolithic hidden API files from platform_bootclasspathPaul Duffin2021-04-131-0/+41
| | | | | | | | | | | | | | | | | | | | | Makes the monolithic hidden API files accessible from the platform_bootclasspath so they can be output to the dist build target and used by other modules, e.g. by doing something like this: java_resources: [ ":platform-bootclasspath{hiddenapi-flags.csv}", ], It makes the paths relative to the out/soong/hiddenapi directory rather than the out/soong directory to make them easier to use in the java_resources property without changing the structure of the APK. Without that attempting to use them in a java_resources property will result in them being copied to a hiddenapi/ within the APK instead of being used at the top level as existing APKs like CtsHiddenApiBlocklistTestApiTestCases expect. Bug: 177892522 Test: m nothing Change-Id: I829412fc7d25411e0c2e0713d0d219a18f4af2ee
* Add dependencies from platform_bootclasspath to contentsPaul Duffin2021-04-081-3/+98
| | | | | | | | | | | | | | | Adds a FinalDeps mutator to add dependencies from the platform_bootclasspath to the configured boot jars which can be from either the platform or any apex. It adds dependencies for every configured boot jar, whether in ArtApexJars, BootJars or UpdatableBootJars. At the moment the dependencies are only used for testing purposes but following changes will make more use of them. Bug: 177892522 Test: m nothing Change-Id: I981305bf45bc20539a3d36987252f490e2b885cc
* Add a new platform_bootclasspath module typePaul Duffin2021-03-311-0/+38
Initially, this is just a placeholder but functionality will be added in follow up changes. Bug: 177892522 Test: m nothing Change-Id: I890b0d5a117c51a19c9ac5df98c766761d3aa16c