Skip to content

Commit 973bf50

Browse files
dkgpde
authored andcommitted
propose new build process
1 parent 9feb45f commit 973bf50

File tree

3 files changed

+40
-24
lines changed

3 files changed

+40
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.xpi

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/make -f
2+
3+
# this rule makes tag or branch targets
4+
%:
5+
./makexpi.sh $@
6+
# this makes prerelease xpis (and is the default rule)
7+
prerelease:
8+
./makexpi.sh
9+
clean:
10+
rm -f *.xpi
11+
12+
.PHONY: clean prerelease

makexpi.sh

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
#!/bin/sh
22
APP_NAME=https-everywhere
3-
VERSION=`grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3`
4-
XPI_NAME=$APP_NAME-$VERSION.xpi
53

6-
if [ -e "pkg/$XPI_NAME" ]; then
7-
echo pkg/$XPI_NAME already exists.
8-
rm pkg/$XPI_NAME # meh.
9-
# exit 1
10-
fi
4+
# builds a .xpi from the git repository, placing the .xpi in the root
5+
# of the repository.
6+
7+
# invoke with no arguments to pull a prerelease of the current
8+
# development point.
9+
10+
# invoke with a tag name to build a specific branch.
1111

12-
# create jar file (we're just storing files here)
13-
echo ---------- create $APP_NAME.jar file ----------
14-
cd src/chrome
15-
#zip -r0 ../../$APP_NAME.jar ./ -x "*.svn/*"
16-
cd ../..
12+
# e.g.:
13+
# ./makexpi.sh 0.2.3.development.2
1714

18-
# create .xpi
19-
echo ---------- create $APP_NAME.xpi ----------
20-
cd src
21-
echo zip -X -9r ../pkg/$XPI_NAME ./ -x "certDialogsOverride.js" -x "chrome/*" -x "*.diff" -x "*.svn/*" -x ".*.sw?"
22-
zip -X -9r ../pkg/$XPI_NAME ./ -x "*.svn/*" -x "*.diff" -x "*.swp" #-x "chrome/*"
23-
#mv ../$APP_NAME.jar ./chrome
24-
#zip -9m ../pkg/$XPI_NAME chrome/$APP_NAME.jar
25-
cd ..
15+
# or just:
16+
# ./makexpi.sh
2617

27-
#cp ./pkg/$XPI_NAME ~/
28-
#zip -9m ../../downloads/$sXpiName chrome/$APP_NAME.jar
29-
#zip -9 ../../downloads/$sXpiName install.rdf
30-
#cd ..
18+
if [ "$1" ] ; then
19+
VERSION="$1"
20+
TARG="$1"
21+
else
22+
VERSION="$(grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3)~pre"
23+
TARG=HEAD
24+
fi
25+
XPI_NAME="$APP_NAME-$VERSION.xpi"
26+
27+
cd "$(dirname $0)/src"
28+
git archive --format=zip -9 "$TARG" . > "../$XPI_NAME"
29+
ret="$?"
30+
if [ "$ret" != 0 ]; then
31+
rm -f "../$XPI_NAME"
32+
exit "$?"
33+
fi

0 commit comments

Comments
 (0)