[Mondrian] buildOnJdk.sh - now with 100% more Mac OS X

Patrick Leckey patl at seewind.com
Mon Mar 5 14:56:27 EST 2012


Hey guys,

Got tired of remote dev on my CentOS VM, wanted to be able to compile Mondrian locally on my Mac with the default Ant target, so I've updated buildOnJdk.sh to be Mac OS X-friendly.

Tested on CentOS 6.2 & Mac OS X Lion.  On Mac OS X, now compiles fine using default target from IntelliJ IDEA (latest CE), on the latest mondrian-3.4-SNAPSHOT.

-- buildOnJdk.sh --
jdkVersion=$1
shift
#case "$jdkVersion" in
#(*) export JAVA_HOME=/usr/lib/jvm/${jdkVersion};;
#esac
case $(uname) in
Darwin)
  JDK_VERSION=`echo "${jdkVersion}" | sed 's/jdk\([0-9]\.[0-9]\)/\1/'`
  export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JDK_VERSION}/Home;;
*)
  export JAVA_HOME=/usr/lib/jvm/${jdkVersion};;
esac
if [ ! -d $JAVA_HOME ]; then
    echo "$0: Invalid JAVA_HOME $JAVA_HOME; skipping compile."
    exit 1
fi
export PATH=$JAVA_HOME/bin:$PATH
if [ ! -f "/opt/ant1.7/bin/ant" ]; then
    ANT_BIN=`which ant`
    if [ -z "$ANT_BIN" ]; then
        echo "$0: Unable to locate ant binary; skipping compile."
        exit 1
    else
        $ANT_BIN -Drequested.java.version="$jdkVersion" "$@"
    fi
else
    /opt/ant1.7/bin/ant -Drequested.java.version="$jdkVersion" "$@"
fi
-- buildOnJdk.sh --

Thanks,
Pat


More information about the Mondrian mailing list