File: build.xml

package info (click to toggle)
libnb-platform18-java 12.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 729,800 kB
  • sloc: java: 5,059,097; xml: 574,432; php: 78,788; javascript: 29,039; ansic: 10,278; sh: 6,386; cpp: 4,612; jsp: 3,643; sql: 1,097; makefile: 540; objc: 288; perl: 277; haskell: 93
file content (121 lines) | stat: -rw-r--r-- 5,206 bytes parent folder | download | duplicates (3)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->

<project name="ide/lexer-gen" default="compile-src" basedir=".">

  <property name="lexer.module.root" location=".."/>
  <property name="src.demo" location="src/org/netbeans/modules/lexer/demo"/>
  <!-- <property name="build.compiler.debug" value="on"/> -->
  <!-- <property name="build.compiler.deprecation" value="on"/> -->

  <target name="compile-base">
    <ant dir="${lexer.module.root}" target="netbeans" inheritAll="false"/>
    <ant dir="${lexer.module.root}/gen" target="compile" inheritAll="false"/>
  </target>

  <target name="compile-src" depends="compile-base">
    <mkdir dir="build/classes"/>
    <javac srcdir="src" destdir="build/classes"
           deprecation="${build.compiler.deprecation}"
           debug="${build.compiler.debug}">
      <classpath>
        <pathelement location="${lexer.module.root}/build/classes"/>
        <fileset id="antlr.runtime" dir="${lexer.module.root}/external">
          <include name="ide/antlr*.jar"/>
        </fileset>
      </classpath>
    </javac>
  </target>

  <target name="lexer-type-check" unless="lexer.type">
    <fail message="Use -Dlexer.type=antlr to specify 'antlr' lexer type or 'javacc', 'handcoded/plain' or 'handcoded/link'."/>
  </target>

  <target name="compile" depends="lexer-type-check" description="Generate/compile lexer sources">
    <ant dir="${src.demo}/${lexer.type}" target="compile" inheritAll="false"/>
  </target>

  <target name="demo" depends="lexer-type-check" description="Run editor pane demo">
    <ant dir="${src.demo}/${lexer.type}" target="demo" inheritAll="false"/>
  </target>

  <target name="test" depends="lexer-type-check" description="Run random test to verify lexer correctness">
    <ant dir="${src.demo}/${lexer.type}" target="test" inheritAll="false"/>
  </target>

  <target name="clean" depends="lexer-type-check" description="Clean class files and generated sources">
    <ant dir="${src.demo}/${lexer.type}" target="clean" inheritAll="false"/>
  </target>

  <target name="rebuild" depends="lexer-type-check" description="Clean then Compile">
    <ant dir="${src.demo}/${lexer.type}" target="rebuild" inheritAll="false"/>
  </target>

  <target name="compile-all" depends="compile-base">
    <!-- compile all known lexers -->
    <ant dir="${src.demo}/antlr" target="compile" inheritAll="false"/>
    <ant dir="${src.demo}/javacc" target="compile" inheritAll="false"/>
    <ant dir="${src.demo}/handcoded/plain" target="compile" inheritAll="false"/>
    <ant dir="${src.demo}/handcoded/link" target="compile" inheritAll="false"/>

    <antcall target="compile-src"/>
  </target>

  <target name="clean-base">
    <ant dir="${lexer.module.root}" target="clean" inheritAll="false"/>
    <ant dir="${lexer.module.root}/gen" target="clean" inheritAll="false"/>
  </target>

  <target name="clean-src">
    <delete quiet="true">
      <fileset dir="build"/>
    </delete>
  </target>

  <target name="clean-all" depends="clean-base, clean-src">
    <!-- clean all known lexers -->
    <ant dir="${src.demo}/antlr" target="clean" inheritAll="false"/>
    <ant dir="${src.demo}/javacc" target="clean" inheritAll="false"/>
    <ant dir="${src.demo}/handcoded/plain" target="clean" inheritAll="false"/>
    <ant dir="${src.demo}/handcoded/link" target="clean" inheritAll="false"/>
  </target>

  <target name="rebuild-all" depends="clean-all, compile-all">
  </target>
  
  <target name="help">
    <echo message="Targets that require lexer type such as -Dlexer.type=antlr for 'antlr' lexer type"/>
    <echo message="    or 'javacc', 'handcoded/plain' or 'handcoded/link':"/>
    <echo message="compile     Generate demo language sources and compile them (Requires JDK1.4)"/>
    <echo message="demo        Run demo editor pane (Requires JDK1.4)"/>
    <echo message="test        Run random test that checks generated lexer correctness (Requires JDK1.4)"/>
    <echo message="clean       Clean generated language sources and class files"/>
    <echo message="rebuild     Clean then Compile"/>
    <echo message=""/>
    <echo message="Global targets:"/>
    <echo message="compile-all Generate all demo languages and compile all demo sources"/>
    <echo message="clean-all   Clean all demo language sources and classes"/>
    <echo message="rebuild-all Run clean-all followed by compile-all targets"/>
  </target>

</project>