-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
101 lines (85 loc) · 4.24 KB
/
build.xml
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
<!--
Redline Smalltalk is licensed under the MIT License
Redline Smalltalk Copyright (c) 2010 James C. Ladd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<project name="redline-smalltalk" default="package" basedir=".">
<description>Redline Smalltalk Build file.</description>
<property environment="env"/>
<property name="src" location="src"/>
<property name="out" location="out"/>
<property name="lib" location="lib"/>
<property name="jar.out" location="${out}"/>
<property name="jar.name" location="${jar.out}/${ant.project.name}.jar"/>
<property name="grammar.lib" location="${lib}/antlr-3.3-complete.jar"/>
<property name="grammar.src" location="${src}/main/grammar"/>
<property name="grammar.out" location="${src}/main/generated"/>
<property name="java.src" location="${src}/main/java"/>
<property name="java.out" location="${out}"/>
<property name="java.test.src" location="${src}/test/java"/>
<property name="java.test.out" location="${java.out}"/>
<property name="java.src.version" value="1.5"/>
<property name="test.results.out" location="${out}/test-results"/>
<path id="build-classpath">
<fileset dir="${lib}" includes="**/*.jar"/>
</path>
<target name="init">
<tstamp/>
<mkdir dir="${out}"/>
</target>
<target name="clean" description="Clean-up artefacts.">
<delete dir="${out}"/>
<delete dir="${grammar.out}"/>
</target>
<target name="generate" description="Generate sources from grammar." depends="init">
<java jar="${grammar.lib}" fork="true">
<arg value="-o"/>
<arg value="${grammar.out}/st/redline/smalltalk/interpreter"/>
<arg value="${grammar.src}/Smalltalk.g"/>
</java>
</target>
<target name="compile" description="Compile sources." depends="generate">
<javac source="${java.src.version}" srcdir="${grammar.out};${java.src}" destdir="${out}" classpathref="build-classpath" includeAntRuntime="false" debug="true"/>
<javac source="${java.src.version}" srcdir="${java.test.src}" destdir="${java.test.out}" classpathref="build-classpath" includeAntRuntime="false" debug="true"/>
</target>
<target name="unit-test" description="Unit-Test." depends="compile">
<delete dir="${test.results.out}"/>
<mkdir dir="${test.results.out}"/>
<junit printsummary="yes" haltonerror="true">
<classpath>
<path refid="build-classpath"/>
<path location="${java.out}"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.results.out}">
<fileset dir="${java.test.src}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="test" description="Test." depends="clean, unit-test"/>
<target name="build" description="Generate, Compile and Test sources." depends="test"/>
<target name="jar" description="Create a Java Archive." depends="build">
<mkdir dir="${jar.out}"/>
<delete file="${jar.name}"/>
<jar destfile="${jar.name}" basedir="${out}" includes="st/**" excludes="st/**/*Test.class, st/redline/testsupport/**">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Vendor" value="Redline"/>
<attribute name="Implementation-Title" value="Smalltalk"/>
<attribute name="Implementation-Version" value="snapshot"/>
</manifest>
</jar>
</target>
<target name="package" description="Package Redline Smalltalk for use." depends="jar"/>
</project>