Revision: 157
          
http://mindtreeinsight.svn.sourceforge.net/mindtreeinsight/?rev=157&view=rev
Author:   bindul
Date:     2008-04-03 23:47:13 -0700 (Thu, 03 Apr 2008)

Log Message:
-----------
Bug#1931541 [Complete Insight bash script and test it]: Created bash script to 
launch Insight in a Linux environment. This currently has been tested only on 
Fedora Core 7

Modified Paths:
--------------
    insight/insight-ui/branches/insight-ui-1.5.0/README.txt
    insight/insight-ui/branches/insight-ui-1.5.0/src/main/scripts/insight.sh

Modified: insight/insight-ui/branches/insight-ui-1.5.0/README.txt
===================================================================
--- insight/insight-ui/branches/insight-ui-1.5.0/README.txt     2008-04-03 
23:17:16 UTC (rev 156)
+++ insight/insight-ui/branches/insight-ui-1.5.0/README.txt     2008-04-04 
06:47:13 UTC (rev 157)
@@ -41,6 +41,9 @@
 Bug Fixes:
 1932949: Saving Insight Preferences
 
+Feature Requests Implemented:
+1931541: Complete Insight bash script and test it
+
 
--------------------------------------------------------------------------------
 RELEASE NOTES FOR RELEASE 1.5.0
 
--------------------------------------------------------------------------------

Modified: 
insight/insight-ui/branches/insight-ui-1.5.0/src/main/scripts/insight.sh
===================================================================
--- insight/insight-ui/branches/insight-ui-1.5.0/src/main/scripts/insight.sh    
2008-04-03 23:17:16 UTC (rev 156)
+++ insight/insight-ui/branches/insight-ui-1.5.0/src/main/scripts/insight.sh    
2008-04-04 06:47:13 UTC (rev 157)
@@ -31,4 +31,63 @@
 #   Insight.  If not, see <http://www.gnu.org/licenses/>.
 #  
 
-echo "Not yet implemented"
\ No newline at end of file
+# Messages
+JAVA_NOT_FOUND="A Java executable has not been found. Please ensure 'java' is 
in the PATH or JAVA_HOME environment variable is defined"
+INSIGHT_HOME_NOT_FOUND="Insight home could not be inferred. Please define 
INSIGHT_HOME variable"
+
+# Find out Java Home
+JAVA_EXECUTABLE=
+if [ $JAVA_HOME ]; then
+       if [ -x $JAVA_HOME/bin/java ]; then
+               JAVA_EXECUTABLE=$JAVA_HOME/bin/java;
+       fi
+else
+       which java
+       if [ $? == 0 ]; then
+               JAVA_EXECUTABLE=`which java`
+       fi
+fi
+
+if [ -z $JAVA_EXECUTABLE ]; then
+       echo $JAVA_NOT_FOUND;
+       exit 1
+fi
+
+# Find out Insight Home
+if [ -z $INSIGHT_HOME ]; then
+       # Insight Home is not defined, let us try to find it
+       # resolve links - $0 may be a softlink
+       PRG="$0"
+
+       while [ -h "$PRG" ] ; do
+               ls=`ls -ld "$PRG"`
+               link=`expr "$ls" : '.*-> \(.*\)$'`
+               if expr "$link" : '/.*' > /dev/null; then
+                       PRG="$link"
+               else
+                       PRG=`dirname "$PRG"`/"$link"
+               fi
+       done
+
+       INSIGHT_HOME=`dirname "$PRG"`
+fi
+
+# Check if Insight Home is fine
+if [ ! -f $INSIGHT_HOME/config/insight-preferences.xml ]; then
+       echo $INSIGHT_HOME_NOT_FOUND;
+       exit 1
+fi
+
+# All is good... now let us define the classpaths
+INSIGHT_JAR=${project.artifactId}-${project.version}.jar
+INSIGHT_CLASS_PATH=.:$INSIGHT_HOME/$INSIGHT_JAR:$INSIGHT_HOME/bin
+
+for JAR_FILE in `ls $INSIGHT_HOME/lib`; do
+       INSIGHT_CLASS_PATH=$INSIGHT_CLASS_PATH:$INSIGHT_HOME/lib/$JAR_FILE
+done
+
+# Call Insight
+$JAVA_EXECUTABLE -classpath $INSIGHT_CLASS_PATH -DINSIGHT_HOME=$INSIGHT_HOME 
com.mindtree.techworks.insight.Insight $@
+
+echo
+echo "Thank you for using Insight"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
MindTreeInsight-commits mailing list
MindTreeInsight-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mindtreeinsight-commits

Reply via email to