From 1453baa8cbbfd559745c57cccffe847e53fdb3cb Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Sat, 27 May 2023 05:32:30 +0000 Subject: Create full API surface java_library in combined_apis This change renames the full api surface stub jar generating java_library modules by adding ".from-source" suffix and creating the modules in combined_apis. Either the ".from-source" module or the ".from-text" module is added as static libs based on the build config. Bug: 284150060 Bug: 284995489 Bug: 285410821 Test: m && m --build-from-text-stub and verify no ninja path between android_stubs_current and android_stubs_current.from-source Change-Id: I1419af0cd0ca2199e82e3337717b6391a51267c4 --- api/api_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'api/api_test.go') diff --git a/api/api_test.go b/api/api_test.go index 15b695ca0d36..1f4c2af32493 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -19,6 +19,7 @@ import ( "android/soong/android" "android/soong/bp2build" + "android/soong/java" ) func runCombinedApisTestCaseWithRegistrationCtxFunc(t *testing.T, tc bp2build.Bp2buildTestCase, registrationCtxFunc func(ctx android.RegistrationContext)) { @@ -30,7 +31,9 @@ func runCombinedApisTestCaseWithRegistrationCtxFunc(t *testing.T, tc bp2build.Bp func runCombinedApisTestCase(t *testing.T, tc bp2build.Bp2buildTestCase) { t.Helper() - runCombinedApisTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) {}) + runCombinedApisTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) { + ctx.RegisterModuleType("java_defaults", java.DefaultsFactory) + }) } func TestCombinedApisGeneral(t *testing.T) { @@ -42,6 +45,13 @@ func TestCombinedApisGeneral(t *testing.T) { system_server_classpath: ["ssc"], } `, + Filesystem: map[string]string{ + "a/Android.bp": ` + java_defaults { + name: "android.jar_defaults", + } + `, + }, ExpectedBazelTargets: []string{ bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-current.txt", bp2build.AttrNameToString{ "scope": `"public"`, -- cgit v1.2.3-59-g8ed1b