1
0

CoffeeScript build environment

This commit is contained in:
Markus Birth 2013-06-25 11:58:19 +02:00
parent 2d38ad0086
commit 8c89a6d9c3
3 changed files with 18 additions and 10 deletions

4
build/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,2 +0,0 @@
#!/bin/sh
chrome.exe --pack-extension=src

22
make.sh
View File

@ -4,27 +4,33 @@ if [ ! -f key.pem ]; then
fi
SRCDIR="src"
BUILDDIR="build"
FILENAME="gplusblacklist"
NAME=`grep "\"name\":" src/manifest.json | sed -e 's/^.*: "\(.*\)\".*$/\1/'`
VERSION=`grep "\"version\":" src/manifest.json | sed -e 's/^.*: "\(.*\)\".*$/\1/'`
rm $BUILDDIR/*
find "$SRCDIR/" -type f ! -name "*.coffee" -exec cp {} "$BUILDDIR/" \;
coffee -o "$BUILDDIR/" -c "$SRCDIR/"
NAME=`grep "\"name\":" "$BUILDDIR/manifest.json" | sed -e 's/^.*: "\(.*\)\".*$/\1/'`
VERSION=`grep "\"version\":" "$BUILDDIR/manifest.json" | sed -e 's/^.*: "\(.*\)\".*$/\1/'`
OUTPUT="$FILENAME-$VERSION.crx"
if [ -f "$SRCDIR.crx" ]; then
echo "Cleaning up old $SRCDIR.crx."
rm "$SRCDIR.crx"
if [ -f "$BUILDDIR.crx" ]; then
echo "Cleaning up old $BUILDDIR.crx."
rm "$BUILDDIR.crx"
fi
echo "Generating $NAME $VERSION..."
google-chrome --pack-extension="$SRCDIR/" --pack-extension-key="key.pem" >/dev/null
google-chrome --pack-extension="$BUILDDIR/" --pack-extension-key="key.pem" >/dev/null
if [ ! -f "$SRCDIR.crx" ]; then
if [ ! -f "$BUILDDIR.crx" ]; then
echo "ERROR: Could not compile extension!"
exit 1
fi
# rename output file
mv "$SRCDIR.crx" "$OUTPUT"
mv "$BUILDDIR.crx" "$OUTPUT"
echo "Compiled $OUTPUT ."