Refactor/rewrite CloneSourcePage to universal RepositorySelectionPage
[egit/imyousuf.git] / make_jgit.sh
blobc1192021710d5e5e2802fde6a4784a1f3d7eb185
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 PSEP=":"
14 T=".temp$$.$O"
15 T_MF="$T.MF"
16 R=`pwd`
17 if [ "$OSTYPE" = "cygwin" ]
18 then
19 R=`cygpath -m $R`
20 PSEP=";"
22 if [ "$MSYSTEM" = "MINGW" ]
23 then
24 PSEP=";"
27 if [ -n "$JAVA_HOME" ]
28 then
29 PATH=${JAVA_HOME}/bin${PSEP}${PATH}
32 cleanup_bin() {
33 rm -f $T $O+ $T_MF
34 for p in $PLUGINS
36 rm -rf $p/bin2
37 done
40 die() {
41 cleanup_bin
42 rm -f $O
43 echo >&2 "$@"
44 exit 1
47 cleanup_bin
48 rm -f $O
50 CLASSPATH=
51 for j in $JARS
53 if [ -z "$CLASSPATH" ]
54 then
55 CLASSPATH="$R/$j"
56 else
57 CLASSPATH="${CLASSPATH}${PSEP}$R/$j"
59 done
60 export CLASSPATH
62 for p in $PLUGINS
64 echo "Entering $p ..."
65 (cd $p/src &&
66 mkdir ../bin2 &&
67 find . -name \*.java -type f |
68 xargs javac \
69 -source 1.5 \
70 -target 1.5 \
71 -encoding UTF-8 \
72 -g \
73 -d ../bin2) || die "Building $p failed."
74 CLASSPATH="${CLASSPATH}${PSEP}$R/$p/bin2"
75 done
77 echo Manifest-Version: 1.0 >$T_MF &&
78 echo Implementation-Title: jgit >>$T_MF &&
79 echo Implementation-Version: `git describe HEAD` >>$T_MF &&
81 sed s/@@use_self@@/1/ jgit.sh >$O+ &&
82 java org.spearce.jgit.pgm.build.JarLinkUtil \
83 `for p in $JARS ; do printf %s " -include $p" ;done` \
84 `for p in $PLUGINS; do printf %s " -include $p/bin2";done` \
85 -file META-INF/services/org.spearce.jgit.pgm.TextBuiltin=org.spearce.jgit.pgm/src/META-INF/services/org.spearce.jgit.pgm.TextBuiltin \
86 -file META-INF/MANIFEST.MF=$T_MF \
87 >>$O+ &&
88 chmod 555 $O+ &&
89 mv $O+ $O &&
90 echo "Created $O." || die "Creating $O failed."
92 cleanup_bin