Merge "[Ravenwood] Support fonts files and data files" into main am: e372d287c0
am: 004b8fa8fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3268351 Change-Id: Ie4477423aaa9ef38c9995b0fcbc6f3c08b3cb854 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -33,7 +33,6 @@ func RegisterRavenwoodBuildComponents(ctx android.RegistrationContext) {
|
|||||||
var ravenwoodLibContentTag = dependencyTag{name: "ravenwoodlibcontent"}
|
var ravenwoodLibContentTag = dependencyTag{name: "ravenwoodlibcontent"}
|
||||||
var ravenwoodUtilsTag = dependencyTag{name: "ravenwoodutils"}
|
var ravenwoodUtilsTag = dependencyTag{name: "ravenwoodutils"}
|
||||||
var ravenwoodRuntimeTag = dependencyTag{name: "ravenwoodruntime"}
|
var ravenwoodRuntimeTag = dependencyTag{name: "ravenwoodruntime"}
|
||||||
var ravenwoodDataTag = dependencyTag{name: "ravenwooddata"}
|
|
||||||
var ravenwoodTestResourceApkTag = dependencyTag{name: "ravenwoodtestresapk"}
|
var ravenwoodTestResourceApkTag = dependencyTag{name: "ravenwoodtestresapk"}
|
||||||
|
|
||||||
const ravenwoodUtilsName = "ravenwood-utils"
|
const ravenwoodUtilsName = "ravenwood-utils"
|
||||||
@@ -228,7 +227,10 @@ type ravenwoodLibgroupProperties struct {
|
|||||||
Jni_libs []string
|
Jni_libs []string
|
||||||
|
|
||||||
// We use this to copy framework-res.apk to the ravenwood runtime directory.
|
// We use this to copy framework-res.apk to the ravenwood runtime directory.
|
||||||
Data []string
|
Data []string `android:"path,arch_variant"`
|
||||||
|
|
||||||
|
// We use this to copy font files to the ravenwood runtime directory.
|
||||||
|
Fonts []string `android:"path,arch_variant"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ravenwoodLibgroup struct {
|
type ravenwoodLibgroup struct {
|
||||||
@@ -267,9 +269,6 @@ func (r *ravenwoodLibgroup) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
for _, lib := range r.ravenwoodLibgroupProperties.Jni_libs {
|
for _, lib := range r.ravenwoodLibgroupProperties.Jni_libs {
|
||||||
ctx.AddVariationDependencies(ctx.Config().BuildOSTarget.Variations(), jniLibTag, lib)
|
ctx.AddVariationDependencies(ctx.Config().BuildOSTarget.Variations(), jniLibTag, lib)
|
||||||
}
|
}
|
||||||
for _, data := range r.ravenwoodLibgroupProperties.Data {
|
|
||||||
ctx.AddVariationDependencies(nil, ravenwoodDataTag, data)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
@@ -309,12 +308,17 @@ func (r *ravenwoodLibgroup) GenerateAndroidBuildActions(ctx android.ModuleContex
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataInstallPath := installPath.Join(ctx, "ravenwood-data")
|
dataInstallPath := installPath.Join(ctx, "ravenwood-data")
|
||||||
for _, data := range r.ravenwoodLibgroupProperties.Data {
|
data := android.PathsForModuleSrc(ctx, r.ravenwoodLibgroupProperties.Data)
|
||||||
libModule := ctx.GetDirectDepWithTag(data, ravenwoodDataTag)
|
for _, file := range data {
|
||||||
file := android.OutputFileForModule(ctx, libModule, "")
|
|
||||||
ctx.InstallFile(dataInstallPath, file.Base(), file)
|
ctx.InstallFile(dataInstallPath, file.Base(), file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fontsInstallPath := installPath.Join(ctx, "fonts")
|
||||||
|
fonts := android.PathsForModuleSrc(ctx, r.ravenwoodLibgroupProperties.Fonts)
|
||||||
|
for _, file := range fonts {
|
||||||
|
ctx.InstallFile(fontsInstallPath, file.Base(), file)
|
||||||
|
}
|
||||||
|
|
||||||
// Normal build should perform install steps
|
// Normal build should perform install steps
|
||||||
ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install"))
|
ctx.Phony(r.BaseModuleName(), android.PathForPhony(ctx, r.BaseModuleName()+"-install"))
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
|
"android/soong/etc"
|
||||||
)
|
)
|
||||||
|
|
||||||
var prepareRavenwoodRuntime = android.GroupFixturePreparers(
|
var prepareRavenwoodRuntime = android.GroupFixturePreparers(
|
||||||
@@ -65,6 +66,10 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers(
|
|||||||
name: "app2",
|
name: "app2",
|
||||||
sdk_version: "current",
|
sdk_version: "current",
|
||||||
}
|
}
|
||||||
|
prebuilt_font {
|
||||||
|
name: "Font.ttf",
|
||||||
|
src: "Font.ttf",
|
||||||
|
}
|
||||||
android_ravenwood_libgroup {
|
android_ravenwood_libgroup {
|
||||||
name: "ravenwood-runtime",
|
name: "ravenwood-runtime",
|
||||||
libs: [
|
libs: [
|
||||||
@@ -76,7 +81,10 @@ var prepareRavenwoodRuntime = android.GroupFixturePreparers(
|
|||||||
"ravenwood-runtime-jni2",
|
"ravenwood-runtime-jni2",
|
||||||
],
|
],
|
||||||
data: [
|
data: [
|
||||||
"app1",
|
":app1",
|
||||||
|
],
|
||||||
|
fonts: [
|
||||||
|
":Font.ttf"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
android_ravenwood_libgroup {
|
android_ravenwood_libgroup {
|
||||||
@@ -97,6 +105,7 @@ func TestRavenwoodRuntime(t *testing.T) {
|
|||||||
|
|
||||||
ctx := android.GroupFixturePreparers(
|
ctx := android.GroupFixturePreparers(
|
||||||
PrepareForIntegrationTestWithJava,
|
PrepareForIntegrationTestWithJava,
|
||||||
|
etc.PrepareForTestWithPrebuiltEtc,
|
||||||
prepareRavenwoodRuntime,
|
prepareRavenwoodRuntime,
|
||||||
).RunTest(t)
|
).RunTest(t)
|
||||||
|
|
||||||
@@ -114,6 +123,7 @@ func TestRavenwoodRuntime(t *testing.T) {
|
|||||||
runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/libred.so")
|
runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/libred.so")
|
||||||
runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/ravenwood-runtime-jni3.so")
|
runtime.Output(installPathPrefix + "/ravenwood-runtime/lib64/ravenwood-runtime-jni3.so")
|
||||||
runtime.Output(installPathPrefix + "/ravenwood-runtime/ravenwood-data/app1.apk")
|
runtime.Output(installPathPrefix + "/ravenwood-runtime/ravenwood-data/app1.apk")
|
||||||
|
runtime.Output(installPathPrefix + "/ravenwood-runtime/fonts/Font.ttf")
|
||||||
utils := ctx.ModuleForTests("ravenwood-utils", "android_common")
|
utils := ctx.ModuleForTests("ravenwood-utils", "android_common")
|
||||||
utils.Output(installPathPrefix + "/ravenwood-utils/framework-rules.ravenwood.jar")
|
utils.Output(installPathPrefix + "/ravenwood-utils/framework-rules.ravenwood.jar")
|
||||||
}
|
}
|
||||||
@@ -125,6 +135,7 @@ func TestRavenwoodTest(t *testing.T) {
|
|||||||
|
|
||||||
ctx := android.GroupFixturePreparers(
|
ctx := android.GroupFixturePreparers(
|
||||||
PrepareForIntegrationTestWithJava,
|
PrepareForIntegrationTestWithJava,
|
||||||
|
etc.PrepareForTestWithPrebuiltEtc,
|
||||||
prepareRavenwoodRuntime,
|
prepareRavenwoodRuntime,
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
cc_library_shared {
|
cc_library_shared {
|
||||||
|
Reference in New Issue
Block a user