aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRashed Abdel-Tawab <rashed@linux.com>2018-08-09 14:08:53 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-12-11 19:03:32 +0200
commit5b5b4c9937d5926c1d48fae513d99d35763fb337 (patch)
tree09b169769cf5d1f4b7d8b0e615bb430b6f6377a6
parent2e857245ebea9379655f21e6d1aedb4b8c687dad (diff)
downloadbuild_soong-5b5b4c9937d5926c1d48fae513d99d35763fb337.tar.gz
build_soong-5b5b4c9937d5926c1d48fae513d99d35763fb337.tar.bz2
build_soong-5b5b4c9937d5926c1d48fae513d99d35763fb337.zip
soong: Squash of lineage-sdk bringup commits
Squash of: Author: Rashed Abdel-Tawab <rashed@linux.com> Date: Thu Aug 9 14:08:53 2018 -0700 soong: Special case Lineage SDK * org.lineageos.platform-res.apk needs to be installed to /system/framework * org.lineageos.platform-res needs to be a dependency for org.lineageos.platform and org.lineageos.platform.internal * Add other special exceptions for org.lineageos.platform-res Change-Id: Ic617c07c086916005ea4b88f26d31c61691a45f8 Author: Sam Mortimer <sam@mortimer.me.uk> Date: Thu Aug 30 15:33:16 2018 -0700 soong: make org.lineage.platform-res depend on framework-res *) Allows us to build org.lineage.platform-res with no_framework_libs true (as is done for framework-res). *) Whilst we're here, undo a dependency loop prevention in aar.go that we added during sdk bringup to allow our platform res to build with no_framework_libs false. Change-Id: Ib452a2e45112baf5d61b70b4be1ce0c01dfd84e5 Author: Luca Stefani <luca.stefani.ge1@gmail.com> Date: Mon Feb 4 18:56:52 2019 +0100 Always link org.lineageos.platform-res for org.lineageos.platform.sdk Test: m clean && m org.lineageos.platform.sdk Change-Id: I58956855bd4d1157e2582103c4861e7b384b4f73 Author: Sam Mortimer <sam@mortimer.me.uk> Date: Fri Aug 31 10:52:29 2018 -0700 soong: Allow framework to access lineage-sdk resources *) Make framework depend on lineage-sdk resource package *) Allows framework module to access lineage-sdk resources via usual org.lineageos.platform.internal.R paths. Change-Id: Ifd19d43d9308ac370ad40a499de16bf8ce204beb Change-Id: Icc18de5dfaa83fc0a1eda6f3704f3a92e1de0764
-rw-r--r--java/aar.go10
-rw-r--r--java/androidmk.go4
-rw-r--r--java/app.go5
-rw-r--r--java/app_test.go3
-rw-r--r--java/java.go24
-rw-r--r--java/sdk.go1
-rw-r--r--java/testing.go5
7 files changed, 47 insertions, 5 deletions
diff --git a/java/aar.go b/java/aar.go
index 6273a9b5..74c222ea 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -177,7 +177,7 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext sdkContext, mani
if !hasVersionName {
var versionName string
- if ctx.ModuleName() == "framework-res" {
+ if ctx.ModuleName() == "framework-res" || ctx.ModuleName() == "org.lineageos.platform-res" {
// Some builds set AppsDefaultVersionName() to include the build number ("O-123456"). aapt2 copies the
// version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things
// if it contains the build number. Use the PlatformVersionName instead.
@@ -197,6 +197,9 @@ func (a *aapt) deps(ctx android.BottomUpMutatorContext, sdkContext sdkContext) {
if sdkDep.frameworkResModule != "" {
ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
}
+ if sdkDep.lineageResModule != "" {
+ ctx.AddDependency(ctx.Module(), lineageResTag, sdkDep.lineageResModule)
+ }
}
func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, extraLinkFlags ...string) {
@@ -314,7 +317,7 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati
switch ctx.OtherModuleDependencyTag(module) {
case instrumentationForTag:
// Nothing, instrumentationForTag is treated as libTag for javac but not for aapt2.
- case libTag, frameworkResTag:
+ case libTag, frameworkResTag, lineageResTag:
if exportPackage != nil {
sharedLibs = append(sharedLibs, exportPackage)
}
@@ -524,6 +527,9 @@ func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) {
if sdkDep.useModule && sdkDep.frameworkResModule != "" {
ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
}
+ if sdkDep.useModule && sdkDep.lineageResModule != "" {
+ ctx.AddDependency(ctx.Module(), lineageResTag, sdkDep.lineageResModule)
+ }
}
ctx.AddVariationDependencies(nil, libTag, a.properties.Libs...)
diff --git a/java/androidmk.go b/java/androidmk.go
index 7a939e84..4f7a4b3b 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -271,7 +271,7 @@ func (app *AndroidApp) AndroidMk() android.AndroidMkData {
fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", app.proguardDictionary.String())
}
- if app.Name() == "framework-res" {
+ if app.Name() == "framework-res" || app.Name() == "org.lineageos.platform-res" {
fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)")
// Make base_rules.mk not put framework-res in a subdirectory called
// framework_res.
@@ -372,7 +372,7 @@ func (a *AndroidLibrary) AndroidMk() android.AndroidMkData {
fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", a.proguardDictionary.String())
}
- if a.Name() == "framework-res" {
+ if a.Name() == "framework-res" || a.Name() == "org.lineageos.platform-res" {
fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)")
// Make base_rules.mk not put framework-res in a subdirectory called
// framework_res.
diff --git a/java/app.go b/java/app.go
index ad672ead..ece87802 100644
--- a/java/app.go
+++ b/java/app.go
@@ -286,7 +286,7 @@ func (a *AndroidApp) dexBuildActions(ctx android.ModuleContext) android.Path {
a.dexpreopter.uncompressedDex = a.shouldUncompressDex(ctx)
a.deviceProperties.UncompressDex = a.dexpreopter.uncompressedDex
- if ctx.ModuleName() != "framework-res" {
+ if ctx.ModuleName() != "framework-res" && ctx.ModuleName() != "org.lineageos.platform-res" {
a.Module.compile(ctx, a.aaptSrcJar)
}
@@ -401,6 +401,9 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
if ctx.ModuleName() == "framework-res" {
// framework-res.apk is installed as system/framework/framework-res.apk
installDir = android.PathForModuleInstall(ctx, "framework")
+ } else if ctx.ModuleName() == "org.lineageos.platform-res" {
+ // org.lineageos.platform-res.apk needs to be in system/framework
+ installDir = android.PathForModuleInstall(ctx, "framework")
} else if Bool(a.appProperties.Privileged) {
installDir = android.PathForModuleInstall(ctx, "priv-app", a.installApkName)
} else {
diff --git a/java/app_test.go b/java/app_test.go
index 2bd44ad4..a3e40fa5 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -82,8 +82,11 @@ func TestApp(t *testing.T) {
expectedLinkImplicits = append(expectedLinkImplicits, manifestFixer.Output.String())
frameworkRes := ctx.ModuleForTests("framework-res", "android_common")
+ lineageRes := ctx.ModuleForTests("org.lineageos.platform-res", "android_common")
expectedLinkImplicits = append(expectedLinkImplicits,
frameworkRes.Output("package-res.apk").Output.String())
+ expectedLinkImplicits = append(expectedLinkImplicits,
+ lineageRes.Output("package-res.apk").Output.String())
// Test the mapping from input files to compiled output file names
compile := foo.Output(compiledResourceFiles[0])
diff --git a/java/java.go b/java/java.go
index bf738c4d..9ff2403f 100644
--- a/java/java.go
+++ b/java/java.go
@@ -406,6 +406,7 @@ var (
bootClasspathTag = dependencyTag{name: "bootclasspath"}
systemModulesTag = dependencyTag{name: "system modules"}
frameworkResTag = dependencyTag{name: "framework-res"}
+ lineageResTag = dependencyTag{name: "org.lineageos.platform-res"}
frameworkApkTag = dependencyTag{name: "framework-apk"}
kotlinStdlibTag = dependencyTag{name: "kotlin-stdlib"}
kotlinAnnotationsTag = dependencyTag{name: "kotlin-annotations"}
@@ -421,6 +422,7 @@ type sdkDep struct {
systemModules string
frameworkResModule string
+ lineageResModule string
jars android.Paths
aidl android.OptionalPath
@@ -486,12 +488,21 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
}
if (ctx.ModuleName() == "framework") || (ctx.ModuleName() == "framework-annotation-proc") {
ctx.AddVariationDependencies(nil, frameworkResTag, "framework-res")
+ ctx.AddDependency(ctx.Module(), lineageResTag, "org.lineageos.platform-res")
}
if ctx.ModuleName() == "android_stubs_current" ||
ctx.ModuleName() == "android_system_stubs_current" ||
ctx.ModuleName() == "android_test_stubs_current" {
ctx.AddVariationDependencies(nil, frameworkApkTag, "framework-res")
}
+ if ctx.ModuleName() == "org.lineageos.platform-res" {
+ ctx.AddDependency(ctx.Module(), frameworkResTag, "framework-res")
+ }
+ if ctx.ModuleName() == "org.lineageos.platform" ||
+ ctx.ModuleName() == "org.lineageos.platform.internal" ||
+ ctx.ModuleName() == "org.lineageos.platform.sdk" {
+ ctx.AddDependency(ctx.Module(), lineageResTag, "org.lineageos.platform-res")
+ }
}
ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
@@ -772,6 +783,19 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
// generated by framework-res.apk
deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar)
}
+ case lineageResTag:
+ if ctx.ModuleName() == "org.lineageos.platform" ||
+ ctx.ModuleName() == "org.lineageos.platform.internal" ||
+ ctx.ModuleName() == "org.lineageos.platform.sdk" {
+ // org.lineageos.platform.jar has a one-off dependency on the R.java and Manifest.java files
+ // generated by org.lineageos.platform-res.apk
+ deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar)
+ }
+ if ctx.ModuleName() == "framework" {
+ // framework.jar has a one-off dependency on the R.java and Manifest.java files
+ // generated by org.lineageos.platform-res.apk
+ deps.srcJars = append(deps.srcJars, dep.(*AndroidApp).aaptSrcJar)
+ }
case frameworkApkTag:
if ctx.ModuleName() == "android_stubs_current" ||
ctx.ModuleName() == "android_system_stubs_current" ||
diff --git a/java/sdk.go b/java/sdk.go
index e93f8fb6..dab04e71 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -182,6 +182,7 @@ func decodeSdkDep(ctx android.BaseContext, sdkContext sdkContext) sdkDep {
return sdkDep{
useDefaultLibs: true,
frameworkResModule: "framework-res",
+ lineageResModule: "org.lineageos.platform-res",
}
case "current":
return toModule("android_stubs_current", "framework-res", sdkFrameworkAidlPath(ctx))
diff --git a/java/testing.go b/java/testing.go
index 6b35bd04..c805e0ef 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -76,6 +76,11 @@ func GatherRequiredDepsForTest() string {
name: "framework-res",
no_framework_libs: true,
}
+
+ android_app {
+ name: "org.lineageos.platform-res",
+ no_framework_libs: true,
+ }
`
systemModules := []string{