Fetch generated srcs from java libs for droiddoc.
api-stubs, system-api-stubs and etc need generated sources and srcjars from "framework", so add a property that tell module to fetch srcs and srcjars from its dependency libraries. The libraries in that property has to be in the module's classpath. Also add doc_defaults targets. Bug: b/70351683 Test: m -j Change-Id: I05831fbcad488037710950e4f05dc8fb2a12f403
This commit is contained in:
35
java/java.go
35
java/java.go
@@ -283,6 +283,21 @@ type Dependency interface {
|
||||
AidlIncludeDirs() android.Paths
|
||||
}
|
||||
|
||||
type SrcDependency interface {
|
||||
CompiledSrcs() android.Paths
|
||||
CompiledSrcJars() android.Paths
|
||||
}
|
||||
|
||||
func (j *Module) CompiledSrcs() android.Paths {
|
||||
return j.compiledJavaSrcs
|
||||
}
|
||||
|
||||
func (j *Module) CompiledSrcJars() android.Paths {
|
||||
return j.compiledSrcJars
|
||||
}
|
||||
|
||||
var _ SrcDependency = (*Module)(nil)
|
||||
|
||||
func InitJavaModule(module android.DefaultableModule, hod android.HostOrDeviceSupported) {
|
||||
android.InitAndroidArchModule(module, hod, android.MultilibCommon)
|
||||
android.InitDefaultableModule(module)
|
||||
@@ -299,6 +314,7 @@ var (
|
||||
bootClasspathTag = dependencyTag{name: "bootclasspath"}
|
||||
systemModulesTag = dependencyTag{name: "system modules"}
|
||||
frameworkResTag = dependencyTag{name: "framework-res"}
|
||||
frameworkApkTag = dependencyTag{name: "framework-apk"}
|
||||
kotlinStdlibTag = dependencyTag{name: "kotlin-stdlib"}
|
||||
proguardRaiseTag = dependencyTag{name: "proguard-raise"}
|
||||
)
|
||||
@@ -459,6 +475,11 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
|
||||
if ctx.ModuleName() == "framework" {
|
||||
ctx.AddDependency(ctx.Module(), frameworkResTag, "framework-res")
|
||||
}
|
||||
if ctx.ModuleName() == "android_stubs_current" ||
|
||||
ctx.ModuleName() == "android_system_stubs_current" ||
|
||||
ctx.ModuleName() == "android_test_stubs_current" {
|
||||
ctx.AddDependency(ctx.Module(), frameworkApkTag, "framework-res")
|
||||
}
|
||||
}
|
||||
|
||||
ctx.AddDependency(ctx.Module(), libTag, j.properties.Libs...)
|
||||
@@ -544,6 +565,7 @@ type deps struct {
|
||||
staticHeaderJars android.Paths
|
||||
staticJarResources android.Paths
|
||||
aidlIncludeDirs android.Paths
|
||||
srcs android.Paths
|
||||
srcJars android.Paths
|
||||
systemModules android.Path
|
||||
aidlPreprocess android.OptionalPath
|
||||
@@ -606,6 +628,18 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
|
||||
// generated by framework-res.apk
|
||||
deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar)
|
||||
}
|
||||
case frameworkApkTag:
|
||||
if ctx.ModuleName() == "android_stubs_current" ||
|
||||
ctx.ModuleName() == "android_system_stubs_current" ||
|
||||
ctx.ModuleName() == "android_test_stubs_current" {
|
||||
// framework stubs.jar need to depend on framework-res.apk, in order to pull the
|
||||
// resource files out of there for aapt.
|
||||
//
|
||||
// Normally the package rule runs aapt, which includes the resource,
|
||||
// but we're not running that in our package rule so just copy in the
|
||||
// resource files here.
|
||||
deps.staticJarResources = append(deps.staticJarResources, dep.(*AndroidApp).exportPackage)
|
||||
}
|
||||
case kotlinStdlibTag:
|
||||
deps.kotlinStdlib = dep.HeaderJars()
|
||||
default:
|
||||
@@ -895,6 +929,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
|
||||
|
||||
// static classpath jars have the resources in them, so the resource jars aren't necessary here
|
||||
jars = append(jars, deps.staticJars...)
|
||||
jars = append(jars, deps.staticJarResources...)
|
||||
|
||||
var manifest android.OptionalPath
|
||||
if j.properties.Manifest != nil {
|
||||
|
Reference in New Issue
Block a user