summaryrefslogtreecommitdiff
path: root/apex/classpath_element_test.go
AgeCommit message (Collapse)Author
2025-02-07Pass libraryToApex and apexNameToFragment mappings into CreateClasspathElements Colin Cross
Remove a usage of ApexInfo.InApexVariants by collecting the libraryToApex and apexToFragment mappings while collecting the fragments and passing them into CreateClasspathElements. Bug: 372543712 Test: CreateClasspathElementTest Change-Id: I03adc821b04bc01828f075f25bbb8124505859a7
2025-02-03Use unique apex variations for bootclasspath fragments Colin Cross
Upcoming changes to the ApexInfo mutator will require unique apex variations for the bootclasspath fragments, change them now to simplify comparisons. Test: go test ./... Change-Id: Ia8880fe5ac22a7bd2fb9ddaeb3b04b9ae90b1701
2024-11-05Verify that libraries in apexes don't link to implementations outside the apex Colin Cross
As part of removing some of the complexity in Soong around using stub vs. implementations for shared library dependencies a syntax will be added to Soong to allow explicitly selecting stubs vs. implementation. To avoid incorrect use, add a verification pass on apexes that ensure that all transitive implementation libraries used to link native libraries or binaries in the apex are themselves in the apex. Bug: 372543712 Test: TestApexVerifyNativeImplementationLibs Flag: EXEMPT host only Change-Id: I4aeaca00a359ce97e8f9efd2d8bffb8f9d2dc0df
2024-10-24Make apex tests parallel Colin Cross
Mark all the apex tests and subtests with t.Parallel(), which will allow the test runner to run them in parallel. Reduces the time required to run the apex tests from 70s to 9.7s. Test: go test ./apex Flag: EXEMPT test only Change-Id: I08bd3cb4d8eec1f9520c1118b4525aa79e95288e
2024-08-29Revert^4 "Implement detecting container violations." Jihoon Kang
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-28Revert "Implement detecting container violations." Satish Yalla
This reverts commit bb678f82d6bb5cd89bf282e88a879123d9763d61. Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission. Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-27Implement detecting container violations. Jihoon Kang
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: I36e9cd956c5a076a53635be0c6ff27f77725516e
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-14Use generics for providers API Colin Cross
Using generics for the providers API allows a type to be associated with a ProviderKey, resulting in a type-safe API without that doesn't require runtime type assertions by every caller. Unfortunately, Go does not allow generic types in methods, only in functions [1]. This prevents a type-safe API on ModuleContext, and requires moving the API to be functions that take a ModuleContext as a parameter. This CL creates the new API, but doesn't convert all of the callers. [1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods) Bug: 316410648 Test: builds Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2022-05-27bootclasspath_fragment: Require at least one hidden_api package property Paul Duffin
Previously, the split_packages, single_packages and package_prefixes properties were all optional and the split_packages defaulted to ["*"]. As that value conflicted with the other package properties that meant that split_packages always had to be specified even if it was to just set it to an empty array. This change requires at least one of them to be specified and defaults split_packages to an empty list which means it is not required, although it can be helpful to make that explicit. Bug: 194063708 Test: m nothing Change-Id: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
2021-08-16Make sure that classpath fragment contents appear in make vars. satayev
The source of truth for what jars are in BOOTCLASSPATH and SYSTEMSERVERCLASSPATH is make; adding a classpath fragment in soong with a new jar in the contents without having it declared in make is wrong (excluding test apexes). Bug: 191369843 Test: m nothing Change-Id: Ifd313776ee7ad206031244534ed3870126e4f835
2021-08-10Fix tests to use correct fixtures for configuring (Apex)BootJars. satayev
This is in preparation to r.android.com/1740313 where setting correct variables would be enforced (i.e. apex and non-apex boot jars must be in config.ApexBootJars and config.BootJars correspondingly). Bug: 191369843 Test: m nothing Change-Id: Ic86680c1f7af53d229083b2cc58beb3ceccb4b6a
2021-06-18Add ClasspathElement support Paul Duffin
The configuration of the bootclasspath, e.g. PRODUCT_BOOT_JARS, includes libraries that are standalone and libraries that are part of an APEX. All libraries that are part of an APEX must also be part of a bootclasspath_fragment. Currently, the libraries and fragments are handled separately but that is limiting as it does not make it easy to process all the libraries while treating those from fragments differently to standalone libraries. That is needed for hidden API processing as it needs to use classesJars from standalone libraries but pre-generated flag files from fragments. This change adds support for ClasspathElements which is represents the classpath as a whole while differentiating between standalone libraries and fragments. Bug: 177892522 Test: m nothing Change-Id: I7a4adc67164a46079eb8ec0a17fc755044b4949d