You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2016/07/15 09:48:10 UTC

svn commit: r1752806 - in /ofbiz/trunk/tools: functions.sh mergefromtrunk.sh rc.ofbiz rc.ofbiz.for.debian rc.ofbiz.for.ubuntu startofbiz.sh

Author: jleroux
Date: Fri Jul 15 09:48:10 2016
New Revision: 1752806

URL: http://svn.apache.org/viewvc?rev=1752806&view=rev
Log:
For "Clean the tools directory" - https://issues.apache.org/jira/browse/OFBIZ-7795 - This is in relation with the move from Ant to Gradle
Completes r1752771, I did not change the not concerned scripts. Though I worked carefully, I could have missed something so please check (notably typos, I did not test all). Note: we had no "apply-ofbiz-patches" Ant target (in applyOfbizPatchesAndHotDeploy.sh)

Modified:
    ofbiz/trunk/tools/functions.sh
    ofbiz/trunk/tools/mergefromtrunk.sh
    ofbiz/trunk/tools/rc.ofbiz
    ofbiz/trunk/tools/rc.ofbiz.for.debian
    ofbiz/trunk/tools/rc.ofbiz.for.ubuntu
    ofbiz/trunk/tools/startofbiz.sh

Modified: ofbiz/trunk/tools/functions.sh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/functions.sh?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/functions.sh (original)
+++ ofbiz/trunk/tools/functions.sh Fri Jul 15 09:48:10 2016
@@ -103,24 +103,24 @@ git_rebase_runner() {
 	fi
 }
 
