diff options
| author | 2020-05-25 12:20:51 +0100 | |
|---|---|---|
| committer | 2020-06-05 15:16:17 +0100 | |
| commit | 2d0c1946fade95005c7408fc46d4533fb9bb1da3 (patch) | |
| tree | 0e6f97d6c5fdd75de7d9fe8498762e9d7955e25d /java/sdk_library.go | |
| parent | cc51a6886ee6b448df99104e881b495f4cf6d2a0 (diff) | |
Correct link type for module stubs
Module stubs compile against module_current, so any module depending on
them had to compile against module_current (or broader) too. Treat them
as the API surface the stubs are for.
Bug: 157010342
Test: m
Change-Id: I49b9082dc1b5afe6c22e94126e574dd8061f0f39
Merged-In: I49b9082dc1b5afe6c22e94126e574dd8061f0f39
(cherry picked from commit 0bd88d0b4e782df6aa99475307a4cfab6d617d14)
Diffstat (limited to 'java/sdk_library.go')
| -rw-r--r-- | java/sdk_library.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index ee62390e7..de5ee03c4 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -1577,6 +1577,24 @@ func (s *frameworkModulesNamingScheme) apiModuleName(scope *apiScope, baseName s var _ sdkLibraryComponentNamingScheme = (*frameworkModulesNamingScheme)(nil) +func moduleStubLinkType(name string) (stub bool, ret linkType) { + // This suffix-based approach is fragile and could potentially mis-trigger. + // TODO(b/155164730): Clean this up when modules no longer reference sdk_lib stubs directly. + if strings.HasSuffix(name, ".stubs.public") || strings.HasSuffix(name, "-stubs-publicapi") { + return true, javaSdk + } + if strings.HasSuffix(name, ".stubs.system") || strings.HasSuffix(name, "-stubs-systemapi") { + return true, javaSystem + } + if strings.HasSuffix(name, ".stubs.module_lib") || strings.HasSuffix(name, "-stubs-module_libs_api") { + return true, javaModule + } + if strings.HasSuffix(name, ".stubs.test") { + return true, javaSystem + } + return false, javaPlatform +} + // java_sdk_library is a special Java library that provides optional platform APIs to apps. // In practice, it can be viewed as a combination of several modules: 1) stubs library that clients // are linked against to, 2) droiddoc module that internally generates API stubs source files, |