-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
101 lines (90 loc) · 3.36 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
<project name="whilelang" default="jarfile">
<property name="version" value="0.3"/>
<!-- ============================================== -->
<!-- Build Commands -->
<!-- ============================================== -->
<target name="build">
<javac debug="true" debuglevel="vars,lines,source" source="1.6" includeantruntime="true" classpath="">
<src path="src"/>
<include name="*/**"/>
<exclude name="whilelang/testing/**"/>
<exclude name="*/**/package-info.java"/>
</javac>
</target>
<!-- ============================================== -->
<!-- Documenation -->
<!-- ============================================== -->
<target name="doc">
<javadoc
destdir="docs/api"
author="true"
version="true"
use="true"
windowtitle="While Lang Compiler API">
<doctitle><![CDATA[<h1>The While Lang Compiler (v${version})</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2013 David J. Pearce. All Rights Reserved.</i>]]></bottom>
<packageset dir="src">
<include name="whilelang/**"/>
<exclude name="whilelang/testing/**"/>
</packageset>
</javadoc>
</target>
<!-- ============================================== -->
<!-- Distribution -->
<!-- ============================================== -->
<target name="jarfile" depends="build">
<mkdir dir="lib"/>
<mkdir dir="tmp"/>
<manifest file="tmp/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="whilelang.Main"/>
</manifest>
<jar destfile="lib/whilelang-v${version}.jar" manifest="tmp/MANIFEST.MF">
<fileset dir="src">
<include name="whilelang/**/*.java"/>
<include name="whilelang/**/*.class"/>
</fileset>
</jar>
<delete dir="tmp"/>
<echo message="============================================="/>
<echo message="BUILT: lib/whilelang-${version}.jar"/>
<echo message="============================================="/>
</target>
<target name="dist" depends="jarfile">
<mkdir dir="whilelang-v${version}"/>
<copy todir="whilelang-v${version}">
<fileset dir=".">
<include name="LICENSE"/>
<include name="build.xml"/>
<include name="src/**/*.java"/>
<include name="tests/**/*.while"/>
<include name="lib/*-v${version}.jar"/>
</fileset>
</copy>
<tar destfile="dist/whilelang-src-v${version}.tar" longfile="gnu">
<tarfileset dir="." includes="whilelang-v${version}/**/*"/>
</tar>
<gzip destfile="dist/whilelang-src-v${version}.tgz" src="dist/whilelang-src-v${version}.tar"/>
<delete file="dist/whilelang-src-v${version}.tar"/>
<delete dir="whilelang-v${version}"/>
<echo message="============================================="/>
<echo message="BUILT: dist/whilelang-src-v${version}.tgz"/>
<echo message="============================================="/>
</target>
<!-- ============================================== -->
<!-- Misc Commands -->
<!-- ============================================== -->
<target name="clean">
<delete includeEmptyDirs="true" failonerror="false">
<fileset file="*~"/>
<fileset dir="lib"/>
<fileset dir="dist"/>
<fileset dir="docs"/>
<fileset dir="tests">
<include name="**/*.class"/>
<include name="**/*.wyil"/>
<include name="**/*.o"/>
</fileset>
</delete>
</target>
</project>