From c678ad3f7143291458d053bd7094301aff15d873 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 10 Apr 2018 13:07:10 +0900 Subject: 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 . 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 tag 4) disallowing linking to the runtime shared lib 5) HTML generation Bug: 77575606 Test: m -j Change-Id: I4a4ccf6e730e041703c63bb275d8860d0de96887 --- java/java.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'java/java.go') 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: -- cgit v1.2.3-59-g8ed1b