diff options
| author | 2020-01-30 18:00:15 +0900 | |
|---|---|---|
| committer | 2020-01-31 23:01:34 +0900 | |
| commit | 50146e9c8eadac8f71ab4e1ae689a0545aaed5a4 (patch) | |
| tree | 846325f7e029db0e72ab150a32495ecfb2627311 /java/java.go | |
| parent | 67edce7adbe4bbaeced39bc10df6157ede6b3826 (diff) | |
sdk_version: "module_current" is supported
module_* is a new API surface for OS modules (e.g. APEXes). It has
slightly bigger API surface than the system_* SDK. Specifically, APIs
with @SystemApi(client=MODULE_LIBRARIES) are added there.
Bug: 146757305
Test: m
Change-Id: I8980e50c0e3a4cd843048e0de1f638e854384f46
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 15 |
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 |