2 # Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>
3 # Copyright (C) 2008-2009, Google Inc.
4 # Copyright (C) 2009, Johannes Schindelin <Johannes.Schindelin@gmx.de>
5 # Copyright (C) 2008, Mike Ralphson <mike@abacus.co.uk>
6 # Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua>
7 # Copyright (C) 2009, Nicholas Campbell <nicholas.j.campbell@gmail.com>
8 # Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@gmail.com>
9 # Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
10 # and other copyright owners as documented in the project's IP log.
12 # This program and the accompanying materials are made available
13 # under the terms of the Eclipse Distribution License v1.0 which
14 # accompanies this distribution, is reproduced below, and is
15 # available at http://www.eclipse.org/org/documents/edl-v10.php
17 # All rights reserved.
19 # Redistribution and use in source and binary forms, with or
20 # without modification, are permitted provided that the following
23 # - Redistributions of source code must retain the above copyright
24 # notice, this list of conditions and the following disclaimer.
26 # - Redistributions in binary form must reproduce the above
27 # copyright notice, this list of conditions and the following
28 # disclaimer in the documentation and/or other materials provided
29 # with the distribution.
31 # - Neither the name of the Eclipse Foundation, Inc. nor the
32 # names of its contributors may be used to endorse or promote
33 # products derived from this software without specific prior
36 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
37 # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
38 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
46 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
48 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 org.eclipse.jgit/lib/jsch-0.1.37.jar
63 org.eclipse.jgit.pgm/lib/args4j-2.0.9.jar
70 if [ "$OSTYPE" = "cygwin" ]
75 if [ "$MSYSTEM" = "MINGW" -o "$MSYSTEM" = "MINGW32" ]
81 if [ -n "$JAVA_HOME" ]
83 PATH
=${JAVA_HOME}/bin${PSEP}${PATH}
87 rm -f $T $O_CLI+ $O_JAR+ $O_SRC+ $T_MF
97 rm -f $O_CLI $O_JAR $O_SRC
103 rm -f $O_CLI $O_JAR $O_SRC $O_DOC
105 VN
=`git describe --abbrev=4 HEAD 2>/dev/null`
106 git update-index
-q --refresh
107 if [ -n "`git diff-index --name-only HEAD --`" ]
111 VN
=${VN:-untagged}`echo "$VN" | sed -e s/-/./g`
116 if [ -z "$CLASSPATH" ]
120 CLASSPATH
="${CLASSPATH}${PSEP}$R/$j"
127 echo "Entering $p ..."
130 find .
-name \
*.java
-type f |
136 -d ..
/bin2
) || die
"Building $p failed."
137 CLASSPATH
="${CLASSPATH}${PSEP}$R/$p/bin2"
141 echo "Version $VN" &&
142 echo Manifest-Version
: 1.0 >$T_MF &&
143 echo Implementation-Title
: jgit
>>$T_MF &&
144 echo Implementation-Version
: $VN >>$T_MF &&
146 java org.eclipse.jgit.pgm.build.JarLinkUtil \
147 -include org.eclipse.jgit
/bin2 \
148 -file META-INF
/MANIFEST.MF
=$T_MF \
151 echo "Created $O_JAR." &&
153 java org.eclipse.jgit.pgm.build.JarLinkUtil \
154 -include org.eclipse.jgit
/src \
155 -file META-INF
/MANIFEST.MF
=$T_MF \
158 echo "Created $O_SRC." &&
160 M_TB
=META-INF
/services
/org.eclipse.jgit.pgm.TextBuiltin
&&
161 sed s
/@@use_self@@
/1/ jgit.sh
>$O_CLI+ &&
162 java org.eclipse.jgit.pgm.build.JarLinkUtil \
163 `for p in $JARS ; do printf %s " -include $p" ;done` \
164 `for p in $PLUGINS; do printf %s " -include $p/bin2";done` \
165 -file $M_TB=org.eclipse.jgit.pgm
/src
/$M_TB \
166 -file META-INF
/MANIFEST.MF
=$T_MF \
170 echo "Created $O_CLI." || die
"Build failed."
172 echo "Building Javadocs ..."
173 for p
in $PLUGINS; do
174 javadoc
-quiet -sourcepath "$p/src/" -d "docs/$p/" \
175 `find "$p/src" -name "*.java"`
178 (cd docs
&& jar cf
"../$O_DOC" .
)
179 echo "Created $O_DOC."