Author: jbeard
Date: Tue Nov  9 16:32:57 2010
New Revision: 1033068

URL: http://svn.apache.org/viewvc?rev=1033068&view=rev
Log:
Updated run.sh and pom.xml so that now maven -q is used as the frontend. Works 
well on linux, and should make constructing a new batch frontend a trivial task.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml
    commons/sandbox/gsoc/2010/scxml-js/trunk/run.bat
    commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh
    commons/sandbox/gsoc/2010/scxml-js/trunk/runner.js

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml?rev=1033068&r1=1033067&r2=1033068&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml Tue Nov  9 16:32:57 2010
@@ -161,6 +161,8 @@
        <version>2.1.1</version>
      </plugin>
        <!-- copy runtime dependencies to local dir so they can be run -->
+       <!-- we no longer need to do this, as the run scripts now delegate to 
maven to setup the classpath -->
+       <!--
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
@@ -180,6 +182,7 @@
           </execution>
         </executions>
       </plugin>
+       -->
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <version>1.4</version>
@@ -346,8 +349,6 @@
           <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>
       </plugin>
-       <!-- TODO: get this working at some point so we can use maven as the 
front-end -->
-       <!--
       <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
@@ -367,11 +368,10 @@
            <argument>${basedir}/runner.js</argument> 
            <argument>${basedir}</argument> 
            <argument>src/javascript/scxml/cgf/main</argument> 
-           <argument>${scxmlInputPath}</argument> 
+           <argument>${scxmlInputArgs}</argument> 
          </arguments>
        </configuration>
       </plugin>
-       -->
    </plugins>
  </build>
 

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/run.bat
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/run.bat?rev=1033068&r1=1033067&r2=1033068&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/run.bat (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/run.bat Tue Nov  9 16:32:57 2010
@@ -1 +1 @@
-java -cp lib\java\js.jar;lib\java\commons-cli.jar 
org.mozilla.javascript.tools.shell.Main -debug runner.js %~dp0 
"src/javascript/scxml/cgf/main" %*
+mvn -q exec:java -DscxmlInputArgs=%*

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh?rev=1033068&r1=1033067&r2=1033068&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh Tue Nov  9 16:32:57 2010
@@ -1,12 +1,2 @@
 #!/bin/sh
-#the purpose of this file is to bootstrap the compiler when running under rhino
-#we pass in the path to the file, because the rhino scirpt has no way to know 
where it is executing (nothing like __FILE__ in python)
-#TODO: link up to the page on stackoverflow that describes this 
-#for details, see 
http://stackoverflow.com/questions/2302948/load-files-on-a-relative-path-to-the-current-file-in-rhino
-
-#$abspath/lib/java/serializer*.jar:
-#
-
-dn=`dirname $0`
-abspath=`cd $dn; pwd`
-java -cp `find $abspath/lib/java/js*.jar`:`find 
$abspath/lib/java/commons-cli*.jar`:`find $abspath/lib/java/xalan*.jar`:`find 
$abspath/lib/java/xercesImpl*.jar`:`find $abspath/lib/java/xml-apis*.jar` 
org.mozilla.javascript.tools.shell.Main -debug $abspath/runner.js $abspath 
src/javascript/scxml/cgf/main $*
+mvn -q exec:java -DscxmlInputArgs="$*"

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/runner.js
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/runner.js?rev=1033068&r1=1033067&r2=1033068&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/runner.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/runner.js Tue Nov  9 16:32:57 2010
@@ -53,6 +53,13 @@ function prepareArguments(args){
 
 if(arguments.length){
        var preparedArguments = prepareArguments(arguments);
+
+       //if we only have one big argument with at least one space in it, 
assume we're being called by ant or maven, 
+       //which, due to passing multiple args in as -D"arg1 arg2 arg3", shows 
up here as one big string with spaces 
+       if(preparedArguments.length == 1 && preparedArguments[0].search(" ")){
+               preparedArguments = preparedArguments[0].replace(/^\s+|\s+$/g, 
'').split(/ +/); 
+       }
+
        var absoluteScriptDir = arguments[0];
        var mainFunction = arguments[1]; 
 


Reply via email to