summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-02-06 03:50:43 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-02-06 03:50:43 +0000
commitc4930248c448c6ab630c8df63bc2f78beb8624c3 (patch)
tree7f8555737b07f05d5ab8cdb8d6a685e39f62fb77 /java/java.go
parent387ad5c5761c45f36cb745d455163e5b367f77de (diff)
parent50146e9c8eadac8f71ab4e1ae689a0545aaed5a4 (diff)
Merge "sdk_version: "module_current" is supported"
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go
index ed3dca9e0..a4e91ab9c 100644
--- a/java/java.go
+++ b/java/java.go
@@ -757,9 +757,12 @@ func checkProducesJars(ctx android.ModuleContext, dep android.SourceFileProducer
type linkType int
const (
+ // TODO(jiyong) rename these for better readability. Make the allowed
+ // and disallowed link types explicit
javaCore linkType = iota
javaSdk
javaSystem
+ javaModule
javaPlatform
)
@@ -789,6 +792,10 @@ func (m *Module) getLinkType(name string) (ret linkType, stubs bool) {
return javaSdk, true
case ver.kind == sdkPublic:
return javaSdk, false
+ case name == "android_module_lib_stubs_current":
+ return javaModule, true
+ case ver.kind == sdkModule:
+ return javaModule, false
case ver.kind == sdkPrivate || ver.kind == sdkNone || ver.kind == sdkCorePlatform:
return javaPlatform, false
case !ver.valid():
@@ -824,11 +831,17 @@ func checkLinkType(ctx android.ModuleContext, from *Module, to linkTypeContext,
}
break
case javaSystem:
- if otherLinkType == javaPlatform {
+ if otherLinkType == javaPlatform || otherLinkType == javaModule {
ctx.ModuleErrorf("compiles against system API, but dependency %q is compiling against private API."+commonMessage,
ctx.OtherModuleName(to))
}
break
+ case javaModule:
+ if otherLinkType == javaPlatform {
+ ctx.ModuleErrorf("compiles against module API, but dependency %q is compiling against private API."+commonMessage,
+ ctx.OtherModuleName(to))
+ }
+ break
case javaPlatform:
// no restriction on link-type
break