Add support for android_library modules

Add support for compiling android_library modules into AARs,
and refactor app support on top of it.

Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
Merged-In: I1dfac5fffe577c6680bc4709147b2061eb7d819c
(cherry picked from commit a97c5d3f08)
This commit is contained in:
Colin Cross
2018-04-26 13:14:15 -07:00
parent 93f2546559
commit 42b96648ca
11 changed files with 611 additions and 393 deletions

View File

@@ -312,6 +312,8 @@ type sdkDep struct {
module string
systemModules string
frameworkResModule string
jar android.Path
aidl android.Path
}
@@ -406,6 +408,7 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep {
// useModule: true,
// module: m,
// systemModules: m + "_system_modules",
// frameworkResModule: r,
// }
//}
@@ -416,16 +419,17 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep {
switch v {
case "":
return sdkDep{
useDefaultLibs: true,
useDefaultLibs: true,
frameworkResModule: "framework-res",
}
// TODO(ccross): re-enable these once we generate stubs, until then
// use the stubs in prebuilts/sdk/*current
//case "current":
// return toModule("android_stubs_current")
// return toModule("android_stubs_current", "framework-res")
//case "system_current":
// return toModule("android_system_stubs_current")
// return toModule("android_system_stubs_current", "framework-res")
//case "test_current":
// return toModule("android_test_stubs_current")
// return toModule("android_test_stubs_current", "framework-res")
default:
return toFile(v)
}
@@ -592,7 +596,10 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
tag := ctx.OtherModuleDependencyTag(module)
if to, ok := module.(*Library); ok {
checkLinkType(ctx, j, to, tag.(dependencyTag))
switch tag {
case bootClasspathTag, libTag, staticLibTag:
checkLinkType(ctx, j, to, tag.(dependencyTag))
}
}
switch dep := module.(type) {
case Dependency: