~ubuntu-branches/ubuntu/breezy/antlr/breezy

« back to all changes in this revision

Viewing changes to examples/csharp/cpp/cpp.build

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-06-29 16:11:22 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050629161122-g81crc3z92p5xhsg
Tags: 2.7.5-6ubuntu4
Build depend on java-gcj-compat-dev, depend on java-gcj-compat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<project name="calc" default="test">
 
3
    <tstamp/>
 
4
    <property name="debug" value="true"/>
 
5
    <property name="project.name" value="ANTLR example - cpp"/>
 
6
    <property name="project.FormalName" value="cpp"/>
 
7
 
 
8
    <property name="src.dir" value="."/>
 
9
    <property name="build.dir" value="bin"/>
 
10
    <property name="antlr.dir" value="..\..\.."/>
 
11
 
 
12
    <echo message="Building project: '${project.name}'"/>
 
13
 
 
14
    <target name="clean" description="cleans up everything">
 
15
        <echo message="Deleting directory '${build.dir}': You should rebuild VS.NET project in '${build.dir}\..'."/>
 
16
        <delete file="cppLexer.cs" failonerror="false"/>
 
17
        <delete file="cppLexerTokenTypes.cs" failonerror="false"/>
 
18
        <delete file="cppLexerTokenTypes.txt" failonerror="false"/>
 
19
        <delete dir="${build.dir}" failonerror="false"/>
 
20
    </target>
 
21
 
 
22
    <target name="generate" description="calls ANTLR to generate Lexers/Parsers">       
 
23
        <exec program="java.exe" commandline="-cp ${antlr.dir} antlr.Tool cpp.g" failonerror="true"/>
 
24
    </target>
 
25
 
 
26
    <target name="release" depends="clean" description="build non-debug version">
 
27
        <!-- build a clean release distribution for release -->
 
28
        <property name="debug" value="false"/>
 
29
        <echo message="Debug = ${debug}"/>
 
30
        <call target="build"/>
 
31
    </target>
 
32
    
 
33
    <target name="build" depends="generate" description="compiles the source code">
 
34
        <mkdir dir="${build.dir}"/>
 
35
        <!-- copy the assemblies required to build example to the build folder -->
 
36
        <copy file="${antlr.dir}\lib\csharp\src\bin\antlr.runtime.dll" tofile="${build.dir}\antlr.runtime.dll" />
 
37
 
 
38
        <!-- compile example's ${project.name}.exe -->
 
39
        <csc target="exe" output="${build.dir}\${project.FormalName}.exe" debug="${debug}">
 
40
            <sources basedir="${src.dir}">
 
41
                <includes name="**/*.cs"/>
 
42
            </sources>
 
43
            <references>
 
44
                <includes name="${build.dir}\antlr.runtime.dll"/>
 
45
            </references>
 
46
            <arg value="/nowarn:1591"/>
 
47
        </csc>
 
48
    </target>
 
49
 
 
50
    <!--
 
51
        Perform unit tests.  If a unit test fails, the build fails.
 
52
        The base directory is set to the Test directory so that tests can easily
 
53
        load external data files wihtout having to worry about complicated paths.
 
54
    -->
 
55
    <target name="test" depends="build" description="run unit tests">
 
56
                <sysinfo verbose="false" />
 
57
        <exec program="${sys.os.folder.system}\command.com" commandline="/C ${build.dir}\${project.FormalName}.exe &lt; ${src.dir}\cpp.in" failonerror="true"/>        
 
58
    </target>
 
59
</project>