aboutsummaryrefslogtreecommitdiff
path: root/apex/apex_test.go
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Generate monolithic hidden API files direct from class jars" am: ↵Paul Duffin2021-05-141-16/+16
|\| | | | | | | | | | | | | | | 21f62ef867 am: b28f562092 am: 8063427dc4 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707573 Change-Id: I116c3a4028fd199df12ead373fbfb4d47c6fdf8e
| * Generate monolithic hidden API files direct from class jarsPaul Duffin2021-05-141-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Move copying of dex files from dexpreopt_bootjars singleton" am: ↵Paul Duffin2021-05-131-1/+1
|\| | | | | | | | | | | | | | | cfd24da1f4 am: 7be9378c61 am: 817187082c Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690881 Change-Id: If03ec0c3263413d2c88d91d510752d6bb3d4de80
| * Move copying of dex files from dexpreopt_bootjars singletonPaul Duffin2021-05-121-1/+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
* | Merge "Move configuration checks from getBootImageJar" am: 3f9af76391 am: ↵Treehugger Robot2021-04-301-3/+12
|\| | | | | | | | | | | | | | | e4a004eaa3 am: a1fe410f89 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1688391 Change-Id: I3dc9ceef57776a0198911365d2235b471f412513
| * Move configuration checks from getBootImageJarPaul Duffin2021-04-301-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Remove obsolete llndk_library" am: 5423a9c513 am: d9be64ea31 am: ↵Colin Cross2021-04-291-6/+3
|\| | | | | | | | | | | | | | | 4646975e32 Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1687470 Change-Id: I2c3e45786305e3b1854c9448b89f0a82177acf13
| * Remove obsolete llndk_libraryColin Cross2021-04-261-6/+3
| | | | | | | | | | | | | | | | | | Remove llndk_library in favor of cc_library with llndk.symbol_file. Bug: 170784825 Test: m checkbuild Test: TestLlndkLibrary Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
* | apex: remove use_vendorSteven Moreland2021-04-271-154/+4
|/ | | | | | | | | Should manually cut dependencies instead. Previously, this was used to take advantage of the limited dependencies of variant libs in some APEXes. Fixes: 175318864 Test: m nothing Change-Id: Id559fd1bea5c8b8696cf7ab8acc711a7c3844d14
* Merge "Support paths for vintf_fragments from Soong."Treehugger Robot2021-04-221-1/+1
|\
| * Support paths for vintf_fragments from Soong.Liz Kammer2021-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | The property vintf_fragments accepts paths and references to other modules; however, none of that is passed onto make, resulting in errors if a non-local path is used. Test: m Bug: 184567830 Change-Id: If3b56ea8eec3b95b3a310b58bffd045cedd8ee52
* | Make apex.key and certificate overridable.Jaewoong Jung2021-04-201-0/+17
|/ | | | | | Test: apex_test.go Fixes: 185477325 Change-Id: I8992ac5606fa92f53f07e6870a034f2d3352e618
* Move hidden API index file rule to platform_bootclasspathPaul Duffin2021-04-141-2/+2
| | | | | | | | | | | | 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
* prebuilt_apex created ApexInfo must not include prebuilt_ prefixPaul Duffin2021-04-131-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Improve realism of boot jar testsPaul Duffin2021-04-131-81/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Support paths for init_rc from Soong."Liz Kammer2021-04-121-1/+1
|\
| * Support paths for init_rc from Soong.Liz Kammer2021-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | The property init_rc accepts paths and references to other modules; however, none of that is passed onto make, resulting in errors if a non-local path is used. Test: m Bug: 184567830 Change-Id: Idbbf9de66c5182784d055e1cd64bcef34a7dbd79
* | Merge "Shared lib dependencies from rlib are included in APEX"Jiyong Park2021-04-081-0/+11
|\ \
| * | Shared lib dependencies from rlib are included in APEXJiyong Park2021-04-081-0/+11
| |/ | | | | | | | | | | | | | | | | This change fixes a bug that shared lib dependencies of an rlib is not installed to the APEX even when the rlib is part of the APEX. Bug: N/A Test: m Change-Id: I88fe461584499839d8018d6b4292374592e7562b
* | Add deapexer support for apex_setPaul Duffin2021-04-071-0/+34
| | | | | | | | | | | | Bug: 181267622 Test: m droid Change-Id: I630f9f2c33d037bf4a7011d2131a7d28f213ae8b
* | Separate apex extraction from the ApexSetPaul Duffin2021-04-071-19/+18
|/ | | | | | | | | | | | | This follows the same pattern as is used by the prebuilt_apex in order to make files encapsulated with a prebuilt .apex file available for use by the rest of the build. It separates the extraction of the appropriate apex from the zip supplied to apex_set into a separate module type whose output is used by the apex_set and will (in a follow up change) be used by the deapexer module too. Bug: 181267622 Test: m droid Change-Id: Icd13ce1f21845494e875d3e092abd4a9d2efca57
* Make prebuilt_apex report an error if no apex file is foundPaul Duffin2021-04-071-0/+8
| | | | | | | | | | Previously, if an appropriate src property was not specified it would return "" which resolves to the top level directory. This change causes it to report an error. Bug: 181267622 Test: m droid Change-Id: Ia5be324a0eff18e43b352d71c6768c8767986053
* Allow dependencies from platform variants to APEX modules (reland).Martin Stjernholm2021-04-061-0/+50
| | | | | | | | | | | | | | | | | | | | When `test_for` dependencies are added from libraries to APEX modules, they can be created from the platform variants of the libraries, since those are used for building tests. Hence we need an alias from the platform variant of the APEX module to have a target for those dependencies. This is only necessary for libraries that are split by the APEX mutator, i.e. is a member of some APEX. Normally that's not the case for test libraries, but there may be exceptions (read com.android.art.testing). This relands https://r.android.com/1654679 after decoupling it from the topic that caused b/184239856. Test: m nothing Bug: 183882457 Change-Id: If643c75ce9bc25fa01ad9d1e3ba8e1d060d03bb2
* Don't use incorrect version names like VER or BOARD even in testsJiyong Park2021-04-051-15/+15
| | | | | | | | | All version names will go through ApiLevelFromUser which triggers an error when the name is not a valid one. Bug: 175678607 Test: m Change-Id: Id33bf64085603914d45ad7942cb8908a4734493f
* Merge "Revert "Revert "Add min_sdk_version to java_import."""Jaewoong Jung2021-04-021-1/+35
|\
| * Revert "Revert "Add min_sdk_version to java_import.""Jaewoong Jung2021-04-021-1/+35
| | | | | | | | | | | | | | | | | | | | This reverts commit 5ab650800820efec13d2e36d0ae25a4e4240ac00. Reason for revert: Resubmitting Ie255f74d40432f4bdd0092d618705a7d17235e58 after fixing the broken targets. Bug: 183695497 Test: https://android-build.googleplex.com/builds/forrest/run/L58600000849810513 Change-Id: I5f072f396002ca3a45bd530ad9be987efa732833
* | Merge "Revert "Add min_sdk_version to java_import.""Jaewoong Jung2021-04-021-35/+1
|\ \
| * | Revert "Add min_sdk_version to java_import."Jaewoong Jung2021-04-021-35/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6d15d635569d420035e924c12a08091f0e9c579d. Reason for revert: Broke git_sc-mainline-prod on test_suites_x86_64 Fixes: 184305592 Change-Id: I4b2e2675e0dd9e2e84966f545a52f45d5b731bab
* | | Merge "Add min_sdk_version to java_import."Jaewoong Jung2021-04-011-1/+35
|\| |
| * | Add min_sdk_version to java_import.Jaewoong Jung2021-03-311-1/+35
| | | | | | | | | | | | | | | | | | Fixes: 183695497 Test: apex_test.go Change-Id: Ie255f74d40432f4bdd0092d618705a7d17235e58
* | | Merge "Revert "Allow dependencies from platform variants to APEX modules.""Nikita Ioffe2021-04-011-50/+0
|\ \ \
| * | | Revert "Allow dependencies from platform variants to APEX modules."Nikita Ioffe2021-04-011-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert submission 1658000 Reason for revert: Breaks full-eng build: b/184239856 Reverted Changes: I4f8ead785:Avoid internal APEX stubs for libsigchain and clea... I68affdf69:Allow dependencies from platform variants to APEX ... I54b33784e:Rename libdexfile_external_static to libdexfile_st... Id68ae9438:libdexfile_external is being replaced by libdexfil... I12ac84eb4:libdexfile_external is replaced by libdexfile. If05dbffc8:Rename libdexfile_external_static to libdexfile_st... Ia011fa3a8:Merge libdexfile_external into libdexfile. Change-Id: If494dc5385042a4620a76a9eadc1613ae0eb1655
* | | | Remove apexFixtureFactoryPaul Duffin2021-04-011-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 182885307 Test: m nothing Change-Id: I88c58bf6b4adda4017e54548748897c51c3f3aa1
* | | | Merge "Allow dependencies from platform variants to APEX modules."Martin Stjernholm2021-04-011-0/+50
|\| | |
| * | | Allow dependencies from platform variants to APEX modules.Martin Stjernholm2021-03-301-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `test_for` dependencies are added from libraries to APEX modules, they can be created from the platform variants of the libraries, since those are used for building tests. Hence we need an alias from the platform variant of the APEX module to have a target for those dependencies. This is only necessary for libraries that are split by the APEX mutator, i.e. is a member of some APEX. Normally that's not the case for test libraries, but there may be exceptions (read com.android.art.testing). Test: m nothing Bug: 183882457 Change-Id: I68affdf69d7ec05c0ee8730e8ec04d7cb9e0e44a
* | | | Merge ""current" is implicitly added to stubs.versions"Treehugger Robot2021-04-011-22/+32
|\ \ \ \ | |_|_|/ |/| | |
| * | | "current" is implicitly added to stubs.versionsJiyong Park2021-04-011-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, when a library `libfoo` has `stubs.versions: ["10", "11"]`, then `shared_libs: ["libfoo"]` is linked to the version 11 of the stub. This requires the author of `libfoo` to manually update the property whenever a new version is introduced. Otherwise, clients are not able to use the newly added APIs because the latest stub is for an old version. This change eliminates the need for manual updating. "current" version is always implicitly added to `stubs.versions`. It is added even when nothing is set on the property, if `stubs.symbol_file` is set. i.e. ``` cc_library { name: "libfoo", stubs: { symbol_file: "libfoo.map.txt", // no versions: [...] needed }, } cc_library { name: "a_client", shared_libs: ["libfoo"], apex_available: ["myapex"], min_sdk_version: "29", } apex { name: "myapex", native_shared_libraries: ["a_client"], min_sdk_version: "29", } ``` `a_client` links to the "current" stub of `libfoo` that has all symbols shown in the map file. Note that, above doesn't mean that the client has unlimited access to APIs that are introduced even after the min_sdk_version of the client (29 in this example). The use of such APIs still has to be guarded with `__builtin_available` check. Bug: N/A Test: m Change-Id: I70bb1600c18e74d36c6b24c3569d2149f02aaf96
* | | | Convert testDexpreoptWithApexes to use test fixturesPaul Duffin2021-03-311-66/+41
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 181070625 Test: m nothing Change-Id: Id40064c539c1d4eeb39396f0881a97529f3a3452
* | | | Convert TestApexPermittedPackagesRules to use test fixturesPaul Duffin2021-03-311-32/+20
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | Adds PrepareForTestWithNeverallowRules to make it easy to test neverallow rules. Avoid exporting any unnecessary neverallow related methods from the android package. Bug: 181070625 Test: m nothing Change-Id: Idfc6955cb23f1a4d1790be7879388154b03f3980
* | | Rename OptionalPath.RelativeToPath -> RelativeToTopPaul Duffin2021-03-301-1/+1
| | | | | | | | | | | | | | | | | | Bug: 183650682 Test: m nothing Change-Id: I95239c2273e715e8c4c15a4a02967e01f6913234
* | | Remove extraneous calls to TestingBuildParams.RelativeToTop()Paul Duffin2021-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Deprecated the method to try and prevent any other uses being added. Bug: 183650682 Test: m nothing Change-Id: Ia6f43851e5a00c9d96af780e3bd21e03175e1a2f
* | | Automatically call TestingBuildParams.RelativeToTop()Paul Duffin2021-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the few tests that break due to this and which cannot easily be separated into their own changes. Bug: 183650682 Test: m nothing Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
* | | Merge "Stop JavaSdkLibrary_... tests requiring absolute path"Paul Duffin2021-03-301-3/+3
|\ \ \
| * | | Stop JavaSdkLibrary_... tests requiring absolute pathPaul Duffin2021-03-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 183650682 Test: m nothing Change-Id: Ia6e5034bbf3920a9e1f8fc319dc722658f6cb1ce
* | | | Merge "Remove buildDir from apex package"Paul Duffin2021-03-301-40/+18
|\| | | | |_|/ |/| |
| * | Remove buildDir from apex packagePaul Duffin2021-03-291-40/+18
| | | | | | | | | | | | | | | | | | Bug: 182885307 Test: m nothing Change-Id: I71cbfd79e2fb4b1cbd2914ffab76570548d57c61
* | | Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2Martin Stjernholm2021-03-301-14/+70
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | * changes: Make test_for arch variant. Don't use APEX stubs between internal libs in the same APEX when building test_for modules. Add FilterListPred. Don't panic on "go test" invocations from the command line.
| * | Don't use APEX stubs between internal libs in the same APEX whenMartin Stjernholm2021-03-281-14/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | building test_for modules. This extends the current approach where test modules always depend on the platform variants of the APEX libs, and only skips the stubs on them. It still has the limitation that the internal libs must have the exact same apex_available lists. Also some improvement of the test accuracy in TestTestFor. Test: m libartagent-target with http://r.android.com/q/topic:libdexfile-noext applied Bug: 183217299 Change-Id: I2118b8a22c887077867a3ddbbe73437b4a29a6ad
* | | Prune test preparers in apex/boot_image_test.goPaul Duffin2021-03-281-6/+10
|/ / | | | | | | | | | | | | | | Cut down the preparers to only those needed by these tests. Bug: 177892522 Test: m nothing Change-Id: I811977b0331dd38c25623aa96e09e85ba5cf7c57
* | Convert test that disallows non existent paths to use fixturesPaul Duffin2021-03-241-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change needed to add some additional files to the registered files for PrepareForTestWithJavaDefaultModules because otherwise they would fail when "TestAllowNonExistentPaths = false". Those files were being added by the TestJavaLintRequiresCustomLintFileToExist (albeit in some cases in different locations to that required by the default modules but as the files are needed by the modules defined in PrepareForTestWithJavaDefaultModules they should be defined in it. A couple of other places also provided some files so moving them into PrepareForTestWithJavaDefaultModules caused some conflicts which needed to be resolved. Bug: 183184375 Test: m nothing Change-Id: I76ce9f1673c1c1c4000635b76b8377d582224bf1