Pack jgit into a portable single file command line utility
commitee69996b9a4bdaee86e6f6d5c5d84fc9c4d04a1b
authorShawn O. Pearce <spearce@spearce.org>
Tue, 1 Jul 2008 03:04:04 +0000 (30 23:04 -0400)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Tue, 1 Jul 2008 21:10:50 +0000 (1 23:10 +0200)
tree6567b7e510237d315cc60f329b25e0d124f6862b
parentef93a59d707b434a89f140f56b65f84f52936401
Pack jgit into a portable single file command line utility

On UNIX (and even Cygwin) we can package the entire jgit library into
a single JAR file and prefix that JAR with a shell script to start the
JVM, passing in the script/JAR file as the only classpath.  This trick
works because the table of contents for the ZIP file is at the end of
the stream, and the JVM tends to only do random access through that
table when it looks up classes for loading.

A tiny shell script called make_jgit.sh compiles everything with the
command line javac and packages it into the portable jgit shell
script, making it possible to build and use jgit without touching
either Eclipse or Maven.

Currently this is quite easy to implement as we have only one support
library (JSch), but things may get more complicated if we add another
JAR to our classpath.

With this I can install JGit into my personal account and make use
of it on a daily basis from the command line:

./make_jgit.sh
mv jgit ~/bin
jgit push ...

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
.gitignore [new file with mode: 0644]
jgit.sh [moved from jgit with 64% similarity]
make_jgit.sh [new file with mode: 0755]