source: trunk/Proxy/bin/make_jar.sh @ 1046

Revision 617, 954 bytes checked in by speck, 3 years ago (diff)

Make the java process be launched from a bundle so LittleSnitch better can recognize it as GlimmerBlocker? rather than just a java package name.

  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3set -e
4
5JARPATH=$1 ; shift
6TMPJAR=/tmp/gb-temp.jar
7
8# USAGE:
9#
10# make_jar tmp/myjar \
11#            tmp/classes/production/plugin-mine \
12#            -rsrc dk/mycompany/mine
13
14add_to_jar()
15{
16    FILES=/tmp/gb-jar-files.txt
17    cat > $FILES
18    if [ -s $FILES ]
19    then
20        zip -qDr -@ $TMPJAR < $FILES
21    fi
22    rm $FILES
23}
24
25rm -f $JARPATH $TMPJAR
26
27while [ $# -gt 0 ]
28do
29    if [ "$1" = "-rsrc" ]
30    then
31        shift;
32        cd src > /dev/null
33        find -E $1 -regex '.*\.(js|html|jpg|gif|png|css)' | add_to_jar
34        cd .. > /dev/null
35        shift
36        continue
37    fi
38    if [ "$1" = "-file" ]
39    then
40        shift;
41        cd "$1" > /dev/null
42        shift
43        echo "$1" | add_to_jar
44        shift
45        cd - > /dev/null
46        continue
47    fi
48    FINDDIR='*'
49    if [ "$1" = "-finddir" ]
50    then
51        shift
52        FINDDIR=$1
53        shift
54    fi
55    cd $1 > /dev/null
56    find $FINDDIR -name '*.class' -o -name '*.tmpldata' | add_to_jar z.jar
57    cd - > /dev/null
58    shift;
59done
60if [ -s $TMPJAR ]
61then
62    mv $TMPJAR $JARPATH
63else
64    echo "# didn't get any content for $JARPATH"
65    exit 1
66fi
Note: See TracBrowser for help on using the repository browser.