Author: tchemit Date: 2008-02-22 01:47:51 +0000 (Fri, 22 Feb 2008) New Revision: 1189 Added: trunk/simexplorer-is/simexplorer-is-swing/dev.sh Removed: trunk/simexplorer-is/simexplorer-is-swing/go.sh Log: rename Copied: trunk/simexplorer-is/simexplorer-is-swing/dev.sh (from rev 1184, trunk/simexplorer-is/simexplorer-is-swing/go.sh) =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/dev.sh (rev 0) +++ trunk/simexplorer-is/simexplorer-is-swing/dev.sh 2008-02-22 01:47:51 UTC (rev 1189) @@ -0,0 +1,131 @@ +#!/bin/sh + + +############################################################################### +####### parse arguments ####################################################### +############################################################################### + +#TODO Generate via commadline:generateGo +#TEMP=`getopt -o kcjuodn:: --long clean,compile,jar,upline,debug,nosuspend,output:: \ +# -n 'dev.sh' -- "$@"` +#if [ $? != 0 ] ; then +# echo "bag argument" +# exit 1 +#fi +#eval set -- "$TEMP" + +CLEAN="" +COMPILE="" +DEV="classes" +OFF_LINE="-o " +MOUTPUT="target/maven.log" +while true; do + case "$1" in + -k|--clean) + CLEAN="clean" + shift;; + -c|--compile) + COMPILE="compile" + shift;; + -j|--jar) + DEV="jar" + shift;; + -u|--upline) + OFF_LINE="" + shift;; + -o|--output) + MOUTPUT="$1" + shift;; + -d|--debug) + echo "Debug mode" + #DEBUG="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=38000,server=y" + DEBUG="-server -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" + shift ;; + -n|--nosuspend) + echo "Debug no suspend mode" + DEBUG="$DEBUG,suspend=n" + shift ;; + \-\-) shift ; break ;; + *) break; + esac +done + +############################################################################### +####### init variables ######################################################## +############################################################################### + +#JAVA="/opt/repository/jdk1.6.0/bin/java -splash:src/resources/images/splash2.jpg" +#JAVA="java -Djava.library.path=lib -splash:src/resources/images/splash2.jpg" + +JAVA=java + +dir=$(dirname $0) +cd $dir + +# Warning, pom.xml must have xmlns info on his root node! +VER=$(xmlstarlet sel -N "p=http://maven.apache.org/POM/4.0.0" -t -v "/p:project/p:version" pom.xml) + +RELEASE="simexplorer-is-swing-$VER" +MAIN_CLASS="fr.cemagref.simexplorer.is.ui.swing.SimExplorer" +MX=512M + +rep=`dirname $0` +rep=`cd $rep && pwd` + +cd $rep + +############################################################################### +####### build required maven goals ############################################ +############################################################################### +MVN_ACTION= +if [ "$CLEAN" = "clean" ]; then + MVN_ACTION="clean dependency:copy-dependencies compile" + if [ "$DEV" = "jar" ]; then + MVN_ACTION="$MVN_ACTION jar:jar" + fi +else + if [ ! -d $rep/target/dependency ]; then + MVN_ACTION="$MVN_ACTION dependency:copy-dependencies" + fi + if [ ! -d $rep/target/classes -o "$COMPILE" = "compile" ]; then + MVN_ACTION="$MVN_ACTION compile" + fi + if [ "$DEV" = "jar" -a ! -f $rep/target/$RELEASE.jar ]; then + MVN_ACTION="$MVN_ACTION jar:jar" + fi +fi + +############################################################################### +####### launch maven if required ############################################## +############################################################################### +if [ ! "$MVN_ACTION" = "" ]; then + action="mvn -e $MVN_ACTION $OFF_LINE > $MOUTPUT" + echo "$action" + mkdir target 2>/dev/null + eval "$action" + if [ $? != 0 ] ; then + echo "error with maven :" + cat $MOUTPUT + exit 1 + fi + echo "mvn done." +fi + +############################################################################### +####### build classpath (by default use classes, not jar (one less goal:)) #### +############################################################################### +CL=$rep/target/classes +if [ "$DEV" = "jar" ]; then + CL=$rep/target/$RELEASE.jar +fi +echo "use CL $CL" +# add dependencies to class path +for f in $rep/target/dependency/*.jar; do + CL=$CL:$f +done + +############################################################################### +####### launch appli ########################################################## +############################################################################### +echo "java $MAIN_CLASS $@" +$JAVA $DEBUG -Xmx$MX -Xms$MX -classpath $CL $JVM_OPT $MAIN_CLASS $@ \ No newline at end of file Property changes on: trunk/simexplorer-is/simexplorer-is-swing/dev.sh ___________________________________________________________________ Name: svn:executable + * Deleted: trunk/simexplorer-is/simexplorer-is-swing/go.sh =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/go.sh 2008-02-22 00:49:11 UTC (rev 1188) +++ trunk/simexplorer-is/simexplorer-is-swing/go.sh 2008-02-22 01:47:51 UTC (rev 1189) @@ -1,131 +0,0 @@ -#!/bin/sh - - -############################################################################### -####### parse arguments ####################################################### -############################################################################### - -#TODO Generate via commadline:generateGo -#TEMP=`getopt -o kcjuodn:: --long clean,compile,jar,upline,debug,nosuspend,output:: \ -# -n 'go.sh' -- "$@"` -#if [ $? != 0 ] ; then -# echo "bag argument" -# exit 1 -#fi -#eval set -- "$TEMP" - -CLEAN="" -COMPILE="" -DEV="classes" -OFF_LINE="-o " -MOUTPUT="target/maven.log" -while true; do - case "$1" in - -k|--clean) - CLEAN="clean" - shift;; - -c|--compile) - COMPILE="compile" - shift;; - -j|--jar) - DEV="jar" - shift;; - -u|--upline) - OFF_LINE="" - shift;; - -o|--output) - MOUTPUT="$1" - shift;; - -d|--debug) - echo "Debug mode" - #DEBUG="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=38000,server=y" - DEBUG="-server -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" - shift ;; - -n|--nosuspend) - echo "Debug no suspend mode" - DEBUG="$DEBUG,suspend=n" - shift ;; - \-\-) shift ; break ;; - *) break; - esac -done - -############################################################################### -####### init variables ######################################################## -############################################################################### - -#JAVA="/opt/repository/jdk1.6.0/bin/java -splash:src/resources/images/splash2.jpg" -#JAVA="java -Djava.library.path=lib -splash:src/resources/images/splash2.jpg" - -JAVA=java - -dir=$(dirname $0) -cd $dir - -# Warning, pom.xml must have xmlns info on his root node! -VER=$(xmlstarlet sel -N "p=http://maven.apache.org/POM/4.0.0" -t -v "/p:project/p:version" pom.xml) - -RELEASE="simexplorer-is-swing-$VER" -MAIN_CLASS="fr.cemagref.simexplorer.is.ui.swing.SimExplorer" -MX=512M - -rep=`dirname $0` -rep=`cd $rep && pwd` - -cd $rep - -############################################################################### -####### build required maven goals ############################################ -############################################################################### -MVN_ACTION= -if [ "$CLEAN" = "clean" ]; then - MVN_ACTION="clean dependency:copy-dependencies compile" - if [ "$DEV" = "jar" ]; then - MVN_ACTION="$MVN_ACTION jar:jar" - fi -else - if [ ! -d $rep/target/dependency ]; then - MVN_ACTION="$MVN_ACTION dependency:copy-dependencies" - fi - if [ ! -d $rep/target/classes -o "$COMPILE" = "compile" ]; then - MVN_ACTION="$MVN_ACTION compile" - fi - if [ "$DEV" = "jar" -a ! -f $rep/target/$RELEASE.jar ]; then - MVN_ACTION="$MVN_ACTION jar:jar" - fi -fi - -############################################################################### -####### launch maven if required ############################################## -############################################################################### -if [ ! "$MVN_ACTION" = "" ]; then - action="mvn -e $MVN_ACTION $OFF_LINE > $MOUTPUT" - echo "$action" - mkdir target 2>/dev/null - eval "$action" - if [ $? != 0 ] ; then - echo "error with maven :" - cat $MOUTPUT - exit 1 - fi - echo "mvn done." -fi - -############################################################################### -####### build classpath (by default use classes, not jar (one less goal:)) #### -############################################################################### -CL=$rep/target/classes -if [ "$DEV" = "jar" ]; then - CL=$rep/target/$RELEASE.jar -fi -echo "use CL $CL" -# add dependencies to class path -for f in $rep/target/dependency/*.jar; do - CL=$CL:$f -done - -############################################################################### -####### launch appli ########################################################## -############################################################################### -echo "java $MAIN_CLASS $@" -$JAVA $DEBUG -Xmx$MX -Xms$MX -classpath $CL $JVM_OPT $MAIN_CLASS $@ \ No newline at end of file