Skip to content

Commit

Permalink
propose new build process
Browse files Browse the repository at this point in the history
  • Loading branch information
dkg authored and pde committed Nov 3, 2010
1 parent 9feb45f commit 973bf50
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.xpi
12 changes: 12 additions & 0 deletions 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
51 changes: 27 additions & 24 deletions 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

0 comments on commit 973bf50

Please sign in to comment.