diff --git a/.gitignore b/.gitignore index d4b1ab16..556494dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.sw* Session.vim target +build diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..c59a8c80 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +#todo: requirejs build script as well + +csdir = src/main/coffeescript + +.PHONY : clean coffee copy-others scion + +clean: + rm -rf build + +build : + if [ ! -d build/scxml/test/ ]; then mkdir -p build/scxml/test/; fi + +coffee : build + #fixme: is there a smarter way to do this than iterating over each directory? + #something like `find $(csdir) -name *.coffee`, and then map the names + coffee -o build/scxml $(csdir)/scxml/*.coffee + coffee -o build/scxml/test $(csdir)/scxml/test/*.coffee + + +copy-others : build + cp -r lib/js/ build/lib/ + cp -r src/main/javascript/* build/ + cp -r src/main/xslt build/ + +scion : copy-others coffee diff --git a/pom.xml b/pom.xml index a2532cb7..918fff9e 100644 --- a/pom.xml +++ b/pom.xml @@ -66,20 +66,16 @@ process-classes + - - - - - - - - - - - - - + + + + + @@ -88,24 +84,6 @@ - - - com.voltvoodoo - brew - 0.2.1 - - - - compile - - - - - - - - org.codehaus.mojo exec-maven-plugin @@ -126,8 +104,8 @@ -debug ${basedir}/lib/js/r.js - ${basedir}/src/main/javascript/runner.js - ${basedir} + ${basedir}/build/runner.js + ${basedir}/build scxml/test/rhino-harness ${scxmlArgs} diff --git a/run-tests-rhino-dbg.sh b/run-tests-rhino-dbg.sh index 0a575d81..73ba0e54 100755 --- a/run-tests-rhino-dbg.sh +++ b/run-tests-rhino-dbg.sh @@ -98,8 +98,8 @@ exec "$JAVACMD" $JAVA_OPTS \ org.mozilla.javascript.tools.debugger.Main \ -debug \ ${root}/lib/js/r.js \ - ${root}/src/main/javascript/runner.js \ - ${root} \ + ${root}/build/runner.js \ + ${root}/build \ scxml/test/rhino-harness \ "$*" diff --git a/run-tests-rhino-mvn.sh b/run-tests-rhino-mvn.sh index 01b4129c..4a3dd474 100755 --- a/run-tests-rhino-mvn.sh +++ b/run-tests-rhino-mvn.sh @@ -1,4 +1,4 @@ #!/bin/sh dn=`dirname $0` abspath=`cd $dn; pwd` -mvn -q -o -f $abspath/pom.xml exec:java -DscxmlArgs="$*" +mvn -o -f $abspath/pom.xml exec:java -DscxmlArgs="$*" diff --git a/run-tests-rhino.sh b/run-tests-rhino.sh index b4c73472..20d92120 100755 --- a/run-tests-rhino.sh +++ b/run-tests-rhino.sh @@ -98,8 +98,8 @@ exec "$JAVACMD" $JAVA_OPTS \ org.mozilla.javascript.tools.shell.Main \ -debug \ ${root}/lib/js/r.js \ - ${root}/src/main/javascript/runner.js \ - ${root} \ + ${root}/build/runner.js \ + ${root}/build \ scxml/test/rhino-harness \ "$*" diff --git a/src/main/javascript/runner.js b/src/main/javascript/runner.js index a493f2a9..07e9883b 100644 --- a/src/main/javascript/runner.js +++ b/src/main/javascript/runner.js @@ -34,12 +34,12 @@ this.console = { preparedArguments = preparedArguments[0].replace(/^\s+|\s+$/g, '').split(/ +/); } - var absoluteScriptDir = args[1]; + var basedir = args[1]; var mainFunction = args[2]; //bootstrap require.js require({ - baseUrl : absoluteScriptDir + "/target/classes/", //FIXME: this should also be passed in as an argument + baseUrl : basedir, paths : { text : "lib/text" }