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