aboutsummaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton.go
Commit message (Collapse)AuthorAgeFilesLines
* Convert OtherModuleProvider to generic providers APIColin Cross2023-12-141-1/+1
| | | | | | | | | Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider to use the type-safe android.OtherModuleProvider API. Bug: 316410648 Test: builds Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
* Disable Hidden API Checks for ENG BuildsPratyush2023-07-301-2/+2
| | | | | | | | | For more discussions/details, please check internal CL ag/24145146 Bug: 289409213 BUg: 285976182 Test: Look for hiddenapi calls in build trace Change-Id: Ia2780ee419b8da1418ba1c7a7d732712b7c2a322
* Extract duplicate code to common helper functions.Jiakai Zhang2023-07-111-1/+1
| | | | | | | | | Also, fall back to using a default name for the dexpreopt directory if we are not building for Android. Bug: 290583827 Test: m nothing Change-Id: I3fc6ff9142a2dcdf995796f75891b242fe2848d0
* Parallelize singleton executionLaMont Jones2023-05-191-1/+1
| | | | | | Bug: 281536768 Test: manual, presubmits Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
* Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx.Martin Stjernholm2021-05-261-1/+1
| | | | | | | | | | Neither InApexVariants nor InApexModules should have them. This allows us to get rid of InApexVariantByBaseName as well. Test: m nothing Test: m nothing SOONG_CONFIG_art_module_source_build=false Bug: 180325915 Change-Id: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
* Rename InApexes -> InApexVariantsJiyong Park2021-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | .. in preparation for the upcoming change. This change doesn't alter any behavior. InApexes is a misleading name. People expects that it has the list of soong module names of the APEXes that a module is part of. So, for example, `core-oj` is a part of both `com.android.art` and `com.google.android.art`. However, in reality, that's not true. The field has `com.android.art` only. This is because the two APEXes (android and Google) have the same apex name which is `com.android.art`. That apex name is used in various places like the `apex_available` and allows us to keep using the same name regardless of whether the APEX is overridden or not. However, this is causing problems in some cases where the exact list of soong module names is required. The upcoming change will add a new field to handle the case and the new field actually will get the name 'InApexes'. So, the existing field is renamed to a less misleading name `InApexVariants`. Bug: 180325915 Test: m nothing Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
* Refactor special handling of hidden API encoding for master-artPaul Duffin2021-05-141-34/+2
| | | | | | | | | | | | | Instead of encoding the hidden API with an empty set of flags when the monolithic flags are not available this simply disables encoding altogether which should have the same behavior at runtime. This change also removes the unused flags field in hiddenAPISingleton which was set but never read. Bug: 179354495 Test: m nothing Change-Id: I32d5825e5271829993dd4e5be4d4ee1b22fa7b22
* Move copying of dex files from dexpreopt_bootjars singletonPaul Duffin2021-05-121-3/+1
| | | | | | | | | | The art dex files are copied in the bootclasspath_fragment and the non-updatable and updatable dex files are copied in the platform_bootclasspath. Bug: 177892522 Test: m nothing Change-Id: I5d3d533d1a7a9f8e7ae20c12eb33029a898a2cd6
* Split findAndCopyBootJars into separate find and copy functionsPaul Duffin2021-04-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | The main difference between the dexpreopt_bootjars singleton and the platform_bootclasspath singleton module is the way they find the modules to use. The former searches all modules, the latter adds dependencies on the modules that they need. This change separates the finding of the modules from the copying of the boot jars for those modules to make it easier to move the remaining functionality to platform_bootclasspath. This temporarily creates a singleton specific copy of the hidden API function isModuleInConfiguredList() to select the modules in place of the logic in the getBootJar() method. There is a slight loss of context information from the error messages but as these methods will be removed once the boot image creation has moved this is not an issue. While switching the isModuleInConfiguredListForSingleton() to use the SingletonContext the error message was fixed to include the name of the module with the issue. Bug: 177892522 Test: m nothing Change-Id: Iaea906da95d9da5301fb964fc593890f2216d336
* Move generation of hidden API make vars to platform_bootclasspathPaul Duffin2021-04-291-9/+0
| | | | | | | | | Bug: 179354495 Test: rm out/soong/make_vars* m nothing grep INTERNAL_PLATFORM_HIDDENAPI_FLAGS out/soong/make_vars* - make sure it is still out/soong/hiddenapi/hiddenapi-flags.csv Change-Id: I86e56512a9a2091f446bad25294d41ea1f4341ee
* Treat "apex" system_ext the same as platformPaul Duffin2021-04-291-1/+1
| | | | | | | | | | | | | | | 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
* Move monolithic stub flags generation to platform_bootclasspathPaul Duffin2021-04-221-133/+0
| | | | | | | | | | | | | | | | 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
* Extract common stub flags codePaul Duffin2021-04-221-32/+60
| | | | | | | | | | | | | | | | | | | | | 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
* Add tempPathForRestat to improve consistencyPaul Duffin2021-04-211-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Move hidden API metadata file rule to platform_bootclasspathPaul Duffin2021-04-141-35/+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 handling of prebuilt hiddenapi-index.csv to hiddenapi singletonPaul Duffin2021-04-141-30/+12
| | | | | | | | | | | 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
* Move hidden API index file rule to platform_bootclasspathPaul Duffin2021-04-141-28/+0
| | | | | | | | | | | | 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
* Remove unused hiddenapi_flags module typePaul Duffin2021-04-131-48/+0
| | | | | | Bug: 177892522 Test: m nothing Change-Id: I604a86a25bbc722ec718b0b0272d0481218d3cd9
* Export monolithic hidden API files from platform_bootclasspathPaul Duffin2021-04-131-4/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Move generation of global hidden API flags to platform_bootclasspathPaul Duffin2021-04-121-99/+2
| | | | | | | | | | | | | | | | | | | This change moves the generation of the global hidden API flags from the singleton to the platform_bootclasspath module. It involves: 1. Moving the ruleToGenerateHiddenApiFlags to hiddenapi_modular.go. 2. Adding HiddenAPIAugmentationProperties to be used by the platform_bootclasspath type. 3. Moving the file paths into the platform-bootclasspath module definition in frameworks/base/boot/Android.bp. The flagsRule is kept as a placeholder for now. The emptyFlagsRule is also kept so that builds continue to work even when the frameworks/base repository is not present. Bug: 177892522 Test: verified that the out/soong/hiddenapi/... files are unchanged by this change Change-Id: Idf4dd414a016831bfe04a01f93234c1c33819881
* Extract ruleToGenerateHiddenApiFlagsPaul Duffin2021-04-121-23/+66
| | | | | | | | | | | | | | | | | Extracts the code for creating the rule that creates the monolithic hidden API flags file which is encoded into dex implementation jars. This refactoring is in preparation for moving the functionality from the hiddenapi_singleton into the platform_bootclasspath. A follow up change will move the method into the new hiddenapi_modular.go alongside the hiddenAPIAugmentationInfo as they will both be used to perform hidden API processing for a bootclasspath_fragment. Bug: 177892522 Test: verified that the out/soong/hiddenapi/... files are unchanged by this change Change-Id: I2729afa80cdfd2d1d4717365001648453d65632f
* Merge "Update build to new location of hiddenapi config files"Paul Duffin2021-04-071-7/+7
|\
| * Update build to new location of hiddenapi config filesPaul Duffin2021-04-061-7/+7
| | | | | | | | | | | | Bug: 179354495 Test: m nothing Change-Id: I563237d46f35ae1d2b99ffaa93f77dfcef5a2b6e
* | Remove hidden API special handling of android.test.basePaul Duffin2021-04-071-11/+0
|/ | | | | | | | The android.test.base module should never be on the bootclasspath. Bug: 184331423 Test: m droid Change-Id: Ibb963b4ce2d915d0205fb1b5a7ca9159a5c99b3f
* Convert hiddenapi tests to use test fixturesPaul Duffin2021-03-161-0/+2
| | | | | | | | | | These tests rely on files provided by javaMockFS() so have been converted to test fixtures to allow them to remove that dependency which will allow javaMockFS() to be removed. Bug: 182638834 Test: m nothing Change-Id: Ifd4069a74fcf67e555f998ddbc4de3fde26b2aae
* Sort hiddenapi monolithic files by signaturePaul Duffin2021-02-161-0/+2
| | | | | | | | | | | | | | | | | | Adds a new --key_field option to merge_csv.py which specifies the name of the field that should be used to sort the input. If specified it causes that field to be the first in each row and performs the merge operation of a merge sort on the input files. That assumes that each input file is already sorted into the same order. Modifies the rules that use merge_csv.py to pass in: --key_field signature to sort the rows by signature. Bug: 180387396 Test: Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change other than changing the order. Change-Id: Idcd5f0fea373b520b604889e1c280f21ed495660
* Remove duplicates in monolithic hidden API filesPaul Duffin2021-02-161-13/+4
| | | | | | | | | | | | | | | | | Previously, multiple APEX variants of some boot jars were being processed by hiddenapi to extract information which resulted in duplicate entries in the monolithic hidden API files. This change applies the same filter that was previously used to ensure that the hiddenapi-flags.csv file did not include any duplicates to all sources of hidden API information. Bug: 180102243 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change other than removing some duplicates entries. Change-Id: I9ffc8586d5d6efea4e3440be2dfd5424790665c8
* Convert java.Dependency to JavaInfo providerColin Cross2021-02-091-1/+1
| | | | | | | | | Export information about java dependencies through a Provider instead of accessing the module directly. Test: java_test.go Test: no changes to build.ninja Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
* Move hiddenapi tools used by build/soong from frameworks/basePaul Duffin2021-02-091-1/+1
| | | | | | | | | | | | Also, creates a python_binary_host module for generate_hiddenapi_lists and uses that when constructing the build rule rather than using the file directly. Bug: 177317659 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Change-Id: Ia11bb203ce5a74740d35f1b7e86716e15aad336e
* Add test for hiddenAPI index file generationPaul Duffin2021-02-071-3/+7
| | | | | | | | | | | | | | | | | | The index file and the metadata file both currently include duplicate entries due to them including both the <x> and <x>.impl libraries created by java_sdk_library in their inputs, plus including both source and prebuilt versions of the same named module. This change adds a test to illustrate that behavior. A follow up change will correct the problem and update the test accordingly. This change only adds a test for the index file because the metadata file depends on files from frameworks/base which makes it difficult to test. Bug 177317659 will fix that and allow the metadata file generation to be tested too. Bug: 178361284 Test: m nothing Change-Id: I33921d7267c9f4bb42726343d73f8a396d536aaa
* Improve module filtering in hiddenapi stubFlagsRule()Paul Duffin2021-02-051-5/+47
| | | | | | | | | | | | | | | | | | | | | Previously, it ignored any module that was not a platform apex variant however that required every module that was referenced from the boot jars to have a platform variant which is not the case when building from prebuilts. This change switches it to explicitly check that the variant is for either the appropriate apex or the platform depending on what is configured in the BootJars or UpdatableBootJars. It partially duplicates some logic from the getBootImageJar() function. It intentionally does not refactor the getBootImageJar() to allow for reuse because coupling the hiddenapi and dexpreopt logic would make refactoring either of them more difficult. Any duplicated code will be deduped once they have both been refactored. Bug: 178361284 Test: m droid Change-Id: I4b4e0dc8ee40c1ba1713d7ef72df13d175e84af6
* Add documentation for the different files created by hiddenapiPaul Duffin2021-01-291-3/+58
| | | | | | Test: m nothing Bug: 178361284 Change-Id: Id55646b9d4b7bc1acdb4ed6a6dd4456b746eb54c
* Enable prebuilt hiddenapi CSV files.Bill Peckham2021-01-191-0/+40
| | | | | | | | | | | | | | By enabling these hiddenapi CSV files to be prebuilt, it becomes possible to create a split build that supports the hiddenapi encode dex step, but doesn't contain all of the java sources needed to generate the CSV files. Bug: 175048716 Test: m nothing Test: new TestHiddenAPISingletonWithPrebuiltCsvFile Test: local build without prebuilt hiddenapi Test: local build with prebuilt hiddenapi Change-Id: I805ea3ec05860d2df211a3985ec025bf36f0d775
* Move temp blocklist APIs to max-sdk-r list.Mathew Inwood2021-01-131-2/+2
| | | | | | | | | | These APIs were temporarily blocked but are now being moved to the max-sdk-r for final release. Tag these APIs as "lo-prio" since we believe that they are unused. Bug: 173499988 Test: m Change-Id: If9c6be963faa75df77cf3cc7761b384324c8cd3e
* Improve error messages for missing dependenciesPaul Duffin2020-12-041-3/+4
| | | | | | | | | Adds some additional information into the paths that are created when modules are missing in Soong but SOONG_ALLOW_MISSING_DEPENDENCIES=true. Test: try and build platform against art prebuilts Bug: 171061220 Change-Id: Ifbcc0af5bdbd15409758a3b6f216cf9b3b5dba31
* Pass pctx and ctx to NewRuleBuilderColin Cross2020-12-011-12/+12
| | | | | | | | | | | Enable the RuleBuilder and RuleBuilderCommand methods to access the BuilderContext by passing it to NewRuleBuilder instead of RuleBuilder.Build. Test: genrule_test.go Test: rule_builder_test.go Test: m checkbuild Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
* Add 'lo-prio' tag to temp blocklist.Mathew Inwood2020-11-301-1/+1
| | | | | | | | | | | | | | This is a temporary measure to allow these APIs to be identified by downstream tooling. Before S is finished, these APIs will be moved to the max-target-R list anyway. Adding the lo-prio flag should have no semantic impact on these APIs but does allow them to be distinguished from the regular blocklist APIs. Test: m Bug: 174455522 Change-Id: I031dcecbdef34a4f93a0fec1a92d95f769918486
* Merge "Explicitly tag max-target-o APIs as "lo-prio"."Mathew Inwood2020-11-231-1/+1
|\
| * Explicitly tag max-target-o APIs as "lo-prio".Mathew Inwood2020-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | This allows the presubmit checker to explicitly allow certain changes to these APIs, rather than special casing tha max-target-o list. This in turn will allow other APIs to be tagged as lo-prio in future to get the same treatment. Test: m out/soong/hiddenapi/hiddenapi-flags.csv Bug: 172993934 Change-Id: Ic7cc0243b2b018c96d420a3f266c4b3a6958c32f
* | Merge "Temporarily move APIs to blocked list."Mathew Inwood2020-11-111-0/+2
|\ \
| * | Temporarily move APIs to blocked list.Mathew Inwood2020-11-101-0/+2
| |/ | | | | | | | | | | | | Bug: 170729553 Test: m Change-Id: I62db78941785fd1bd336cfe81c8e9763e08a0eb0
* / Remove dead codeAnton Hansson2020-11-051-9/+0
|/ | | | | | | | I removed the last use of this method in r.android.com/1450117. Bug: 169395887 Test: m nothing Change-Id: I3bbb600d92dac8d9c3dec0eee14c45cdfd320ce0
* Tag removed APIs as such in hiddenapi_flags.csv.Mathew Inwood2020-10-211-5/+5
| | | | | | | | | | Refactor flags in generate_hiddenapi_lists.py" the invocation to use the new more flexible schema. Add "--tag removed" to removed.txt APIs so that we can identify those APIs in the final output. Test: m -j out/soong/hiddenapi/hiddenapi-flags.csv Bug: 171300342 Change-Id: I38f2ec7c6e2ff7e5bdd9fe2aeb771d5153a2dc99
* Merge "Make hiddenapi flag generation use new artifact"Anton Hansson2020-10-121-14/+11
|\
| * Make hiddenapi flag generation use new artifactAnton Hansson2020-10-071-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the output of new genrule combined-removed-dex instead of the removedDexApi output from various metalava runs when generating the hiddenapi-flags.csv file. There are some minor difference in the two combined-removed-dex files, but these diffs do not amount to any diffs in the generated hiddenapi-flags.csv file. See the full set of diffs here: https://paste.googleplex.com/6632343525654528 Bug: 158465496 Test: diff hiddenapi-flags.csv before and after Change-Id: I082d18fc2b8a57ea8c5941d5c955a7970ab9d860
* | Remove global state from apex modulesColin Cross2020-10-061-4/+3
|/ | | | | | | | | | | | | A global variant was used to store the global mapping between modules and APEXes. Replace it with storing pointers to APEX contents inside each module so that they can query the contents of any APEXes they belong to. Bug: 146393795 Test: all Soong tests Test: single line change to build.ninja host install dependency ordering Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
* Make hiddenapi use prebuilt stubs when it shouldAnton Hansson2020-09-181-20/+23
| | | | | | | Bug: 160455085 Test: build_unbundled_mainline_module.sh (with disabled source-stubs) Test: hiddenapi_singleton_test.go Change-Id: Id93c974351b3f8efdf8e4efe4192d3809f4fcaa5
* Merge "Add hidden_api for java_import"Liz Kammer2020-09-141-0/+1
|\
| * Add hidden_api for java_importLiz Kammer2020-09-101-0/+1
| | | | | | | | | | | | | | Test: go java tests Test: m Bug: 160455085 Change-Id: Ib6e826e32ca73ceea0799b26145ad06b1e62a1bf
* | Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)Xin Li2020-08-291-1/+10
|\ \ | |/ |/| | | | | | | Bug: 166295507 Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d