Push GUI
[egit/zawir.git] / make_jgit.sh
blob13d0e32795f844fcf1332e2bf31296e236f69186
1 #!/bin/sh
3 O=jgit
4 PLUGINS="
5 org.spearce.jgit
6 org.spearce.jgit.pgm
8 JARS="
9 org.spearce.jgit/lib/jsch-0.1.37.jar
10 org.spearce.jgit.pgm/lib/args4j-2.0.9.jar
13 if [ -n "$JAVA_HOME" ]
14 then
15 PATH=$JAVA_HOME/bin:$PATH
18 T=".temp$$.$O"
19 T_MF="$T.MF"
20 R=`pwd`
22 cleanup_bin() {
23 rm -f $T $O+ $T_MF
24 for p in $PLUGINS
26 rm -rf $p/bin2
27 done
30 die() {
31 cleanup_bin
32 rm -f $O
33 echo >&2 "$@"
34 exit 1
37 cleanup_bin
38 rm -f $O
40 CLASSPATH=
41 for j in $JARS
43 if [ -z "$CLASSPATH" ]
44 then
45 CLASSPATH="$R/$j"
46 else
47 CLASSPATH="$CLASSPATH:$R/$j"
49 done
50 export CLASSPATH
52 for p in $PLUGINS
54 echo "Entering $p ..."
55 (cd $p/src &&
56 mkdir ../bin2 &&
57 find . -name \*.java -type f |
58 xargs javac \
59 -source 1.5 \
60 -target 1.5 \
61 -encoding UTF-8 \
62 -g \
63 -d ../bin2) || die "Building $p failed."
64 CLASSPATH="$CLASSPATH:$R/$p/bin2"
65 done
67 echo Manifest-Version: 1.0 >$T_MF &&
68 echo Implementation-Title: jgit >>$T_MF &&
69 echo Implementation-Version: `git describe HEAD` >>$T_MF &&
71 sed s/@@use_self@@/1/ jgit.sh >$O+ &&
72 java org.spearce.jgit.pgm.build.JarLinkUtil \
73 `for p in $JARS ; do printf %s " -include $p" ;done` \
74 `for p in $PLUGINS; do printf %s " -include $p/bin2";done` \
75 -file META-INF/services/org.spearce.jgit.pgm.TextBuiltin=org.spearce.jgit.pgm/src/META-INF/services/org.spearce.jgit.pgm.TextBuiltin \
76 -file META-INF/MANIFEST.MF=$T_MF \
77 >>$O+ &&
78 chmod 555 $O+ &&
79 mv $O+ $O &&
80 echo "Created $O." || die "Creating $O failed."
82 cleanup_bin