summaryrefslogtreecommitdiff
path: root/java/hiddenapi_monolithic.go
AgeCommit message (Collapse)Author
2024-02-13Restrict verify_overlaps to pre S modules Spandan Das
The runtime in S and above does not have the same constraints that require the hiddenapi flags to be generated in a monolithic manner. This CL restricts the verify_overlaps to pre S modules. This will filter out hiddenapi signature discrepancies that do not require any action. Test: verify_overlaps diff with this change https://diff.googleplex.com/#key=xxB0ky93hZRn Test: presubmits Bug: 313672880 Change-Id: Ie626a6779fc924563bec90b6c1ab0c7e8b4b23c2
2023-12-14Convert OtherModuleProvider to generic providers API Colin Cross
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider to use the type-safe android.OtherModuleProvider API. Bug: 316410648 Test: builds Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
2023-12-14Convert NewProvider/NewMutatorProvider to generic providers API Colin Cross
Convert all of the callers to NewProvider and NewMutatorProvider to use a generic type parameter instead of an example object. Bug: 316410648 Test: builds Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2021-08-06Separate creation of signature patterns from overlap checking Paul Duffin
Previously, the signatures used to select the subset of the monolithic flags were simply the signatures read from the modular flags file. This change moves the creation of the signature list into a separate script that outputs the signatures to a file and then passes the path through Soong from the bootclasspath_fragment modules that create it to the platform_bootclasspath module that uses it to compare the modular flags against the monolithic flags. Currently, the signatures are the full signatures but follow up changes will replace them with patterns (hence the name) that avoids having to include implementation details in the hidden API flags that are output as part of a bootclasspath_fragment's snapshot. This change moves the stub flags related code next to the all flags related code as they are treated in a similar way. Bug: 194063708 Test: atest --host verify_overlaps_test signature_patterns_test m out/soong/hiddenapi/hiddenapi-flags.csv - manually change files to cause difference in flags to check that it detects the differences. Change-Id: I2855bf6d05c91b8a09591664185750361c7e644f
2021-07-20Remove unnecessary dedup logic Paul Duffin
The CreateClasspathElements function makes sure that each standalone library and bootclasspath_fragment on the platform bootclasspath appear once and once only and each file extracted is unique to the module so there is no chance that any duplicate files will be used. Bug: 194063708 Test: m out/soong/hiddenapi/hiddenapi-flags.csv - check that this does not change the contents. Change-Id: I60c02baa4d179293ee0f305375afaa3a8c98e112
2021-07-20Remove unnecessary handling of nil paths in HiddenAPIOutput Paul Duffin
Previously, bootclasspath_fragment modules could produce HiddenAPIOutput structs containing nil paths. That is no longer possible as both source and prebuilt bootclasspath_fragment modules always provide non-nil paths so this change removes the special handling. Bug: 194063708 Test: m out/soong/hiddenapi/hiddenapi-flags.csv - check that this does not change the contents. Change-Id: I15337e146c9e694ce9da06ad4845ac267d6da27a
2021-07-20Remove fallback to classes jars from bootclasspath_fragment Paul Duffin
Previously, the hidden API processing performed by the platform_bootclasspath would try and get flag files from the fragments it references but would fall back to the classes jars. This change removes that logic as it is no longer needed as all fragments, both source and prebuilts, provide flag files and the prebuilts no longer provide valid classes jars. Bug: 194063708 Test: m out/soong/hiddenapi/hiddenapi-flags.csv - check that this does not change the contents. Change-Id: Ib867a08508f5a0f8858f6baedebbe99b6a825f80
2021-06-20Fix monolithic hidden API processing with prebuilts Paul 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. Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
2021-06-20Use classpath elements in platform_bootclasspath Paul Duffin
Use classpath elements in newMonolithicHiddenAPIInfo. That means the method can collate information from both fragments and libraries rather than just fragments. So, this change moves the collation of the classesJars into the method. Bug: 177892522 Test: m out/soong/hiddenapi/hiddenapi-flags.csv out/soong/hiddenapi/hiddenapi-index.csv - make sure that this change does not affect the contents. Change-Id: I7c2a229fab60d02bd211438735a8d7303ed83386
2021-06-10Export hidden api related types and fields Paul Duffin
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
2021-05-24Fix hidden API flags in com.android.i18n Paul Duffin
Change 70cfdff3da2ea07cd5cb7f7b91474f6fa0c248e5 changed the hidden API flags in com.android.i18n as it stopped the i18n-bootclasspath-fragment from making the hidden API flag files available for use by platform-bootclasspath. This change fixes that by exporting the flag files even if hidden API flag generation is skipped. Bug: 179354495 Test: m com.android.i18 out/soong/hiddenapi/hiddenapi-flags.csv - make sure that the flags in packages/modules/RuntimeI18n/apex/hiddenapi/hiddenapi-max-target-o-low-priority.txt are reflected in the core-icu4j dex files in the apex. Change-Id: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
2021-05-24Rename hiddenAPIFlagFileInfo to HiddenAPIInfo Paul Duffin
This reflects that it has expanded from its initial purpose to include more than just flag files. It is exported for use in tests in other packages. Bug: 179354495 Test: m nothing Change-Id: I9f780b20e18ce3a774e4aa04a276463070a64c34
2021-05-24Separate output of flag generation from hiddenAPIFlagFileInfo Paul Duffin
HiddenAPIFlagOutput encapsulates the paths to the files produced by the hidden API flag generation of a single bootclasspath_fragment. It is returned from hidden API flag generation and is embedded within the hiddenAPIFlagFileInfo so they can be passed to other modules. Unlike the fields it replaces in hiddenAPIFlagFileInfo the fields in HiddenAPIFlagOutput are of type Path not Paths which makes it easier to use. Bug: 179354495 Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt - verify that this does not change the contents of the apex files Change-Id: I7373ba1001cac3a75eb54a23e62fa52f5013ee7f
2021-05-24Separate monolithic hidden API processing from hiddenAPIFlagFileInfo Paul Duffin
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