incubator-kitty-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pids...@apache.org
Subject svn commit: r1060025 - in /incubator/kitty/trunk/resources: ./ shell/ shell/kitty.sh
Date Mon, 17 Jan 2011 17:54:59 GMT
Author: pidster
Date: Mon Jan 17 17:54:59 2011
New Revision: 1060025

URL: http://svn.apache.org/viewvc?rev=1060025&view=rev
Log:
First attempt at a wrapper shell script

Added:
    incubator/kitty/trunk/resources/
    incubator/kitty/trunk/resources/shell/
    incubator/kitty/trunk/resources/shell/kitty.sh   (with props)

Added: incubator/kitty/trunk/resources/shell/kitty.sh
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/resources/shell/kitty.sh?rev=1060025&view=auto
==============================================================================
--- incubator/kitty/trunk/resources/shell/kitty.sh (added)
+++ incubator/kitty/trunk/resources/shell/kitty.sh Mon Jan 17 17:54:59 2011
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at#
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ---------------------------------------------------------------------------
+
+JAVA_ARGS=""
+
+KITTY_INIT="$0"
+KITTY_HOME=`dirname "$KITTY_INIT"`
+
+# Find Java?
+if [ -z "$JAVA_HOME" ]; then
+    while [ ! -z "$1" ]; do
+        ARG=$1
+        shift
+        if [ $ARG == "--java-home" ]; then
+            JAVA_HOME=$1
+            shift
+        elif [ $ARG == "--kitty-home" ]; then
+            KITTY_HOME=$1
+            shift
+        else
+            JAVA_ARGS="$JAVA_ARGS $ARG"
+        fi
+    done
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+
+    echo "Warning: JAVA_HOME is not set!"
+    echo "Kitty will guess at locations - you should specify where Java is..."
+
+    if [ -e "/usr/libexec/java_home" ]; then
+        JAVA_HOME=`/usr/libexec/java_home`
+    elif [ -e "/usr/alternatives/java" ]; then
+        JAVA_HOME='/usr/alternatives/java'
+    fi
+
+    echo "Setting JAVA_HOME=$JAVA_HOME"
+    echo " "
+fi
+
+CLASSPATH="$KITTY_HOME/apache-kitty-0.1-incubating-dev.jar"
+
+if [ -e '$JAVA_HOME/lib/tools.jar' ]; then
+    CLASSPATH="$CLASSPATH:$JAVA_HOME/lib/tools.jar"
+fi
+
+KITTY_DEPS=`ls $KITTY_HOME/lib`
+for file in $KITTY_DEPS
+do
+    CLASSPATH="$CLASSPATH:$KITTY_HOME/lib/$file"
+done
+
+$JAVA_HOME/bin/java -Dkitty.home=$KITTY_HOME -cp $CLASSPATH org.apache.kitty.Main $JAVA_ARGS

Propchange: incubator/kitty/trunk/resources/shell/kitty.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/kitty/trunk/resources/shell/kitty.sh
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message