Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Added Makefile, and moved a lot of the build logic out of maven. Wher…
Browse files Browse the repository at this point in the history
…e possible, delegated to Make in the maven build. The reason for this is that building the project with maven would take over 20 seconds, whereas with Make, it takes about 2 seconds. Maven will still be used to download java dependencies, and as a frontend to launch the rhino runner.js entry point.
  • Loading branch information
jbeard4 committed Jun 12, 2011
1 parent 41b201d commit 4d39298
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
*.sw*
Session.vim
target
build
25 changes: 25 additions & 0 deletions 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
44 changes: 11 additions & 33 deletions pom.xml
Expand Up @@ -66,20 +66,16 @@
<execution>
<phase>process-classes</phase>
<configuration>
<!-- this is pretty evil: using maven to call ant to call make
still, not too bad. we use maven for what it's good at: downloading java deps and managing classpath
then we use Make for what it's good at: being simple and extremely fast
-->
<tasks>

<copy todir="${project.build.outputDirectory}">
<fileset dir="${basedir}/src/main/javascript"/>
</copy>
<copy todir="${project.build.outputDirectory}/lib">
<fileset dir="${basedir}/lib/js"/>
</copy>
<copy todir="${project.build.outputDirectory}/test">
<fileset dir="${basedir}/src/test"/>
</copy>
<copy todir="${project.build.outputDirectory}">
<fileset dir="${basedir}/src/main/xslt"/>
</copy>
<exec executable="make">
<arg value="-f"/>
<arg value="${basedir}/Makefile"/>
<arg value="scion"/>
</exec>
</tasks>
</configuration>
<goals>
Expand All @@ -88,24 +84,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.voltvoodoo</groupId>
<artifactId>brew</artifactId>
<version>0.2.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!--<goal>optimize</goal>--> <!-- TODO -->
</goals>
</execution>
</executions>
<configuration>
<!--<coffeeSourceDir>${basedir}/src/coffeescript</coffeeSourceDir>
<coffeeOutputDir>${basedir}/target/js</coffeeOutputDir>-->
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand All @@ -126,8 +104,8 @@
<arguments>
<argument>-debug</argument>
<argument>${basedir}/lib/js/r.js</argument>
<argument>${basedir}/src/main/javascript/runner.js</argument>
<argument>${basedir}</argument>
<argument>${basedir}/build/runner.js</argument>
<argument>${basedir}/build</argument>
<argument>scxml/test/rhino-harness</argument>
<!--<argument>test/basic/basic2.json</argument>-->
<argument>${scxmlArgs}</argument>
Expand Down
4 changes: 2 additions & 2 deletions run-tests-rhino-dbg.sh
Expand Up @@ -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 \
"$*"

Expand Down
2 changes: 1 addition & 1 deletion 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="$*"
4 changes: 2 additions & 2 deletions run-tests-rhino.sh
Expand Up @@ -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 \
"$*"

Expand Down
4 changes: 2 additions & 2 deletions src/main/javascript/runner.js
Expand Up @@ -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"
}
Expand Down

0 comments on commit 4d39298

Please sign in to comment.