From e602918294cdfdb50dd2e9f246808adae932b5ce Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 16 Dec 2019 17:43:48 +0000 Subject: Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot By default SdkMemberTypes are only supported on module_exports module type. Support for sdk module type has to be explicitly specified. The java_header_libs, native_shared_libs and stubs_sources are supported on sdk. The latter is required to provide the stubs source for an API specified in java_header_libs as they should be kept in sync. Bug: 146341462 Test: m nothing Change-Id: I19b9e60792780a797458d4a9e489506602b13144 --- sdk/cc_sdk_test.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sdk/cc_sdk_test.go') diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index f477445fd..255ac08a5 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -500,8 +500,8 @@ include/Test.h -> include/include/Test.h func TestSnapshotWithCcStaticLibrary(t *testing.T) { result := testSdkWithCc(t, ` - sdk { - name: "mysdk", + module_exports { + name: "myexports", native_static_libs: ["mynativelib"], } @@ -520,12 +520,12 @@ func TestSnapshotWithCcStaticLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "android_common", "", + result.CheckSnapshot("myexports", "android_common", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. cc_prebuilt_library_static { - name: "mysdk_mynativelib@current", + name: "myexports_mynativelib@current", sdk_member_name: "mynativelib", export_include_dirs: ["include/include"], arch: { @@ -560,9 +560,9 @@ cc_prebuilt_library_static { system_shared_libs: [], } -sdk_snapshot { - name: "mysdk@current", - native_static_libs: ["mysdk_mynativelib@current"], +module_exports_snapshot { + name: "myexports@current", + native_static_libs: ["myexports_mynativelib@current"], } `), checkAllCopyRules(` @@ -584,8 +584,8 @@ func TestHostSnapshotWithCcStaticLibrary(t *testing.T) { SkipIfNotLinux(t) result := testSdkWithCc(t, ` - sdk { - name: "mysdk", + module_exports { + name: "myexports", device_supported: false, host_supported: true, native_static_libs: ["mynativelib"], @@ -608,12 +608,12 @@ func TestHostSnapshotWithCcStaticLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "linux_glibc_common", "", + result.CheckSnapshot("myexports", "linux_glibc_common", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. cc_prebuilt_library_static { - name: "mysdk_mynativelib@current", + name: "myexports_mynativelib@current", sdk_member_name: "mynativelib", device_supported: false, host_supported: true, @@ -652,11 +652,11 @@ cc_prebuilt_library_static { system_shared_libs: [], } -sdk_snapshot { - name: "mysdk@current", +module_exports_snapshot { + name: "myexports@current", device_supported: false, host_supported: true, - native_static_libs: ["mysdk_mynativelib@current"], + native_static_libs: ["myexports_mynativelib@current"], } `), checkAllCopyRules(` -- cgit v1.2.3-59-g8ed1b