Skip to content

Commit c6acba1

Browse files
author
Ricky Chien
committed
Bug 1131469 - Add RUN_ON_NODE switcher in Makefile
1 parent 2cbf5a7 commit c6acba1

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

Makefile

+15-9
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ ifdef LOCALES_FILE
7272
REBUILD=1
7373
endif
7474

75+
# Switching XPCShell/Node.js build runner
76+
BUILD_RUNNER=run-js-command
77+
ifeq ($(RUN_ON_NODE), 1)
78+
BUILD_RUNNER=run-node-command
79+
endif
80+
7581
-include local.mk
7682

7783
# Headless bot does not need the full output of wget
@@ -562,11 +568,11 @@ LANG=POSIX # Avoiding sort order differences between OSes
562568

563569
.PHONY: app
564570
app: b2g_sdk profile-dir
565-
@$(call run-js-command,app)
571+
@$(call $(BUILD_RUNNER),app)
566572

567573
.PHONY: pre-app
568574
pre-app: b2g_sdk profile-dir
569-
@$(call run-js-command,pre-app)
575+
@$(call $(BUILD_RUNNER),pre-app)
570576

571577
# Keep old targets just for people/scripts still using it
572578
.PHONY: post-manifest
@@ -584,7 +590,7 @@ webapp-zip: app
584590
# Get additional extensions
585591
$(STAGE_DIR)/additional-extensions/downloaded.json: build/config/additional-extensions.json $(wildcard .build/config/custom-extensions.json)
586592
ifeq ($(DESKTOP),1)
587-
@$(call run-js-command,additional-extensions)
593+
@$(call $(BUILD_RUNNER),additional-extensions)
588594
endif
589595

590596
profile-dir:
@@ -671,7 +677,7 @@ endif # USE_LOCAL_XULRUNNER_SDK
671677

672678
# Generate profile/prefs.js
673679
preferences: profile-dir b2g_sdk
674-
@$(call run-js-command,preferences)
680+
@$(call $(BUILD_RUNNER),preferences)
675681

676682
# Generate profile/settings.json
677683
settings: pre-app
@@ -933,10 +939,10 @@ hint: node_modules/.bin/jshint
933939
@./node_modules/.bin/jshint $(JSHINT_ARGS) $(JSHINTED_PATH) $(LINTED_FILES) || (echo Please consult https://github.com/mozilla-b2g/gaia/tree/master/build/jshint/README.md to get some information about how to fix jshint issues. && exit 1)
934940

935941
csslint: b2g_sdk
936-
@$(call run-js-command,csslint)
942+
@$(call $(BUILD_RUNNER),csslint)
937943

938944
jsonlint: b2g_sdk
939-
@$(call run-js-command,jsonlint)
945+
@$(call $(BUILD_RUNNER),jsonlint)
940946

941947
# Erase all the indexedDB databases on the phone, so apps have to rebuild them.
942948
delete-databases:
@@ -974,7 +980,7 @@ install-gaia: $(PROFILE_FOLDER) push
974980
# push target to update the gaia files and reboot b2g
975981
.PHONY: push
976982
push: b2g_sdk
977-
@$(call run-js-command,push-to-device)
983+
@$(call $(BUILD_RUNNER),push-to-device)
978984

979985
# Copy demo media to the sdcard.
980986
# If we've got old style directories on the phone, rename them first.
@@ -1045,10 +1051,10 @@ really-clean: clean
10451051
test -d .git && cp tools/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit || true
10461052

10471053
build-test-unit: b2g_sdk $(NPM_INSTALLED_PROGRAMS)
1048-
@$(call run-js-command,build-test,TEST_TYPE=unit REPORTER=$(REPORTER) TRY_ENV=$(TRY_ENV) TEST_FILES="$(TEST_FILES)")
1054+
@$(call $(BUILD_RUNNER),build-test,TEST_TYPE=unit REPORTER=$(REPORTER) TRY_ENV=$(TRY_ENV) TEST_FILES="$(TEST_FILES)")
10491055

10501056
build-test-integration: b2g_sdk $(NPM_INSTALLED_PROGRAMS)
1051-
@$(call run-js-command,build-test,TEST_TYPE=integration REPORTER=$(REPORTER) TRY_ENV=$(TRY_ENV) TEST_FILES="$(TEST_FILES)")
1057+
@$(call $(BUILD_RUNNER),build-test,TEST_TYPE=integration REPORTER=$(REPORTER) TRY_ENV=$(TRY_ENV) TEST_FILES="$(TEST_FILES)")
10521058

10531059
build-test-unit-coverage: $(NPM_INSTALLED_PROGRAMS)
10541060
@$(call run-build-coverage,build/test/unit)

0 commit comments

Comments
 (0)