Support core library

To support core library, "Openjdk9", "No_standard_libs" and metalava
properties are added to java_sdk_library.
If core_lib is true, dist paths are changed to
apistubs/core/....
impl library name is changed to {module_name}.jar instead of
{module_name}.impl.jar

Bug: 110404779
Test: m -j
Change-Id: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
Merged-In: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
(cherry picked from commit af4907fed7)
This commit is contained in:
Sundong Ahn
2018-10-19 13:46:09 +09:00
committed by Colin Cross
parent 63d91fad6a
commit 054b19a131
6 changed files with 226 additions and 232 deletions

View File

@@ -336,8 +336,8 @@ type Dependency interface {
}
type SdkLibraryDependency interface {
HeaderJars(linkType linkType) android.Paths
ImplementationJars(linkType linkType) android.Paths
HeaderJars(ctx android.BaseContext, sdkVersion string) android.Paths
ImplementationJars(ctx android.BaseContext, sdkVersion string) android.Paths
}
type SrcDependency interface {
@@ -729,8 +729,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
case SdkLibraryDependency:
switch tag {
case libTag:
linkType, _ := getLinkType(j, ctx.ModuleName())
deps.classpath = append(deps.classpath, dep.HeaderJars(linkType)...)
deps.classpath = append(deps.classpath, dep.HeaderJars(ctx, j.sdkVersion())...)
// names of sdk libs that are directly depended are exported
j.exportedSdkLibs = append(j.exportedSdkLibs, otherName)
default:
@@ -748,6 +747,8 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
deps.staticHeaderJars = append(deps.staticHeaderJars, dep.Srcs()...)
case android.DefaultsDepTag, android.SourceDepTag:
// Nothing to do
case publicApiFileTag, systemApiFileTag, testApiFileTag:
// Nothing to do
default:
ctx.ModuleErrorf("dependency on genrule %q may only be in srcs, libs, or static_libs", otherName)
}