commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r988281 - /commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml
Date Mon, 23 Aug 2010 19:45:42 GMT
Author: jbeard
Date: Mon Aug 23 19:45:42 2010
New Revision: 988281

URL: http://svn.apache.org/viewvc?rev=988281&view=rev
Log:
Updated compile class and jar targets to use parameters.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml?rev=988281&r1=988280&r2=988281&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml Mon Aug 23 19:45:42 2010
@@ -31,6 +31,7 @@
 
 	<!-- classpath configuration stuff -->
 	<path id="rhino-classpath" location="lib/java/js.jar"/>
+	<path id="closure-classpath" location="lib/js/requirejs/build/lib/closure/compiler.jar"/>
 
 	<path id="xslt-processor-classpath" location="lib/java/xalan.jar"/>
 
@@ -796,17 +797,45 @@
 	<target name="run-all-unit-tests" 
 		depends="run-unit-tests-with-selenium,run-in-browser-unit-tests-with-selenium,run-unit-tests-with-rhino"
/>
 
+	<property name="src" value="src"/>
+
+
+	<property name="lib" location="lib"/>
+	<property name="lib-java" location="${lib}/java"/>
+	<property name="lib-js" location="${lib}/js"/>
+	<property name="lib-test-java" location="${lib}/test-java"/>
+	<property name="lib-test-js" location="${lib}/test-js"/>
+
+	<property name="build" location="build"/>
+	<property name="build-js" location="${build}/build-js"/>
+	<property name="build-class" location="${build}/class"/>
+	<property name="build-jar" location="${build}/jar"/>
+
+	<property name="build-js-main" location="${build-js}/main-built.js"/>
+	<property name="build-class-main-name" value="SCXMLCompiler"/>
+	<property name="build-class-main" location="${build-class}/${build-class-main-name}.class"/>
+	<property name="build-jar-main" location="${build-jar}/scxml-js.jar"/>
+
+	<property name="build-js-main-rhino-frontend-module" value="${src}/javascript/scxml/cgf/build/rhino"/>
+
+	<property name="js-build-script" location="${lib-js}/requirejs/build/build.js"/>
+	<property name="js-build-dir" location="${lib-js}/requirejs/build"/>
+
+	<property name="test" location="test"/>
+
 	<!-- build standalone executable -->
 	<target name="compile-single-js">
+		<mkdir dir="${build-js}"/>
+
 		<java classname="org.mozilla.javascript.tools.shell.Main">
 			<classpath>
 				<pathelement location="lib/java/js.jar"/>
 				<pathelement location="lib/js/requirejs/build/lib/closure/compiler.jar"/>
 			</classpath>
-			<arg value="${basedir}/lib/js/requirejs/build/build.js"/>
-			<arg value="${basedir}/lib/js/requirejs/build"/>
-			<arg value="name=src/javascript/scxml/cgf/build/rhino"/> 
-			<arg value="out=build/main-built.js"/>
+			<arg value="${js-build-script}"/>
+			<arg value="${js-build-dir}"/>
+			<arg value="name=${build-js-main-rhino-frontend-module}"/> 
+			<arg value="out=${build-js-main}"/>
 			<arg value="baseUrl=."/>
 			<arg value="includeRequire=true"/>
 			<arg value="inlineText=true"/> 
@@ -815,24 +844,39 @@
 	</target>
 
 	<target name="compile-single-class" depends="compile-single-js">
+		<mkdir dir="${build-class}"/>
+
+		<!-- TODO: set -opt -->
 		<java classname="org.mozilla.javascript.tools.jsc.Main">
 			<classpath>
-				<pathelement location="lib/java/js.jar"/>
+				<path refid="rhino-classpath"/>
+				<path refid="closure-classpath"/>
 			</classpath>
-			<arg value="build/main-built.js"/>
+			<arg value="-o"/>
+			<arg value="${build-class-main-name}.class"/>
+			<arg value="${build-js-main}"/>
 		</java>
+		<move file="${build-js}/${build-class-main-name}.class" todir="${build-class}"/>
 	</target>
 
+	<target name="jar-single-class" depends="compile-single-class">
+		<mkdir dir="${build-jar}"/>
+
+		<jar destfile="${build-jar-main}"
+			basedir="${build-class}"
+			includes="${build-class-main-name}.class">
+			<manifest>
+				<attribute name="Main-Class" value="${build-class-main-name}" />
+			</manifest>
+		</jar>
+	</target>
+
+	<!-- these targets are here to do a simple test of the compiled jar and class-->
 	<target name="run-single-class" depends="compile-single-class">
-		<java classname="main_built" output="build/out.js">
+		<java classname="${build-class-main-name}" output="build/out.js">
 			<classpath>
-				<pathelement location="lib/java/js.jar"/>
-				<pathelement location="lib/java/commons-cli.jar"/>
-				<pathelement location="lib/java/serializer.jar"/>
-				<pathelement location="lib/java/xalan.jar"/>
-				<pathelement location="lib/java/xercesImpl.jar"/>
-				<pathelement location="lib/java/xml-apis.jar"/>
-				<pathelement location="build/"/>
+				<path refid="scxml-js-compiler-classpath"/>
+				<pathelement location="${build-class}"/>
 			</classpath>
 			<arg value="--backend"/>
 			<arg value="state"/>
@@ -841,27 +885,11 @@
 		</java>
 	</target>
 
-	<target name="jar-single-class" depends="compile-single-class">
-	    <jar destfile="build/scxml-js.jar"
-		 basedir="build"
-		 includes="main_built.class">
-	      <manifest>
-		<attribute name="Main-Class" value="main_built" />
-	      </manifest>
-	    </jar>
-	</target>
-
-
 	<target name="run-single-jar" depends="jar-single-class">
-		<java classname="main_built" output="build/out.js">
+		<java classname="${build-class-main-name}" output="build/out.js">
 			<classpath>
-				<pathelement location="lib/java/js.jar"/>
-				<pathelement location="lib/java/commons-cli.jar"/>
-				<pathelement location="lib/java/serializer.jar"/>
-				<pathelement location="lib/java/xalan.jar"/>
-				<pathelement location="lib/java/xercesImpl.jar"/>
-				<pathelement location="lib/java/xml-apis.jar"/>
-				<pathelement location="build/scxml-js.jar"/>
+				<path refid="scxml-js-compiler-classpath"/>
+				<pathelement location="${build-jar-main}"/>
 			</classpath>
 			<arg value="--backend"/>
 			<arg value="state"/>
@@ -870,6 +898,5 @@
 		</java>
 	</target>
 
-	<target name="all" depends="run-single-jar"/>
 </project>
 



Mime
View raw message