build.xml 2.63 KB
Newer Older
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
<?xml version="1.0" encoding="UTF-8"?>

<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->

<project name="cnd.asm" default="netbeans" basedir=".">
    <description>Builds, tests, and runs the project org.netbeans.modules.cnd.asm.</description>

    <import file="../nbbuild/templates/projectized.xml"/> 

    <target name="compile" depends="antlr,projectized-common.compile">      
    </target>
  
    <target name="init-antlr">
        <property name="asm.output.dir" location="src/org/netbeans/modules/cnd/asm/base/generated"/>
        <property name="asm.base.dir" location="src/org/netbeans/modules/cnd/asm/base"/>
        <property name="antlr.jar" location="${cluster}/modules/org-netbeans-modules-cnd-antlr.jar"/>        
        <property name="d_antlr.jar" location="../../antlr/build/org-netbeans-modules-cnd-antlr.jar"/>
        <property name="asm.grammar.dir.att" location="src/org/netbeans/modules/cnd/asm/base/att"/>
        <property name="asm.grammar.dir.dis" location="src/org/netbeans/modules/cnd/asm/base/dis"/>
        <property name="asm.grammar.dir.ident" location="src/org/netbeans/modules/cnd/asm/base/ident"/>
    </target>
    
    <target name="clean-antlr" depends="projectized-common.clean, init-antlr">
        <delete dir="${asm.grammar.dir.att}"/>           
        <delete dir="${asm.grammar.dir.dis}"/> 
    </target>
    
    <target name="antlr" depends="init-antlr" unless="up-to-date">
        <mkdir dir="${asm.output.dir}"/>   
        <copy file="${asm.base.dir}/AntlrTokenTypes.txt" 
              tofile="${asm.output.dir}/AntlrTokenTypes.txt"
              overwrite="true"/>
        <java classname="org.netbeans.modules.cnd.antlr.Tool" fork="true">
            <arg value="-o"/>
            <arg value="${asm.output.dir}"/>
            <arg value="${asm.grammar.dir.att}/ATTScanner.g"/>
            <classpath path="${antlr.jar}"/>
        </java> 
        <java classname="org.netbeans.modules.cnd.antlr.Tool" fork="true">
            <arg value="-o"/>
            <arg value="${asm.output.dir}"/>
            <arg value="${asm.grammar.dir.dis}/DisScanner.g"/>
            <classpath path="${antlr.jar}"/>
        </java> 
        <java classname="org.netbeans.modules.cnd.antlr.Tool" fork="true">
            <arg value="-o"/>
            <arg value="${asm.output.dir}"/>
            <arg value="${asm.grammar.dir.ident}/IdentScanner.g"/>
            <classpath path="${antlr.jar}"/>
        </java>       
    </target>   
                
</project>