From 71c868340ea2dac17e71fd998ed5ddd01e754e92 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Wed, 13 Sep 2023 01:01:53 +0000 Subject: Create java_api_contribution_import from sdk_library_import This change modifies sdk_library_import so that it directly creates java_api_contribution per api scope. The module creates api_contribution module for api scopes where the api file is specified. Test: m nothing && MODULE_BUILD_FROM_SOURCE=false m nothing --build-from-text-stub and inspect ninja dependency of java_api_library Bug: 300175323 Change-Id: I74be3b4f1efef7f7d1cb8bd7b6c893b9cef0f370 --- java/sdk_library_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/sdk_library_test.go') diff --git a/java/sdk_library_test.go b/java/sdk_library_test.go index 868d697ce..0b46919d2 100644 --- a/java/sdk_library_test.go +++ b/java/sdk_library_test.go @@ -74,6 +74,8 @@ func TestJavaSdkLibrary(t *testing.T) { name: "quuz", public: { jars: ["c.jar"], + current_api: "api/current.txt", + removed_api: "api/removed.txt", }, } java_sdk_library_import { @@ -173,6 +175,9 @@ func TestJavaSdkLibrary(t *testing.T) { android.AssertDeepEquals(t, "qux exports (optional)", []string{}, optionalSdkLibs) } + // test if quuz have created the api_contribution module + result.ModuleForTests(apiScopePublic.stubsSourceModuleName("quuz")+".api.contribution", "") + fooDexJar := result.ModuleForTests("foo", "android_common").Rule("d8") // tests if kotlinc generated files are NOT excluded from output of foo. android.AssertStringDoesNotContain(t, "foo dex", fooDexJar.BuildParams.Args["mergeZipsFlags"], "-stripFile META-INF/*.kotlin_module") -- cgit v1.2.3-59-g8ed1b