Merge "Build fontchain_lint using python_binary_host" am: 7ecac139ea
am: 7ade558ad2
Change-Id: Ie920005b39a476b281333b12fbed9e586a2ce3e7
diff --git a/Android.bp b/Android.bp
index 7d75f62..1f4c59a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -102,3 +102,29 @@
dxflags: ["--core-library"],
installable: false,
}
+
+python_defaults {
+ name: "base_default",
+ version: {
+ py2: {
+ enabled: true,
+ embedded_launcher: true,
+ },
+ py3: {
+ enabled: false,
+ embedded_launcher: false,
+ },
+ },
+}
+
+python_binary_host {
+ name: "fontchain_linter",
+ defaults: ["base_default"],
+ main: "tools/fonts/fontchain_linter.py",
+ srcs: [
+ "tools/fonts/fontchain_linter.py",
+ ],
+ libs: [
+ "fontTools",
+ ],
+}
diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk
index 7b2fa76..81164d5 100644
--- a/data/fonts/Android.mk
+++ b/data/fonts/Android.mk
@@ -112,7 +112,7 @@
# Run sanity tests on fonts on checkbuild
checkbuild: fontchain_lint
-FONTCHAIN_LINTER := frameworks/base/tools/fonts/fontchain_lint.py
+FONTCHAIN_LINTER := $(HOST_OUT_EXECUTABLES)/fontchain_linter
ifeq ($(MINIMAL_FONT_FOOTPRINT),true)
CHECK_EMOJI := false
else
@@ -121,5 +121,4 @@
.PHONY: fontchain_lint
fontchain_lint: $(FONTCHAIN_LINTER) $(TARGET_OUT)/etc/fonts.xml $(PRODUCT_OUT)/system.img
- PYTHONPATH=$$PYTHONPATH:external/fonttools/Lib \
- python $(FONTCHAIN_LINTER) $(TARGET_OUT) $(CHECK_EMOJI) external/unicode
+ $(FONTCHAIN_LINTER) $(TARGET_OUT) $(CHECK_EMOJI) external/unicode
diff --git a/tools/fonts/fontchain_lint.py b/tools/fonts/fontchain_linter.py
similarity index 100%
rename from tools/fonts/fontchain_lint.py
rename to tools/fonts/fontchain_linter.py