Skip to content

Commit

Permalink
MONDRIAN: Make workbench.sh work on cygwin, and work from any directory.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 11565]
  • Loading branch information
julianhyde committed Sep 16, 2008
1 parent bb33ede commit 9548174
Showing 1 changed file with 39 additions and 28 deletions.
67 changes: 39 additions & 28 deletions workbench/workbench.sh
@@ -1,41 +1,51 @@
#!/bin/sh

# mondrian jars
CP="lib/commons-dbcp.jar"
CP=$CP:"lib/commons-collections.jar"
CP=$CP:"lib/commons-pool.jar"
CP=$CP:"lib/eigenbase-properties.jar"
CP=$CP:"lib/eigenbase-resgen.jar"
CP=$CP:"lib/eigenbase-xom.jar"
CP=$CP:"lib/javacup.jar"
CP=$CP:"lib/log4j.jar"
CP=$CP:"lib/mondrian.jar"
CP=$CP:"lib/jlfgr.jar"
CP=$CP:"lib/commons-math.jar"
CP=$CP:"lib/commons-vfs.jar"
CP=$CP:"lib/commons-logging.jar"
#!/bin/bash
# $Id$
# Launch Mondrian Schema Workbench on Linux, UNIX or Cygwin

# Platform specific path-separator.
MONDRIAN_HOME=$(cd $(dirname $0)/..; pwd)
case $(uname) in
Windows_NT|CYGWIN*)
export PS=";"
export MONDRIAN_HOME=$(cygpath -m $MONDRIAN_HOME)
;;
*)
export PS=":"
;;
esac

CP="${MONDRIAN_HOME}/lib/commons-collections.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/commons-pool.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/eigenbase-properties.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/eigenbase-resgen.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/eigenbase-xom.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/javacup.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/log4j.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/mondrian.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/jlfgr.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/commons-math.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/commons-vfs.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/commons-logging.jar"

# Workbench GUI code and resources

CP=$CP:"lib/workbench.jar"
CP="${CP}${PS}${MONDRIAN_HOME}/lib/workbench.jar"

# local directory is ~/.schemaWorkbench

if test ! -d ~/.schemaWorkbench; then
mkdir ~/.schemaWorkbench
mkdir ~/.schemaWorkbench
fi

# copy mondrian.properties and log4j.xml if necessary

if test ! -e ~/.schemaWorkbench/mondrian.properties; then
cp mondrian.properties ~/.schemaWorkbench/mondrian.properties
cp mondrian.properties ~/.schemaWorkbench/mondrian.properties
fi

if test ! -e ~/.schemaWorkbench/log4j.xml; then
cp log4j.xml ~/.schemaWorkbench/log4j.xml
cp log4j.xml ~/.schemaWorkbench/log4j.xml
fi

CP=$CP:~/.schemaWorkbench
CP="${CP}${PS}~/.schemaWorkbench"


# or
Expand All @@ -44,19 +54,20 @@ CP=$CP:~/.schemaWorkbench
# in the java command below to adjust workbench logging

# add all needed JDBC drivers to the classpath

for i in `ls drivers/*.jar 2> /dev/null`; do
CP=$CP:$i
CP="${CP}${PS}${i}"
done

# add all needed plugins to the classpath

for i in `ls plugins/*.jar 2> /dev/null`; do
CP=$CP:$i
CP="${CP}${PS}${i}"
done

#echo $CP

java -Xms100m -Xmx500m -cp "$CP" mondrian.gui.Workbench
JAVA_FLAGS="-Xms100m -Xmx500m"
#JAVA_FLAGS="-verbose $JAVA_FLAGS"

exec java $JAVA_FLAGS -cp "$CP" mondrian.gui.Workbench

# End workbench.sh

0 comments on commit 9548174

Please sign in to comment.