summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2018-04-10 13:07:10 +0900
committer Jiyong Park <jiyong@google.com> 2018-04-19 08:57:30 +0900
commitc678ad3f7143291458d053bd7094301aff15d873 (patch)
tree7ca9d67614c93b6190eb7d3bd6109451ea1aa738 /java/java.go
parent59bcf6e631fe01254243e48877f709ccc58cefad (diff)
Adding java_sdk_library
java_sdk_library is to make a Java library that implements optional SDK APIs to apps. It is actually a wrapper for several modules: 1) stubs library that clients are linked against to, 2) droiddoc module that internally generates API stubs source files, 3) the real runtime shared library that implements the API, and 4) XML file for adding the runtime lib to the classpath at runtime if requested via <uses-library>. Note: this is only the initial CL for the feature. Followings are features currently missing and under development. 1) check for API consistency 2) install stubs libs as the dist artifacts 3) ensuring that apps have appropriate <uses-library> tag 4) disallowing linking to the runtime shared lib 5) HTML generation Bug: 77575606 Test: m -j Change-Id: I4a4ccf6e730e041703c63bb275d8860d0de96887
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 277cdafd9..8c2312476 100644
--- a/java/java.go
+++ b/java/java.go
@@ -292,6 +292,10 @@ type Dependency interface {
AidlIncludeDirs() android.Paths
}
+type SdkLibraryDependency interface {
+ HeaderJars(linkType linkType) android.Paths
+}
+
type SrcDependency interface {
CompiledSrcs() android.Paths
CompiledSrcJars() android.Paths
@@ -729,6 +733,13 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
}
deps.aidlIncludeDirs = append(deps.aidlIncludeDirs, dep.AidlIncludeDirs()...)
+ case SdkLibraryDependency:
+ switch tag {
+ case libTag:
+ deps.classpath = append(deps.classpath, dep.HeaderJars(getLinkType(j, ctx.ModuleName()))...)
+ default:
+ ctx.ModuleErrorf("dependency on java_sdk_library %q can only be in libs", otherName)
+ }
case android.SourceFileProducer:
switch tag {
case libTag: