1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-23 15:13:32 +01:00

Bake hg version into install.rdf on XPI build. Warn users who are running in a testing branch.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-07 19:54:42 -05:00
parent ee03cbd2ce
commit e9a18c1a5a
5 changed files with 48 additions and 14 deletions

View File

@@ -32,7 +32,7 @@ CHROME = $(MANGLE)/
JAR = $(CHROME)$(NAME).jar
XPI_BASES = $(JAR_BASES) $(TOP)/..
XPI_FILES = bootstrap.js install.rdf TODO AUTHORS Donors NEWS LICENSE.txt
XPI_FILES = bootstrap.js TODO AUTHORS Donors NEWS LICENSE.txt
XPI_DIRS = components $(MANGLE) defaults
XPI_TEXTS = js jsm $(JAR_TEXTS)
XPI_BINS = $(JAR_BINS)
@@ -49,6 +49,9 @@ BUILD_DIR = build.$(VERSION).$(OS)
AWK ?= awk
B64ENCODE ?= base64
CURL ?= curl
SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \
then echo sed -E; else echo sed -r; \
fi)
.SILENT:
@@ -174,11 +177,19 @@ test: xpi
xpi: $(CHROME)
@echo "Building XPI..."
mkdir -p "$(XPI_PATH)"
$(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \
-f $(BASE)/process_manifest.awk \
$(TOP)/chrome.manifest >"$(XPI_PATH)/chrome.manifest"
"$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest"
version="$(VERSION)"; \
hg root >/dev/null 2>&1 && \
case "$$version" in \
*pre) version="$$version-hg$$(hg log -r . --template '{rev}')-$$(hg branch)";; \
esac; \
$(SED) -e 's/(em:version(>|="))([^"<]+)/\1'"$$version/" \
<"$(TOP)/install.rdf" >"$(XPI_PATH)/install.rdf"
$(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)"
rm -r -- $(CHROME)
@echo "Built XPI: $(XPI)"