Skip to content
Snippets Groups Projects
Commit 055e6a78 authored by Michael Vines's avatar Michael Vines
Browse files

Enable minification of Gecko chrome javscript files

Bug-Refs: 903149
Change-Id: Ic524a303b5a90dae01f7181dc472f84b84baf813
parent c40ece74
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,37 @@ CLEAR_XPCOM_VARS:=$(dir $(firstword $(MAKEFILE_LIST)))clear_xpcom_vars.mk
BUILD_XPCOM:=$(dir $(firstword $(MAKEFILE_LIST)))xpcom.mk
# Define JS_BINARY to enable minification of Gecko chrome javscript files
#
# JS_BINARY is used by the Gecko build system to verify that minified chrome
# Javscript code is still correct. Unfortunately the normal "js binary" is not
# a part of the source tree and it would be undesirable to add it as a
# dependency. This block instead adapts the xpcshell Javscript runtime, used by
# build Gaia, for this purpose.
#
export JS_BINARY=$(abspath out/js_binary.sh)
ifeq ($(wildcard $(JS_BINARY)),)
XPCSHELL=$(shell $(MAKE) -s -C gaia xpcshell_sdk)
ifeq ($(wildcard $(XPCSHELL)),)
$(error Unabled to find xpcshell. Best guess: $(XPCSHELL))
endif
RUN_MOZILLA=$(dir $(XPCSHELL))run-mozilla.sh
ifeq ($(wildcard $(RUN_MOZILLA)),)
$(error Unabled to find run-mozilla.sh. Best guess: $(RUN_MOZILLA))
endif
# This specialized JS_BINARY is expected to receive three arguments:
# 1 - Validation script
# 2 - Javacript file 1
# 3 - Javacript file 2
$(shell mkdir -p $(dir $(JS_BINARY)))
$(shell echo '#!/bin/bash' >> $(JS_BINARY))
$(shell echo 'exec $(RUN_MOZILLA) $(XPCSHELL) -e "scriptArgs=[$$2, $$3];" -f $$1' >> $(JS_BINARY))
$(shell chmod +x $(JS_BINARY))
endif
# GAIA_DISTRIBUTION_DIR enables overrides for Gaia settings
ifndef GAIA_DISTRIBUTION_DIR
GAIA_DISTRIBUTION_DIR:=$(ANDROID_BUILD_TOP)/out/target/product/$(TARGET_PRODUCT)/gaia_distribution
......
......@@ -312,6 +312,19 @@ rungdb()
( cd $(gettop)/device/qcom/b2g_common && ./run-gdb.sh $@ )
}
# Use a local B2G SDK if possible instead of downloading it
if [[ -d prebuilts/b2g_sdk/$(uname)/.git ]]; then
export USE_LOCAL_XULRUNNER_SDK=1
export XULRUNNER_DIRECTORY="$(gettop)/prebuilts/b2g_sdk/$(uname)"
else
echo =================================================================
echo Notice: Local B2G SDK was not found, fetching it now if necessary
echo =================================================================
make -s -C gaia b2g_sdk
fi
if [[ -z $1 ]]; then
__patch_tree
else
......@@ -323,12 +336,6 @@ else
esac
fi
# Use a local B2G SDK if present instead of downloading a new copy
if [[ -d prebuilts/b2g_sdk/$(uname)/.git ]]; then
export USE_LOCAL_XULRUNNER_SDK=1
export XULRUNNER_DIRECTORY="$(gettop)/prebuilts/b2g_sdk/$(uname)"
fi
# Don't build sources.xml
export DISABLE_SOURCES_XML=true
export LEGACY_USE_JAVA6=true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment