summaryrefslogtreecommitdiff
path: root/sdk/cc_sdk_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-05 23:02:39 +0000
committer Colin Cross <ccross@android.com> 2025-02-06 23:43:51 +0000
commitde7428141f39fcc4473b4e342458812845e62d58 (patch)
tree80390fc9c8b3617fb792aa6c336ab79f03a23d31 /sdk/cc_sdk_test.go
parentaba8cd956a1f0cca137f6ab02b9791aac9435efd (diff)
Move MutateApexTransition shortcut later
Returning from MutateApexTransition too early is allowing invalid apex_available values to be ignored for modules that have no apex variations. Move the exit later so that apex_available checks happen and platform variants are hidden consistently. Bug: 394664568 Test: builds Change-Id: I324de8090a9f1a874b5b22f20b8d62bf22c7d79c
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r--sdk/cc_sdk_test.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go
index 939477f61..5bac67da6 100644
--- a/sdk/cc_sdk_test.go
+++ b/sdk/cc_sdk_test.go
@@ -805,13 +805,19 @@ func TestSnapshotWithCcSharedLibrary(t *testing.T) {
native_shared_libs: ["mynativelib"],
}
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ min_sdk_version: "1",
+ }
+
cc_library_shared {
name: "mynativelib",
srcs: [
"Test.cpp",
"aidl/foo/bar/Test.aidl",
],
- apex_available: ["apex1", "apex2"],
+ apex_available: ["myapex"],
export_include_dirs: ["myinclude"],
aidl: {
export_aidl_headers: true,
@@ -821,6 +827,18 @@ func TestSnapshotWithCcSharedLibrary(t *testing.T) {
`)
CheckSnapshot(t, result, "mysdk", "",
+ snapshotTestPreparer(checkSnapshotWithoutSource,
+ android.FixtureMergeMockFs(android.MockFS{
+ "myapex/Android.bp": []byte(`
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ min_sdk_version: "1",
+ }
+ `),
+ "myapex/apex_manifest.json": nil,
+ }),
+ ),
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
@@ -833,10 +851,7 @@ cc_prebuilt_library_shared {
name: "mynativelib",
prefer: false,
visibility: ["//visibility:public"],
- apex_available: [
- "apex1",
- "apex2",
- ],
+ apex_available: ["myapex"],
stl: "none",
compile_multilib: "both",
export_include_dirs: ["include/myinclude"],