-run_ant() {
+run_gradlew() {
 	# POSIX [ doesn't deal well when one of the arguments is empty, and
 	# [ doesn't support [ !
 	if [ "z$USE_LOCAL_ANT" = "z" ]; then
-		ant "$@"
+		gradlew "$@"
 	else
-		./ant "$@"
+		./gradlew "$@"
 	fi
 }
 
 standard_cleanup() {
-	run_ant clean-all
+	run_gradlew cleanAll
 }
 install_worker() {
-	run_ant load-demo
+	run_gradlew loadDefault
 }
 fulltestsuite_worker() {
-	run_ant load-demo
-	run_ant run-tests
+	run_gradlew loadDefault
+	run_gradlew test
 }
 #git_rebase_runner 3 fulltestsuite_cleanup fulltestsuite_worker

Modified: ofbiz/trunk/tools/mergefromtrunk.sh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/mergefromtrunk.sh?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/mergefromtrunk.sh (original)
+++ ofbiz/trunk/tools/mergefromtrunk.sh Fri Jul 15 09:48:10 2016
@@ -90,12 +90,12 @@ case "$cmd" in
 		tail -n $(($1 - 4)) < runtime/merge-state/log.txt.head >> runtime/merge-state/log-message
 		prevRev=$(($rev - 1))
 		svn up
-		svn merge -r "$prevRev:$rev" https://svn.apache.org/repos/asf/ofbiz/trunk 
+		svn merge -r "$prevRev:$rev" https://svn.apache.org/repos/asf/ofbiz/trunk
 		;;
 	(test)
-		./ant clean-all
-		./ant load-demo
-		./ant run-tests
+		./gradlew cleanAll
+		./gradlew loadDefault
+		./gradlew test
 		;;
 	(commit)
 		svn commit -F runtime/merge-state/log-message

Modified: ofbiz/trunk/tools/rc.ofbiz
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/rc.ofbiz?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/rc.ofbiz (original)
+++ ofbiz/trunk/tools/rc.ofbiz Fri Jul 15 09:48:10 2016
@@ -38,12 +38,6 @@ JAVA_BINARY=/usr/java/j2sdk1.4.2/bin/jav
 OFBIZ_HOME=/home/ofbiz/ofbiz
 OFBIZ_LOG=$OFBIZ_HOME/runtime/logs/console.log
 
-# VM Options
-JAVA_VMOPTIONS="-Xms128M -Xmx512M"
-
-# Java arguments
-JAVA_ARGS="-jar ofbiz.jar"
-
 # *nix user ofbiz should run as (you must create this user first)
 OFBIZ_USER=ofbiz
 
@@ -78,7 +72,7 @@ start() {
     cd $OFBIZ_HOME
     umask 007
     /bin/rm -f $OFBIZ_LOG
-    $JAVA_BINARY $JAVA_VMOPTIONS $JAVA_ARGS >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
+    gradlew ofbiz >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
     echo_success
     return 0
 }
@@ -98,16 +92,10 @@ stop() {
     # All clear
     cd $OFBIZ_HOME
     umask 007
-    $JAVA_BINARY $JAVA_VMOPTIONS $JAVA_ARGS -shutdown >>$OFBIZ_LOG
-    ofbizprocs
-    if [ "$OFBIZ_PROCS" != "" ]; then
-        # Let's try to -TERM
-        /bin/kill -TERM $OFBIZ_PROCS
-    fi
+    gradlew "ofbiz --shutdown" >>$OFBIZ_LOG
     ofbizprocs
     if [ "$OFBIZ_PROCS" != "" ]; then
-        # Let's try it the hard way!
-        /bin/kill -9 $OFBIZ_PROCS
+        gradlew terminateOfbiz
     fi
     ofbizprocs
     if [ "$OFBIZ_PROCS" != "" ]; then

Modified: ofbiz/trunk/tools/rc.ofbiz.for.debian
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/rc.ofbiz.for.debian?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/rc.ofbiz.for.debian (original)
+++ ofbiz/trunk/tools/rc.ofbiz.for.debian Fri Jul 15 09:48:10 2016
@@ -38,12 +38,6 @@ JAVA_BINARY=/usr/java/j2sdk1.4.2/bin/jav
 OFBIZ_HOME=/home/ofbiz/ofbiz
 OFBIZ_LOG=$OFBIZ_HOME/runtime/logs/console.log
 
-# VM Options
-JAVA_VMOPTIONS="-Xms128M -Xmx512M"
-
-# Java arguments
-JAVA_ARGS="-jar ofbiz.jar"
-
 # *nix user ofbiz should run as (you must create this user first)
 OFBIZ_USER=ofbiz
 
@@ -78,8 +72,8 @@ start() {
     cd $OFBIZ_HOME
     umask 007
     /bin/rm -f $OFBIZ_LOG
-    $JAVA_BINARY $JAVA_VMOPTIONS $JAVA_ARGS >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
-    echo success
+    gradlew ofbiz >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
+    echo_success
     return 0
 }
 
@@ -98,20 +92,14 @@ stop() {
     # All clear
     cd $OFBIZ_HOME
     umask 007
-    $JAVA_BINARY $JAVA_VMOPTIONS $JAVA_ARGS -shutdown >>$OFBIZ_LOG
-    ofbizprocs
-    if [ "$OFBIZ_PROCS" != "" ]; then
-        # Let's try to -TERM
-        /bin/kill -TERM $OFBIZ_PROCS
-    fi
+    gradlew "ofbiz --shutdown" >>$OFBIZ_LOG
     ofbizprocs
     if [ "$OFBIZ_PROCS" != "" ]; then
-        # Let's try it the hard way!
-        /bin/kill -9 $OFBIZ_PROCS
+        gradlew terminateOfbiz
     fi
     ofbizprocs
     if [ "$OFBIZ_PROCS" != "" ]; then
-        echo failure
+        echo_failure
         echo
         echo "Some processes could not be stopped:"
         echo $OFBIZ_PROCS

Modified: ofbiz/trunk/tools/rc.ofbiz.for.ubuntu
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/rc.ofbiz.for.ubuntu?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/rc.ofbiz.for.ubuntu (original)
+++ ofbiz/trunk/tools/rc.ofbiz.for.ubuntu Fri Jul 15 09:48:10 2016
@@ -58,7 +58,7 @@ stop() {
     if [ "$USER" = "$OFBIZUSER" ]; then
         echo "stopping standard /home/$OFBIZUSER/$OFBIZDIR/stopofbiz.sh"
         cd /home/$OFBIZUSER/$OFBIZDIR
-	    MAXCOUNT=10
+        MAXCOUNT=10
         COUNTER=0
         until [ $COUNTER -gt $MAXCOUNT ]; do
              COUNTER=$((COUNTER+1))
@@ -81,9 +81,9 @@ checkUser() {
     if [ "$USER" != "$OFBIZUSER" ]; then
         if [ "$USER" = "" ]; then
             exec su - $OFBIZUSER -c "$0 $1 "
-	    else
-	        exec sudo -u $OFBIZUSER $0 $1 
-	    fi
+        else
+            exec sudo -u $OFBIZUSER $0 $1 
+        fi
         exit $?
     fi
 }

Modified: ofbiz/trunk/tools/startofbiz.sh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/startofbiz.sh?rev=1752806&r1=1752805&r2=1752806&view=diff
==============================================================================
--- ofbiz/trunk/tools/startofbiz.sh (original)
+++ ofbiz/trunk/tools/startofbiz.sh Fri Jul 15 09:48:10 2016
@@ -27,30 +27,9 @@ OFBIZ_LOG=runtime/logs/console.log
 # delete the last log
 rm -f $OFBIZ_LOG
 
-# VM args
-#DEBUG="-Dsun.rmi.server.exceptionTrace=true"
-#DEBUG="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"
-#automatic IP address for linux
-#IPADDR=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
-#RMIIF="-Djava.rmi.server.hostname=$IPADDR"
-MEMIF="-Xms128M -Xmx512M"
-#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=33333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
-#MISC="-Duser.language=en"
-VMARGS="$MEMIF $MISC $JMX $DEBUG $RMIIF"
-
-# Worldpay Config
-#VMARGS="-Xbootclasspath/p:applications/accounting/lib/cryptix.jar $VMARGS"
-
-# location of java executable
-if [ -f "$JAVA_HOME/bin/java" ]; then
-  JAVA="$JAVA_HOME/bin/java"
-else
-  JAVA=java
-fi
-
 # Allows to run from Jenkins. See http://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller. Cons: the calling Jenkins job does not terminate if the log is not enabled, pros: this allows to monitor the log in Jenkins
 #BUILD_ID=dontKillMe
+# JLR post Gradle comment, not sure this is still true...
 
 # start ofbiz
-#$JAVA $VMARGS -jar ofbiz.jar $* >>$OFBIZ_LOG 2>>$OFBIZ_LOG&
-(cd "$OFBIZ_HOME" && exec "$JAVA" $VMARGS -jar ofbiz.jar "$@")
+(cd "$OFBIZ_HOME" && exec gradlew ofbiz)