[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [https-everywhere/master 2/3] propose new build process
Author: Daniel Kahn Gillmor <dkg@xxxxxxxxxxxxxxxxx>
Date: Wed, 3 Nov 2010 11:44:11 -0400
Subject: propose new build process
Commit: 973bf50b2fad19b68caa5472f78b93d8b7be6ea1
---
.gitignore | 1 +
Makefile | 12 ++++++++++++
makexpi.sh | 51 +++++++++++++++++++++++++++------------------------
3 files changed, 40 insertions(+), 24 deletions(-)
create mode 100644 .gitignore
create mode 100644 Makefile
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..15af1aa
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.xpi
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2f8f054
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+# this rule makes tag or branch targets
+%:
+ ./makexpi.sh $@
+# this makes prerelease xpis (and is the default rule)
+prerelease:
+ ./makexpi.sh
+clean:
+ rm -f *.xpi
+
+.PHONY: clean prerelease
diff --git a/makexpi.sh b/makexpi.sh
index b011c69..b96f8a2 100755
--- a/makexpi.sh
+++ b/makexpi.sh
@@ -1,30 +1,33 @@
#!/bin/sh
APP_NAME=https-everywhere
-VERSION=`grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3`
-XPI_NAME=$APP_NAME-$VERSION.xpi
-if [ -e "pkg/$XPI_NAME" ]; then
- echo pkg/$XPI_NAME already exists.
- rm pkg/$XPI_NAME # meh.
- # exit 1
-fi
+# builds a .xpi from the git repository, placing the .xpi in the root
+# of the repository.
+
+# invoke with no arguments to pull a prerelease of the current
+# development point.
+
+# invoke with a tag name to build a specific branch.
-# create jar file (we're just storing files here)
-echo ---------- create $APP_NAME.jar file ----------
-cd src/chrome
-#zip -r0 ../../$APP_NAME.jar ./ -x "*.svn/*"
-cd ../..
+# e.g.:
+# ./makexpi.sh 0.2.3.development.2
-# create .xpi
-echo ---------- create $APP_NAME.xpi ----------
-cd src
-echo zip -X -9r ../pkg/$XPI_NAME ./ -x "certDialogsOverride.js" -x "chrome/*" -x "*.diff" -x "*.svn/*" -x ".*.sw?"
-zip -X -9r ../pkg/$XPI_NAME ./ -x "*.svn/*" -x "*.diff" -x "*.swp" #-x "chrome/*"
-#mv ../$APP_NAME.jar ./chrome
-#zip -9m ../pkg/$XPI_NAME chrome/$APP_NAME.jar
-cd ..
+# or just:
+# ./makexpi.sh
-#cp ./pkg/$XPI_NAME ~/
-#zip -9m ../../downloads/$sXpiName chrome/$APP_NAME.jar
-#zip -9 ../../downloads/$sXpiName install.rdf
-#cd ..
+if [ "$1" ] ; then
+ VERSION="$1"
+ TARG="$1"
+else
+ VERSION="$(grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3)~pre"
+ TARG=HEAD
+fi
+XPI_NAME="$APP_NAME-$VERSION.xpi"
+
+cd "$(dirname $0)/src"
+git archive --format=zip -9 "$TARG" . > "../$XPI_NAME"
+ret="$?"
+if [ "$ret" != 0 ]; then
+ rm -f "../$XPI_NAME"
+ exit "$?"
+fi
--
1.7.1