Skip to content

Commit

Permalink
Build.sh: download ImageJ launchers again
Browse files Browse the repository at this point in the history
Noticed by Benjamin Schmid in bug report 547.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jan 17, 2013
1 parent 7e7c288 commit b618d16
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions Build.sh
Expand Up @@ -39,14 +39,20 @@ get_java_home () {

PATHSEP=:
UNAME_S="$(uname -s)"
LAUNCHER=bin/ImageJ.sh
FIJILAUNCHER=
case "$UNAME_S" in
Darwin)
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
java_submodule=macosx-java3d
case "$(uname -r)" in
8.*) platform=tiger;;
*) platform=macosx;;
esac; exe=;;
esac
exe=
LAUNCHER=Contents/MacOS/ImageJ-$platform
FIJILAUNCHER=Contents/MacOS/fiji-$platform
;;
Linux)
case "$(uname -m)" in
x86_64)
Expand All @@ -56,15 +62,23 @@ Linux)
*) platform=linux32
java_submodule=linux
;;
esac; exe=;;
esac
exe=
LAUNCHER=ImageJ-$platform
FIJILAUNCHER=fiji-$platform
FIJILAUNCHER=${FIJILAUNCHER%32}
;;
MINGW*|CYGWIN*)
CWD="$(cd "$CWD" && pwd)"
PATHSEP=\;
case "$PROCESSOR_ARCHITEW6432" in
'') platform=win32; java_submodule=$platform;;
*) platform=win64; java_submodule=$platform;;
esac
exe=.exe;;
exe=.exe
LAUNCHER=ImageJ-$platform.exe
FIJILAUNCHER=fiji-$platform.exe
;;
FreeBSD)
platform=freebsd
if test -z "$JAVA_HOME"
Expand All @@ -81,14 +95,16 @@ FreeBSD)
echo ""
echo "(This requires some time)"
exit 1
fi;;
fi
;;
*)
platform=
TOOLS_JAR="$(ls -t /usr/jdk*/lib/tools.jar \
/usr/local/jdk*/lib/tools.jar 2> /dev/null |
head -n 1)"
test -z "$TOOLS_JAR" ||
export TOOLS_JAR;;
export TOOLS_JAR
;;
esac


Expand Down Expand Up @@ -226,6 +242,30 @@ maven_update () {
done
}

update_launcher () {
case "$LAUNCHER" in
bin/ImageJ.sh)
test -z "$exe" || rm -f "$CWD/fiji$exe"
uptodate "$ARGV0" "$CWD/fiji" || {
cat > "$CWD/fiji" << EOF
#!/bin/sh
exec "$CWD/$LAUNCHER" "$@"
EOF
chmod a+x "$CWD/fiji"
}
;;
*)
uptodate "$ARGV0" "$CWD/$LAUNCHER" ||
(cd $CWD &&
sh bin/download-launchers.sh snapshot $platform)
;;
esac
test -n "$FIJILAUNCHER" &&
test -f "$CWD/$FIJILAUNCHER" &&
rm "$CWD/$FIJILAUNCHER"
}

# make sure that javac and ij-minimaven are up-to-date
VERSION=2.0.0-SNAPSHOT
maven_update sc.fiji:javac:$VERSION
Expand Down Expand Up @@ -255,9 +295,16 @@ done
if test $# = 0
then
eval sh "$CWD/bin/ImageJ.sh" --mini-maven "$OPTIONS" install
update_launcher
else
for name in "$@"
do
case "$name" in
fiji|ImageJ)
update_launcher
continue
;;
esac
artifactId="${name##*/}"
artifactId="${artifactId%.jar}"
artifactId="${artifactId%%-[0-9]*}"
Expand Down

0 comments on commit b618d16

Please sign in to comment.