summaryrefslogtreecommitdiff
path: root/java/prebuilt_apis_test.go
AgeCommit message (Collapse)Author
2025-03-04Always allow mixing old and new SDK version formats MÃ¥rten Kongstad
The SDK is changing its versioning scheme from the old single integer API level to the new major.minor format. Remove the now obsolete allow_incremental_platform_api property of prebuilt_apis. Update soong to allow a mix of the old and new formats. Bug: 397644338 Test: croot build/soong && go test ./java Test: lunch sdk-next-eng && m sdk dist Ignore-AOSP-First: minor SDK development takes place on internal main Change-Id: Ie169addb97bb1c45fb254f9a7922a623cda94289
2025-02-12Don't panic in ModuleForTests and friends Colin Cross
Panicking in ModuleForTests and similar test helper functions was a mistake. Go's test runner stops running tests as soon as any test panics, which means debugging multiple tests panicking requires rerunning all the tests after fixing each panic to find the next one. Pass the *testing.T into ModuleForTests and friends so that it can call t.Fatalf instead. Test: all soong tests pass Change-Id: I5d0f2424eaf04fb795079e6d1e4b9469d8c7033c
2025-01-31Add t.Parallel() to java tests Colin Cross
Speeds up go test ./java from 32 seconds to 9 seconds. Test: go test ./java Change-Id: I4c6640e787c0744c6dfda03b7382839b452e24cf
2023-08-25Support for incremetal platform prebuilt APIs Todd Lee
This change provides support for prebuilt incremental platform API (i.e. API changes associated with a QPR, as opposed to a major dessert releas). This feature is provided via the existing prebuilt_apis module with the introduction of a new attribute: allow_incremental_platform_api While typical platform prebuilt APIs are presumed to be under a directory structure that follows the pattern: <version>/<scope>/<module>.jar <version>/<scope>/api/<module>.txt Where <version> is limited to a single integer signifying the API level. For modules where allow_incremental_platform_api is set to 'true' (false by default) the pattern is the same, however <version> is presumed to be of the form MM.m, where MM aligns with the existing API level and m signifies the incremental release (e.g. QPR). Bug: b/280790094 Test: platform build check with both incremental & non-incremental API cd build/soong && go test ./java (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:eee6995093485497bc29cdce01c2a86765ffb4eb) Change-Id: I67e293006ccfa210d0dcc0a294db894632f1b6cb
2022-09-21Tweak logic for when extension txt is latest Anton Hansson
Always use the latest extension as the latest API, regardless of the current base extension version. This makes it so that we can bump the base in master without changing which txt is considered latest. Also extend the error check to apply more widely (which caught an error in the extension 3 finalization). Bug: 228017107 Test: m checkapi (with api break & bumped base) Test: prebuilt_apis_test.go Change-Id: Ia10eb41ff500c566736f0d29a29984a99386bb6f
2022-02-21Add support for sdk extensions in prebuilt_apis Anton Hansson
This makes it possible to pass an extensions_dir containing finalized module APIs to prebuilt_apis. The extension versions are compared to the api level versions to figure out what the "latest" finalized API is for each module. This is done using the base_sdk_extension_version, such that any extension higher than than base_sdk_extension_version is assumed to be finalized after any of the existing api level versions. Bug: 220086085 Test: prebuilt_apis_test.go Test: existing module in prebuilts/sdk Change-Id: Ib792f84202d436f594ba5e8716c6a187f9cd60dc
2021-11-01Use module-lib system modules when building from prebuilts Paul Duffin
When building from source the build uses the java system modules for the public or module APIs as needed. However, previously when building from prebuilts it would always use the public API. That difference lead to build failures when building from prebuilts. This change makes the selection of java system modules when building from prebuilts consistent with the selection when building from sources. As API levels 30 and 31 (which are the only previous releases to provide system modules) did not provide separate java system modules for the module-lib API those levels always use the public APIs. Bug: 204189791 Test: - before applying these change m TARGET_BUILD_APPS=framework-connectivity - build fails with compilation error due to missing module APIs m sdk dist cp out/dist/system-modules/module-lib/core-for-system-modules.jar prebuilts/sdk/current/module-lib/core-for-system-modules.jar - apply these changes m TARGET_BUILD_APPS=framework-connectivity - build passes as expected Change-Id: Id113ff014e7892b1009fbcaad89b1ae23a7c3b79
2021-11-01Add test for prebuilt_apis creation of system modules Paul Duffin
Previously, there were no tests for this (outside uses in other tests). This change adds a test that uses the fixture preparers that create a prebuilt_api in order to make prebuilt APIs available. That ensures that both the prebuilt_api is working as expected and the preparer creates a realistic test environment. Bug: 204189791 Test: m nothing Change-Id: I57352aa00f7b268e5286be92f177764dd63ba7e8