forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r232918 - /forrest/trunk/etc/views.sh
Date Tue, 16 Aug 2005 00:28:35 GMT
Author: thorsten
Date: Mon Aug 15 17:28:30 2005
New Revision: 232918

URL: http://svn.apache.org/viewcvs?rev=232918&view=rev
Log:
Now the script can be run from everywhere. Added CYGWin support.

Modified:
    forrest/trunk/etc/views.sh

Modified: forrest/trunk/etc/views.sh
URL: http://svn.apache.org/viewcvs/forrest/trunk/etc/views.sh?rev=232918&r1=232917&r2=232918&view=diff
==============================================================================
--- forrest/trunk/etc/views.sh (original)
+++ forrest/trunk/etc/views.sh Mon Aug 15 17:28:30 2005
@@ -1,6 +1,61 @@
 #!/bin/sh
-echo "\$PWD: $PWD needs to be equal to \$FORREST_HOME: $FORREST_HOME"
-cd $PWD/whiteboard/plugins/org.apache.forrest.plugin.internal.view/
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed 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.
+
+
+# set the current working dir as the PROJECT_HOME variable 
+cygwin=false;
+darwin=false;
+case `uname` in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home   
+           fi
+           ;;
+esac
+
+if [ "$cygwin" = "true" ] ; then
+  PROJECT_HOME=`cygpath -w "$PWD"`
+else
+  PROJECT_HOME=`pwd`
+fi
+
+if [ -z "$FORREST_HOME" ] ; then
+  # use the location of this script to infer $FORREST_HOME
+  whoami=`basename $0`
+  whereami=`echo $0 | sed -e "s#^[^/]#\`pwd\`/&#"`
+  whereami=`dirname $whereami`
+
+  # Resolve any symlinks of the now absolute path, $whereami
+  realpath_listing=`ls -l $whereami/$whoami`
+  case "$realpath_listing" in
+    *-\>\ /*)
+      realpath=`echo $realpath_listing | sed -e "s#^.*-> ##"`
+      ;;
+    *-\>*)
+      realpath=`echo $realpath_listing | sed -e "s#^.*-> #$whereami/#"`
+      ;;
+    *)
+      realpath=$whereami/$whoami
+      ;;
+  esac
+  FORREST_HOME=`dirname "$realpath"`/..
+fi
+
+cd $FORREST_HOME/whiteboard/plugins/org.apache.forrest.plugin.internal.view/
 ant local-deploy
 cd ../org.apache.forrest.plugin.output.viewHelper.xhtml/
 ant local-deploy



Mime
View raw message