From bee18ba6c2817dfd0c56f568c7c26dc89198723c Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Thu, 11 Jul 2013 13:42:26 -0700 Subject: [PATCH] Bug 891474 - Establish unified directory for Python build actions; r=glandium, ted --HG-- rename : config/purge_directories.py => python/mozbuild/mozbuild/action/purge_manifests.py rename : build/xpccheck.py => python/mozbuild/mozbuild/action/xpccheck.py extra : rebase_source : 46bc960aa62c1117a7bf215653b768dc78b48d9a --- Makefile.in | 2 +- config/config.mk | 8 ++++++++ config/makefiles/xpcshell.mk | 4 +--- js/src/config/config.mk | 8 ++++++++ js/src/config/makefiles/xpcshell.mk | 4 +--- python/mozbuild/mozbuild/action/__init__.py | 0 .../mozbuild/mozbuild/action/purge_manifests.py | 0 {build => python/mozbuild/mozbuild/action}/xpccheck.py | 0 8 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 python/mozbuild/mozbuild/action/__init__.py rename config/purge_directories.py => python/mozbuild/mozbuild/action/purge_manifests.py (100%) rename {build => python/mozbuild/mozbuild/action}/xpccheck.py (100%) diff --git a/Makefile.in b/Makefile.in index b3a4c6312bc..dc53fbb7002 100644 --- a/Makefile.in +++ b/Makefile.in @@ -60,7 +60,7 @@ ifndef MOZ_PROFILE_USE # We need to explicitly put backend.RecursiveMakeBackend.built here # otherwise the rule in rules.mk doesn't run early enough. default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built - $(PYTHON) $(topsrcdir)/config/purge_directories.py -d _build_manifests/purge . + $(call py_action,purge_manifests,-d _build_manifests/purge .) endif CLOBBER: $(topsrcdir)/CLOBBER diff --git a/config/config.mk b/config/config.mk index 389b8077809..73214ce355e 100644 --- a/config/config.mk +++ b/config/config.mk @@ -813,3 +813,11 @@ MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS) endif DEFINES += -DNO_NSPR_10_SUPPORT + +# Run a named Python build action. The first argument is the name of the build +# action. The second argument are the arguments to pass to the action (space +# delimited arguments). e.g. +# +# libs:: +# $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest) +py_action = $(PYTHON) -m mozbuild.action.$(1) $(2) diff --git a/config/makefiles/xpcshell.mk b/config/makefiles/xpcshell.mk index 0af8caff757..0a49e2c1c9d 100644 --- a/config/makefiles/xpcshell.mk +++ b/config/makefiles/xpcshell.mk @@ -29,9 +29,7 @@ libs:: libs-xpcshell-tests libs-xpcshell-tests: $(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS)) ifndef NO_XPCSHELL_MANIFEST_CHECK #{ - $(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \ - $(topsrcdir) \ - $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)) + $(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))) endif #} NO_XPCSHELL_MANIFEST_CHECK ########################################################################### diff --git a/js/src/config/config.mk b/js/src/config/config.mk index 389b8077809..73214ce355e 100644 --- a/js/src/config/config.mk +++ b/js/src/config/config.mk @@ -813,3 +813,11 @@ MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS) endif DEFINES += -DNO_NSPR_10_SUPPORT + +# Run a named Python build action. The first argument is the name of the build +# action. The second argument are the arguments to pass to the action (space +# delimited arguments). e.g. +# +# libs:: +# $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest) +py_action = $(PYTHON) -m mozbuild.action.$(1) $(2) diff --git a/js/src/config/makefiles/xpcshell.mk b/js/src/config/makefiles/xpcshell.mk index 0af8caff757..0a49e2c1c9d 100644 --- a/js/src/config/makefiles/xpcshell.mk +++ b/js/src/config/makefiles/xpcshell.mk @@ -29,9 +29,7 @@ libs:: libs-xpcshell-tests libs-xpcshell-tests: $(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS)) ifndef NO_XPCSHELL_MANIFEST_CHECK #{ - $(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \ - $(topsrcdir) \ - $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)) + $(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))) endif #} NO_XPCSHELL_MANIFEST_CHECK ########################################################################### diff --git a/python/mozbuild/mozbuild/action/__init__.py b/python/mozbuild/mozbuild/action/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/config/purge_directories.py b/python/mozbuild/mozbuild/action/purge_manifests.py similarity index 100% rename from config/purge_directories.py rename to python/mozbuild/mozbuild/action/purge_manifests.py diff --git a/build/xpccheck.py b/python/mozbuild/mozbuild/action/xpccheck.py similarity index 100% rename from build/xpccheck.py rename to python/mozbuild/mozbuild/action/xpccheck.py