Author: jbeard
Date: Tue Nov  9 16:32:24 2010
New Revision: 1033067

URL: http://svn.apache.org/viewvc?rev=1033067&view=rev
Log:
Updated pom.xml so that it copies dependencies into local lib/java dir, where 
they can be referenced by run.sh. Unfortunately, due to version numbers being a 
part of the file name in the jar, this means we need to be a bit clever in the 
script, which is something that is not simple to do in MS batch, so I've had to 
temporarily delete the broken batch frontend. Also began exploring the 
possibility of using maven exec plugin as front-end, but this would require 
some refactoring to the rhino frontend with respect to how the arguments are 
passed in. Finally, updated README.txt so it is actually accurate again.

Removed:
    commons/sandbox/gsoc/2010/scxml-js/trunk/build.bat
Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/README.txt
    commons/sandbox/gsoc/2010/scxml-js/trunk/pom.xml
    commons/sandbox/gsoc/2010/scxml-js/trunk/run.sh

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/README.txt
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/README.txt?rev=1033067&r1=1033066&r2=1033067&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/README.txt (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/README.txt Tue Nov  9 16:32:24 2010
@@ -40,14 +40,14 @@ GSoC mentor:      rahul
 
 ==Requirements==
 
-Ant and Java
+Mavne, Ant and Java
 
 
 ==Installation==
 
 To use SCXMLcgf/js, you must first download the dependencies. Run:
 
-ant -f getDeps.xml
+mvn initialize
 
 
 ==Running the Compiler==
@@ -71,32 +71,22 @@ For example, you might run the following
 ./run.sh --backend state --beautify --ie test/kitchen_sink/KitchenSink.xml > 
KitchenSinkIE.js
 
 
-==Running Unit and Performance Tests==
+==Running Unit Tests==
 
-SCXMLcgf/js comes with a script for automating unit and performance tests. 
+To run unit tests from the command-line under Mozilla Rhino, run:
 
-./build.sh [task]
+mvn test
 
-A summary of available tasks are as follows:
+Or:
 
-- clean: Deletes the build directory.
-- init: Creates the build directory.
-- genJavaScript: Generates JavaScript from unit and performance test
-        SCXML.
-- genPerformanceTestHtml: Generates an HTML file for each performance
-        test script and each target JavaScript file.
-- runPerformanceTestsWithSelenium: Uses Selenium to open generated
-       performance test HTML files in browsers that are available on the
-       system, and capture benchmark data from them.
-- doPerformanceAnalysis: Sends captured benchmark data to the
-       performance analysis script.
-- genUnitTestHtml: Generates an HTML file for each performance test
-       script and each target JavaScript file.
-- runUnitTestsWithSelenium: Uses Selenium to open generated unit test
-       HTML files in browsers that are available on the system, and capture
-       unit test results from them.
-- runUnitTestsWithRhino: Runs unit tests with Rhino.
+ant run-unit-tests-with-rhino
 
+You can also run unit tests on Microsoft Windows under Mozilla Firefox and
+Internet Explorer. To do so, you must, you must have a web server serving files
+on port 8080 in the SCXMLcgf/js root directory. Then run:
 
-To run unit and performance tests with Selenium, you must have a web server
-serving files on port 8080 in the SCXMLcgf/js root directory.
+ant run-unit-tests-with-selenium
+
+Or, to run unit tests with both Selenium and Rhino, run:
+
+ant run-all-unit-tests

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=1033067&r1=1033066&r2=1033067&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:24 2010
@@ -137,6 +137,12 @@
                <version>2.0.2</version>
                <scope>runtime</scope>
        </dependency>
+       <dependency>
+               <groupId>rhino</groupId> 
+               <artifactId>js</artifactId> 
+               <version>1.7R2</version> 
+               <scope>runtime</scope>
+       </dependency>
   </dependencies>
 
  <build>
@@ -154,6 +160,26 @@
        <artifactId>maven-site-plugin</artifactId>
        <version>2.1.1</version>
      </plugin>
+       <!-- copy runtime dependencies to local dir so they can be run -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>initialize</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/lib/java</outputDirectory>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>false</overWriteSnapshots>
+              <overWriteIfNewer>true</overWriteIfNewer>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <version>1.4</version>
@@ -194,6 +220,7 @@
               <goal>run</goal>
             </goals>
           </execution>
+<!--
           <execution>
            <id>generate-test-sources</id>
             <phase>generate-test-sources</phase>
@@ -218,6 +245,7 @@
               <goal>run</goal>
             </goals>
           </execution>
+-->
         </executions>
        <dependencies>
                <!-- dependencies for running Rhino JavaScript scripts in Ant 
-->
@@ -318,6 +346,32 @@
           <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>
+       <version>1.1</version>
+       <executions>
+         <execution>
+           <goals>
+             <goal>java</goal>
+           </goals>
+         </execution>
+       </executions>
+       <configuration>
+         <mainClass>org.mozilla.javascript.tools.shell.Main</mainClass>
+         <classpathScope>runtime</classpathScope>
+         <arguments>
+           <argument>-debug</argument> 
+           <argument>${basedir}/runner.js</argument> 
+           <argument>${basedir}</argument> 
+           <argument>src/javascript/scxml/cgf/main</argument> 
+           <argument>${scxmlInputPath}</argument> 
+         </arguments>
+       </configuration>
+      </plugin>
+       -->
    </plugins>
  </build>
 

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=1033067&r1=1033066&r2=1033067&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:24 2010
@@ -4,6 +4,9 @@
 #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 
$abspath/lib/java/js.jar:$abspath/lib/java/commons-cli.jar:$abspath/lib/java/serializer.jar:$abspath/lib/java/xalan.jar:$abspath/lib/java/xercesImpl.jar:$abspath/lib/java/xml-apis.jar
 org.mozilla.javascript.tools.shell.Main -debug $abspath/runner.js $abspath 
src/javascript/scxml/cgf/main $*
+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 $*


Reply via email to