[Pkg-mozext-commits] [requestpolicy] 45/80: new Make target: create XPI from tree-ish
David Prévot
taffit at moszumanska.debian.org
Sun Jul 5 15:02:28 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository requestpolicy.
commit b8f6b37c1e063b86037494737a4d43485a1476ad
Author: Martin Kimmerle <dev at 256k.de>
Date: Tue Jun 9 11:22:19 2015 +0200
new Make target: create XPI from tree-ish
This new Make target can create an XPI from any tree-ish (tag or
commit) without changing the working directory. It uses git's
`archive` command.
---
Makefile | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/Makefile b/Makefile
index 6071ae8..b8502c7 100644
--- a/Makefile
+++ b/Makefile
@@ -286,6 +286,36 @@ dev-helper-xpi $(dev_helper__xpi_file): $(dev_helper__source_files) FORCE | $(di
$(ZIP) $(abspath $(dev_helper__xpi_file)) $(patsubst $(dev_helper__source_path)%,%,$(dev_helper__source_files))
@echo "Creating 'RPC Dev Helper' XPI: Done!"
+# _________________________________________
+# create the XPI from any tag or any commit
+#
+
+# Default tree-ish.
+specific_xpi__treeish := v1.0.beta9.3
+
+specific_xpi__file := $(dist_path)$(extension_name)-$(specific_xpi__treeish).xpi
+specific_xpi__build_path := $(build_dirname)/specific-xpi
+
+# create the XPI only if it doesn't exist yet
+.PHONY: specific-xpi
+specific-xpi: $(specific_xpi__file)
+
+$(specific_xpi__file):
+ @# remove the build directory (if it exists) and recreate it
+ rm -rf $(specific_xpi__build_path)
+ mkdir -p $(specific_xpi__build_path)
+
+ @# copy the content of the tree-ish to the build dir
+ @# see https://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export/9416271#9416271
+ git archive $(specific_xpi__treeish) | (cd $(specific_xpi__build_path); tar x)
+
+ @# run `make` in the build directory
+ (cd $(specific_xpi__build_path); make)
+
+ @# move the created XPI from the build directory to the actual
+ @# dist directory
+ mv $(specific_xpi__build_path)/dist/*.xpi $(specific_xpi__file)
+
# ______________________________________
# create the files for the "off-AMO" XPI
#
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git
More information about the Pkg-mozext-commits
mailing list