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, Nicholas Campbell <nicholas.j.campbell@gmail.com>
7 # Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@gmail.com>
8 # Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
9 # and other copyright owners as documented in the project's IP log.
11 # This program and the accompanying materials are made available
12 # under the terms of the Eclipse Distribution License v1.0 which
13 # accompanies this distribution, is reproduced below, and is
14 # available at http://www.eclipse.org/org/documents/edl-v10.php
16 # All rights reserved.
18 # Redistribution and use in source and binary forms, with or
19 # without modification, are permitted provided that the following
22 # - Redistributions of source code must retain the above copyright
23 # notice, this list of conditions and the following disclaimer.
25 # - Redistributions in binary form must reproduce the above
26 # copyright notice, this list of conditions and the following
27 # disclaimer in the documentation and/or other materials provided
28 # with the distribution.
30 # - Neither the name of the Eclipse Foundation, Inc. nor the
31 # names of its contributors may be used to endorse or promote
32 # products derived from this software without specific prior
35 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
36 # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
37 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
40 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
47 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 org.eclipse.jgit/lib/jsch-0.1.37.jar
61 org.eclipse.jgit.pgm/lib/args4j-2.0.9.jar
68 if [ "$OSTYPE" = "cygwin" ]
73 if [ "$MSYSTEM" = "MINGW" -o "$MSYSTEM" = "MINGW32" ]
79 if [ -n "$JAVA_HOME" ]
81 PATH
=${JAVA_HOME}/bin${PSEP}${PATH}
85 rm -f $T $O_CLI+ $O_JAR+ $O_SRC+ $T_MF
95 rm -f $O_CLI $O_JAR $O_SRC
101 rm -f $O_CLI $O_JAR $O_SRC $O_DOC
103 VN
=`git describe --abbrev=4 HEAD 2>/dev/null`
104 git update-index
-q --refresh
105 if [ -n "`git diff-index --name-only HEAD --`" ]
109 VN
=${VN:-untagged}`echo "$VN" | sed -e s/-/./g`
114 if [ -z "$CLASSPATH" ]
118 CLASSPATH
="${CLASSPATH}${PSEP}$R/$j"
125 echo "Entering $p ..."
128 find .
-name \
*.java
-type f |
134 -d ..
/bin2
) || die
"Building $p failed."
135 CLASSPATH
="${CLASSPATH}${PSEP}$R/$p/bin2"
139 echo "Version $VN" &&
140 echo Manifest-Version
: 1.0 >$T_MF &&
141 echo Implementation-Title
: jgit
>>$T_MF &&
142 echo Implementation-Version
: $VN >>$T_MF &&
144 java org.eclipse.jgit.pgm.build.JarLinkUtil \
145 -include org.eclipse.jgit
/bin2 \
146 -file META-INF
/MANIFEST.MF
=$T_MF \
149 echo "Created $O_JAR." &&
151 java org.eclipse.jgit.pgm.build.JarLinkUtil \
152 -include org.eclipse.jgit
/src \
153 -file META-INF
/MANIFEST.MF
=$T_MF \
156 echo "Created $O_SRC." &&
158 M_TB
=META-INF
/services
/org.eclipse.jgit.pgm.TextBuiltin
&&
159 sed s
/@@use_self@@
/1/ jgit.sh
>$O_CLI+ &&
160 java org.eclipse.jgit.pgm.build.JarLinkUtil \
161 `for p in $JARS ; do printf %s " -include $p" ;done` \
162 `for p in $PLUGINS; do printf %s " -include $p/bin2";done` \
163 -file $M_TB=org.eclipse.jgit.pgm
/src
/$M_TB \
164 -file META-INF
/MANIFEST.MF
=$T_MF \
168 echo "Created $O_CLI." || die
"Build failed."
170 echo "Building Javadocs ..."
171 for p
in $PLUGINS; do
172 javadoc
-quiet -sourcepath "$p/src/" -d "docs/$p/" \
173 `find "$p/src" -name "*.java"`
176 (cd docs
&& jar cf
"../$O_DOC" .
)
177 echo "Created $O_DOC."