Skip to content

Commit

Permalink
Bug 935305 - Move preprocessor to mozbuild.action. r=gps
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 9, 2013
1 parent 9952bb8 commit e1187e9
Show file tree
Hide file tree
Showing 49 changed files with 361 additions and 1,089 deletions.
2 changes: 1 addition & 1 deletion b2g/installer/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif

ifdef MOZ_PKG_MANIFEST_P
$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) FORCE
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $< > $@
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
ifdef MOZ_CHROME_MULTILOCALE
printf "\n[multilocale]\n" >> $@
for LOCALE in $(MOZ_CHROME_MULTILOCALE) ;\
Expand Down
4 changes: 2 additions & 2 deletions b2g/locales/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ $(DIST)/branding:

libs::
@if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js > $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
$(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js -o $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
fi

NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
Expand Down
2 changes: 1 addition & 1 deletion browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ifndef LIBXUL_SDK
# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(ACDEFINES) $^ > $(DIST)/bin/defaults/pref/channel-prefs.js
$(call py_action,preprocessor,$(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
endif

libs:: $(srcdir)/blocklist.xml
Expand Down
2 changes: 1 addition & 1 deletion browser/installer/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ifdef MOZ_PKG_MANIFEST_P
MOZ_PKG_MANIFEST = package-manifest

$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $< > $@
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)

GARBAGE += $(MOZ_PKG_MANIFEST)
endif
Expand Down
12 changes: 6 additions & 6 deletions browser/installer/windows/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ uninstaller::
$(MKDIR) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
Expand All @@ -81,8 +81,8 @@ uninstaller::
ifdef MOZ_MAINTENANCE_SERVICE
maintenanceservice_installer::
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
Expand All @@ -93,8 +93,8 @@ $(CONFIG_DIR)/setup.exe::
$(MKDIR) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
Expand Down
5 changes: 2 additions & 3 deletions browser/locales/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ PROFILE_CHROME = userChrome-example.css userContent-example.css
NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))

%/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
$(SYSINSTALL) -D $(dir $@)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(call py_action,preprocessor, \
-I $< \
-DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
$(srcdir)/generic/profile/bookmarks.html.in \
> $@
-o $@)

libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;

Expand Down
2 changes: 1 addition & 1 deletion browser/metro/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
# 'application.ini' breaks firefox build config. So we use something different.
metroapp.ini: metroapp.ini.in $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt
$(RM) "metroapp.ini"
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $< > $@
$(call py_action,preprocessor,$(DEFINES) $< -o $@)

libs:: metroapp.ini
$(INSTALL) metroapp.ini $(FINAL_TARGET)
Expand Down
4 changes: 2 additions & 2 deletions browser/metro/locales/import/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ bookmarks-src = $(srcdir)/../generic/profile/bookmarks.json.in
# processing of the jar file in the parent directory.
bookmarks: bookmarks.inc
@echo "Generating: $@"
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(call py_action,preprocessor, \
-I $^ \
-DAB_CD=$(AB_CD) \
$(bookmarks-src) > ../bookmarks.json
$(bookmarks-src) -o ../bookmarks.json)

export:: bookmarks
2 changes: 1 addition & 1 deletion build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ _LEAKTEST_FILES = \
$(NULL)

leaktest.py: leaktest.py.in
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $^ > $@
$(call py_action,preprocessor,$^ -o $@)
chmod +x $@
GARBAGE += leaktest.py

Expand Down
4 changes: 2 additions & 2 deletions build/automation-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ AUTOMATION_PPARGS += -DIS_ASAN=0
endif

automation.py: $(MOZILLA_DIR)/build/automation.py.in $(MOZILLA_DIR)/build/automation-build.mk
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
$(call py_action,preprocessor, \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< -o $@)

GARBAGE += automation.py automation.pyc
2 changes: 1 addition & 1 deletion build/docs/preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Text Preprocessor

The build system contains a text preprocessor similar to the C preprocessor,
meant for processing files which have no built-in preprocessor such as XUL
and JavaScript documents. It is implemented at ``config/Preprocessor.py`` and
and JavaScript documents. It is implemented at ``python/mozbuild/mozbuild/preprocessor.py`` and
is typically invoked via :ref:`jar_manifests`.

While used to preprocess CSS files, the directives are changed to begin with
Expand Down
241 changes: 0 additions & 241 deletions config/Expression.py

This file was deleted.

2 changes: 1 addition & 1 deletion config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export-preqs = \
$(NULL)

export:: $(export-preqs)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
$(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
Expand Down
Loading

0 comments on commit e1187e9

Please sign in to comment.