aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrice Arruda2019-05-15 20:21:32 -0500
committerPatrice Arruda2019-05-16 12:48:32 -0500
commitd1f45c89675b8f11c42d1c3a43dabc06ed755c96 (patch)
tree304eb09a2bb34d8b18fc4b4566857bd2663a0c53
parente40da8cff61c2bd5d70c4d9f2f517e29f4d296ba (diff)
downloadplatform-build-soong-d1f45c89675b8f11c42d1c3a43dabc06ed755c96.tar.gz
platform-build-soong-d1f45c89675b8f11c42d1c3a43dabc06ed755c96.tar.xz
platform-build-soong-d1f45c89675b8f11c42d1c3a43dabc06ed755c96.zip
Soong: Add mk2bp conversion for prebuilt_font.
There are a couple of makefiles that have etc with $(TARGET_OUT)/fonts and $(TARGET_OUT_PRODUCT)/fonts as the local module path. Added the conversion in androidmk for target. bug: b/123403785 Test: Wrote and ran unit test cases, did a test conversion on * platform/external/google-fonts/dancing-script/Android.mk * internal/external/google-fonts/arbutus-fonts/Android.mk Change-Id: Id67e10f80b32b27c5027cd274a7944801dad0880
-rw-r--r--androidmk/cmd/androidmk/androidmk_test.go39
-rw-r--r--bpfix/bpfix/bpfix.go4
2 files changed, 41 insertions, 2 deletions
diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go
index 88c5304e..3ec5f2e0 100644
--- a/androidmk/cmd/androidmk/androidmk_test.go
+++ b/androidmk/cmd/androidmk/androidmk_test.go
@@ -1119,6 +1119,45 @@ prebuilt_usr_share_host {
1119`, 1119`,
1120 }, 1120 },
1121 { 1121 {
1122 desc: "prebuilt_font",
1123 in: `
1124include $(CLEAR_VARS)
1125LOCAL_MODULE := font.ttf
1126LOCAL_SRC_FILES := $(LOCAL_MODULE)
1127LOCAL_MODULE_CLASS := ETC
1128LOCAL_MODULE_TAGS := optional
1129LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
1130include $(BUILD_PREBUILT)
1131`,
1132 expected: `
1133prebuilt_font {
1134 name: "font.ttf",
1135 src: "font.ttf",
1136
1137}
1138`,
1139 },
1140 {
1141 desc: "prebuilt_font",
1142 in: `
1143include $(CLEAR_VARS)
1144LOCAL_MODULE := font.ttf
1145LOCAL_SRC_FILES := $(LOCAL_MODULE)
1146LOCAL_MODULE_CLASS := ETC
1147LOCAL_MODULE_TAGS := optional
1148LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/fonts
1149include $(BUILD_PREBUILT)
1150`,
1151 expected: `
1152prebuilt_font {
1153 name: "font.ttf",
1154 src: "font.ttf",
1155 product_specific: true,
1156
1157}
1158`,
1159 },
1160 {
1122 desc: "prebuilt_usr_share_host subdir_bar", 1161 desc: "prebuilt_usr_share_host subdir_bar",
1123 in: ` 1162 in: `
1124include $(CLEAR_VARS) 1163include $(CLEAR_VARS)
diff --git a/bpfix/bpfix/bpfix.go b/bpfix/bpfix/bpfix.go
index f217da6a..c8981965 100644
--- a/bpfix/bpfix/bpfix.go
+++ b/bpfix/bpfix/bpfix.go
@@ -501,9 +501,9 @@ func (f etcPrebuiltModuleUpdate) update(m *parser.Module, path string) bool {
501var localModuleUpdate = map[string][]etcPrebuiltModuleUpdate{ 501var localModuleUpdate = map[string][]etcPrebuiltModuleUpdate{
502 "HOST_OUT": {{prefix: "/etc", modType: "prebuilt_etc_host"}, {prefix: "/usr/share", modType: "prebuilt_usr_share_host"}}, 502 "HOST_OUT": {{prefix: "/etc", modType: "prebuilt_etc_host"}, {prefix: "/usr/share", modType: "prebuilt_usr_share_host"}},
503 "PRODUCT_OUT": {{prefix: "/system/etc"}, {prefix: "/vendor/etc", flags: []string{"proprietary"}}}, 503 "PRODUCT_OUT": {{prefix: "/system/etc"}, {prefix: "/vendor/etc", flags: []string{"proprietary"}}},
504 "TARGET_OUT": {{prefix: "/etc"}, {prefix: "/usr/share", modType: "prebuilt_usr_share"}}, 504 "TARGET_OUT": {{prefix: "/etc"}, {prefix: "/usr/share", modType: "prebuilt_usr_share"}, {prefix: "/fonts", modType: "prebuilt_font"}},
505 "TARGET_OUT_ETC": {{prefix: ""}}, 505 "TARGET_OUT_ETC": {{prefix: ""}},
506 "TARGET_OUT_PRODUCT": {{prefix: "/etc", flags: []string{"product_specific"}}}, 506 "TARGET_OUT_PRODUCT": {{prefix: "/etc", flags: []string{"product_specific"}}, {prefix: "/fonts", modType: "prebuilt_font", flags: []string{"product_specific"}}},
507 "TARGET_OUT_PRODUCT_ETC": {{prefix: "", flags: []string{"product_specific"}}}, 507 "TARGET_OUT_PRODUCT_ETC": {{prefix: "", flags: []string{"product_specific"}}},
508 "TARGET_OUT_ODM": {{prefix: "/etc", flags: []string{"device_specific"}}}, 508 "TARGET_OUT_ODM": {{prefix: "/etc", flags: []string{"device_specific"}}},
509 "TARGET_OUT_PRODUCT_SERVICES": {{prefix: "/etc", flags: []string{"product_services_specific"}}}, 509 "TARGET_OUT_PRODUCT_SERVICES": {{prefix: "/etc", flags: []string{"product_services_specific"}}},