diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index 123fe7069..7db56c4c7 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -79,6 +79,8 @@ func TestBasicSdkWithCc(t *testing.T) { cc_library_shared { name: "sdkmember", system_shared_libs: [], + stl: "none", + apex_available: ["mysdkapex"], } sdk_snapshot { @@ -152,6 +154,13 @@ func TestBasicSdkWithCc(t *testing.T) { key: "myapex.key", certificate: ":myapex.cert", } + + apex { + name: "mysdkapex", + native_shared_libs: ["sdkmember"], + key: "myapex.key", + certificate: ":myapex.cert", + } `) sdkMemberV1 := result.ModuleForTests("sdkmember_mysdk_1", "android_arm64_armv8-a_shared_myapex").Rule("toc").Output diff --git a/sdk/sdk.go b/sdk/sdk.go index b9b8199d3..c2685055f 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -330,6 +330,11 @@ type dependencyTag struct { blueprint.BaseDependencyTag } +// Mark this tag so dependencies that use it are excluded from APEX contents. +func (t dependencyTag) ExcludeFromApexContents() {} + +var _ android.ExcludeFromApexContentsTag = dependencyTag{} + // For dependencies from an in-development version of an SDK member to frozen versions of the same member // e.g. libfoo -> libfoo.mysdk.11 and libfoo.mysdk.12 type sdkMemberVersionedDepTag struct { diff --git a/sdk/testing.go b/sdk/testing.go index 436175419..0fc6baa20 100644 --- a/sdk/testing.go +++ b/sdk/testing.go @@ -44,14 +44,15 @@ func testSdkContext(bp string, fs map[string][]byte) (*android.TestContext, andr ` + cc.GatherRequiredDepsForTest(android.Android, android.Windows) mockFS := map[string][]byte{ - "build/make/target/product/security": nil, - "apex_manifest.json": nil, - "system/sepolicy/apex/myapex-file_contexts": nil, - "system/sepolicy/apex/myapex2-file_contexts": nil, - "myapex.avbpubkey": nil, - "myapex.pem": nil, - "myapex.x509.pem": nil, - "myapex.pk8": nil, + "build/make/target/product/security": nil, + "apex_manifest.json": nil, + "system/sepolicy/apex/myapex-file_contexts": nil, + "system/sepolicy/apex/myapex2-file_contexts": nil, + "system/sepolicy/apex/mysdkapex-file_contexts": nil, + "myapex.avbpubkey": nil, + "myapex.pem": nil, + "myapex.x509.pem": nil, + "myapex.pk8": nil, } cc.GatherRequiredFilesForTest(mockFS)