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