From 4deab28fd4c90f67f98499c73be72870c61ec41b Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 30 Mar 2023 17:06:32 +0000 Subject: [PATCH 1/2] Create a SetBuildFromTextStub method This will be useful for writing unit tests Test: go build ./android Change-Id: If27a050c0cfd0492e0cd3a422ac33f40b7a0a6d5 --- android/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/config.go b/android/config.go index 33deba500..038cd0f19 100644 --- a/android/config.go +++ b/android/config.go @@ -1894,3 +1894,7 @@ func (c *config) ApiSurfacesDir(s ApiSurface, version string) string { func (c *config) BuildFromTextStub() bool { return c.buildFromTextStub } + +func (c *config) SetBuildFromTextStub(b bool) { + c.buildFromTextStub = b +} From 6bd19dd4c5d69f8bb2e53728dfc5283812aa27bb Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 30 Mar 2023 17:54:58 +0000 Subject: [PATCH 2/2] add *.from-text modules to the java test fixture Test: go build ./java Change-Id: Ib9ff4eb59ff63dc208b7a28626d42b53153c86d6 --- java/testing.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/java/testing.go b/java/testing.go index 63d7dba69..8a0db9cb1 100644 --- a/java/testing.go +++ b/java/testing.go @@ -368,6 +368,15 @@ func gatherRequiredDepsForTest() string { "core.current.stubs", "legacy.core.platform.api.stubs", "stable.core.platform.api.stubs", + "android_stubs_current.from-text", + "android_system_stubs_current.from-text", + "android_test_stubs_current.from-text", + "android_module_lib_stubs_current.from-text", + "android_system_server_stubs_current.from-text", + "core.current.stubs.from-text", + "legacy.core.platform.api.stubs.from-text", + "stable.core.platform.api.stubs.from-text", + "kotlin-stdlib", "kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8", @@ -409,6 +418,10 @@ func gatherRequiredDepsForTest() string { "core-module-lib-stubs-system-modules", "legacy-core-platform-api-stubs-system-modules", "stable-core-platform-api-stubs-system-modules", + "core-public-stubs-system-modules.from-text", + "core-module-lib-stubs-system-modules.from-text", + "legacy-core-platform-api-stubs-system-modules.from-text", + "stable-core-platform-api-stubs-system-modules.from-text", } for _, extra := range systemModules {