Home | History | Annotate | Download | only in project
      1 <project name="Antlr3ActionScriptRuntime" basedir="." default="all">
      2 
      3 	<property environment="env"/>
      4 	<property name="build.dir" value="${basedir}/build"/>
      5 	<property name="build.lib.dir" value="${build.dir}/lib"/>
      6 	<property name="build.doc.dir" value="${build.dir}/doc"/>
      7 	<property name="build.test.dir" value="${build.dir}/test"/>
      8 	<property name="build.test.output.dir" value="${build.test.dir}/output"/>
      9 	<property name="src.dir" value="${basedir}/src"/>
     10 	
     11 	<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
     12 	
     13 	<!-- Assume SDK 3.0 or greater has the ant tasks -->
     14 	<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
     15 	<taskdef resource="com/adobe/ac/ant/tasks/tasks.properties" classpath="${basedir}/lib/FlexAntTasks.jar"/>
     16 
     17 	<fileset id="sources" dir="${src.dir}">
     18 		<include name="**/*.as"/>
     19 	</fileset>
     20 	
     21 	<pathconvert property="sourceClasses" refid="sources" pathsep=" ">
     22 		<filtermapper>
     23 			<replacestring from="${src.dir}/" to=""/>		<!-- Strip off directory -->
     24 			<replacestring from=".as" to=""/>				<!-- Strip off extension -->
     25 			<replacestring from="/" to="."/>				<!-- Convert path to package -->
     26 		</filtermapper>
     27 	</pathconvert>
     28 	
     29 	<target name="all" depends="build"/>
     30 	
     31 	<target name="check-env">
     32 		<fail>
     33 	     <condition>
     34 	       <not>
     35 	         <isset property="FLEX_HOME"/>
     36 	       </not>
     37 	     </condition>
     38 	   </fail>
     39 	</target>
     40 	
     41 	<target name="build" depends="check-env">
     42 		<echo>File are ${sourceClasses}</echo>
     43 		<compc output="${build.lib.dir}/antlr3.swc" include-classes="${sourceClasses}">
     44 			<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
     45 			<source-path path-element="${basedir}/src"/>
     46 		</compc>
     47 	</target>
     48 	
     49 	<target name="compile-tests">
     50 		<mxmlc debug="true" file="${basedir}/test/Antlr3Test.mxml" output="${build.test.dir}/testAntlr3.swf">
     51 			<source-path path-element="${basedir}/test"/>
     52             <!-- List of SWC files or directories that contain SWC files. -->
     53             <compiler.library-path dir="${basedir}" append="true">
     54                 <include name="lib/*.swc" />
     55                 <include name="build/lib/*.swc" />
     56             </compiler.library-path>
     57 		</mxmlc>
     58 	</target>
     59 	
     60 	<target name="test" depends="compile-tests">
     61 		<flexunit timeout="0" swf="${build.test.dir}/testAntlr3.swf" toDir="${build.test.output.dir}" haltonfailure="false"/> 
     62 		<junitreport toDir="${build.test.output.dir}">
     63 			<fileset dir="${build.test.output.dir}">
     64 			    <include name="TEST-*.xml"/>
     65 			  </fileset>
     66 			  <report format="frames" todir="${build.test.output.dir}/html"/>
     67 		</junitreport>
     68 	</target>
     69 		
     70 	<target name="clean">
     71 		<delete dir="${build.dir}"/>
     72 	</target>
     73 	
     74 	<target name="docs">
     75 		<exec executable="${FLEX_HOME}/bin/aasdoc" failonerror="true">
     76 			<arg line="-doc-sources ${src.dir}"/>
     77 			<arg line="-window-title 'ANTLR 3 Runtime'"/>
     78 			<arg line="-output ${build.doc.dir}"/>
     79 		</exec>
     80 		<zip destfile="${build.dir}/antlr3-asdoc.zip">
     81 			<zipfileset dir="${build.doc.dir}" prefix="asdoc"/>
     82 		</zip>
     83 	</target>
     84 </project>
     85