summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRashed Abdel-Tawab <rashed@linux.com>2018-08-09 14:08:53 -0700
committerMichael Bestas <mkbestas@lineageos.org>2020-12-08 22:28:30 +0200
commit90783142d5e53e22fead18d736a64e54e05bcd82 (patch)
tree60fbf8ac439ab179d607e084d74a117d0f7ea747
parentc743f0c55518796912fb96126d6a262bf1edfa6e (diff)
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
-rwxr-xr-xjava/app.go5
-rw-r--r--java/app_test.go3
-rw-r--r--java/java.go26
-rw-r--r--java/sdk.go17
-rw-r--r--java/testing.go5
7 files changed, 58 insertions, 12 deletions
diff --git a/java/aar.go b/java/aar.go
index 8dd752f12..be988a1a1 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -193,7 +193,7 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext sdkContext,
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.
@@ -218,6 +218,9 @@ func (a *aapt) deps(ctx android.BottomUpMutatorContext, sdkDep sdkDep) {
if sdkDep.frameworkResModule != "" {
ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
}
+ if sdkDep.lineageResModule != "" {
+ ctx.AddDependency(ctx.Module(), lineageResTag, sdkDep.lineageResModule)
+ }
}
var extractAssetsRule = pctx.AndroidStaticRule("extractAssets",
@@ -388,7 +391,7 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati
sdkLibraries = append(sdkLibraries, component.OptionalImplicitSdkLibrary()...)
}
- case frameworkResTag:
+ case frameworkResTag, lineageResTag:
if exportPackage != nil {
sharedLibs = append(sharedLibs, exportPackage)
}
@@ -630,6 +633,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 bddb1812a..bb837abc4 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -336,7 +336,7 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries {
entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", app.proguardDictionary)
}
- if app.Name() == "framework-res" {
+ if app.Name() == "framework-res" || app.Name() == "org.lineageos.platform-res" {
entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)")
// Make base_rules.mk not put framework-res in a subdirectory called
// framework_res.
@@ -463,7 +463,7 @@ func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries {
entries.SetPath("LOCAL_SOONG_AAR", a.aarFile)
}
- if a.Name() == "framework-res" {
+ if a.Name() == "framework-res" || a.Name() == "org.lineageos.platform-res" {
entries.SetString("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 e75d8749f..a8a89f4e8 100755
--- a/java/app.go
+++ b/java/app.go
@@ -596,7 +596,7 @@ func (a *AndroidApp) dexBuildActions(ctx android.ModuleContext) android.Path {
a.dexpreopter.libraryPaths = a.usesLibrary.usesLibraryPaths(ctx)
a.dexpreopter.manifestFile = a.mergedManifestFile
- if ctx.ModuleName() != "framework-res" {
+ if ctx.ModuleName() != "framework-res" && ctx.ModuleName() != "org.lineageos.platform-res" {
a.Module.compile(ctx, a.aaptSrcJar)
}
@@ -742,6 +742,9 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
if ctx.ModuleName() == "framework-res" {
// framework-res.apk is installed as system/framework/framework-res.apk
a.installDir = android.PathForModuleInstall(ctx, "framework")
+ } else if ctx.ModuleName() == "org.lineageos.platform-res" {
+ // org.lineageos.platform-res.apk needs to be in system/framework
+ a.installDir = android.PathForModuleInstall(ctx, "framework")
} else if a.Privileged() {
a.installDir = android.PathForModuleInstall(ctx, "priv-app", a.installApkName)
} else if ctx.InstallInTestcases() {
diff --git a/java/app_test.go b/java/app_test.go
index 8ef315206..274e58472 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -84,8 +84,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 a55ded35f..d5f1ffd57 100644
--- a/java/java.go
+++ b/java/java.go
@@ -578,6 +578,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"}
@@ -610,6 +611,7 @@ type sdkDep struct {
java9Classpath []string
frameworkResModule string
+ lineageResModule string
jars android.Paths
aidl android.OptionalPath
@@ -704,11 +706,22 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules)
}
+ if ctx.ModuleName() == "framework" || ctx.ModuleName() == "framework-annotation-proc" {
+ 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")
+ }
}
syspropPublicStubs := syspropPublicStubs(ctx.Config())
@@ -1057,6 +1070,19 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
} else {
ctx.PropertyErrorf("exported_plugins", "%q is not a java_plugin module", otherName)
}
+ 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 f96ecded4..e84c9b555 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -373,13 +373,14 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext sdkContext) sdkDep
}
}
- toModule := func(modules []string, res string, aidl android.Path) sdkDep {
+ toModule := func(modules []string, res string, lineageRes string, aidl android.Path) sdkDep {
return sdkDep{
useModule: true,
bootclasspath: append(modules, config.DefaultLambdaStubsLibrary),
systemModules: "core-current-stubs-system-modules",
java9Classpath: modules,
frameworkResModule: res,
+ lineageResModule: lineageRes,
aidl: android.OptionalPathForPath(aidl),
}
}
@@ -404,6 +405,7 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext sdkContext) sdkDep
return sdkDep{
useDefaultLibs: true,
frameworkResModule: "framework-res",
+ lineageResModule: "org.lineageos.platform-res",
}
case sdkNone:
systemModules := sdkContext.systemModules()
@@ -426,22 +428,23 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext sdkContext) sdkDep
return sdkDep{
useDefaultLibs: true,
frameworkResModule: "framework-res",
+ lineageResModule: "org.lineageos.platform-res",
noFrameworksLibs: true,
}
case sdkPublic:
- return toModule([]string{"android_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx))
+ return toModule([]string{"android_stubs_current"}, "framework-res", "org.lineageos.platform-res", sdkFrameworkAidlPath(ctx))
case sdkSystem:
- return toModule([]string{"android_system_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx))
+ return toModule([]string{"android_system_stubs_current"}, "framework-res", "org.lineageos.platform-res", sdkFrameworkAidlPath(ctx))
case sdkTest:
- return toModule([]string{"android_test_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx))
+ return toModule([]string{"android_test_stubs_current"}, "framework-res", "org.lineageos.platform-res", sdkFrameworkAidlPath(ctx))
case sdkCore:
- return toModule([]string{"core.current.stubs"}, "", nil)
+ return toModule([]string{"core.current.stubs"}, "", "", nil)
case sdkModule:
// TODO(146757305): provide .apk and .aidl that have more APIs for modules
- return toModule([]string{"android_module_lib_stubs_current"}, "framework-res", nonUpdatableFrameworkAidlPath(ctx))
+ return toModule([]string{"android_module_lib_stubs_current"}, "framework-res", "org.lineageos.platform-res", nonUpdatableFrameworkAidlPath(ctx))
case sdkSystemServer:
// TODO(146757305): provide .apk and .aidl that have more APIs for modules
- return toModule([]string{"android_system_server_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx))
+ return toModule([]string{"android_system_server_stubs_current"}, "framework-res", "org.lineageos.platform-res", sdkFrameworkAidlPath(ctx))
default:
panic(fmt.Errorf("invalid sdk %q", sdkVersion.raw))
}
diff --git a/java/testing.go b/java/testing.go
index 48e449f34..a5606f0dc 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -152,6 +152,11 @@ func GatherRequiredDepsForTest() string {
sdk_version: "core_platform",
}
+ android_app {
+ name: "org.lineageos.platform-res",
+ sdk_version: "core_platform",
+ }
+
java_library {
name: "android.hidl.base-V1.0-java",
srcs: ["a.java"],