-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
126 lines (111 loc) · 4.5 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<project name="ajm objects" default="jar">
<property name="VERSION" value="0.9.2"/>
<property environment="env"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="download" location="download"/>
<property name="lib" location="lib"/>
<property name="patch" location="patch"/>
<property name="src" location="src"/>
<property name="jar_name" value="ajm.jar"/>
<property name="dist_name" value="ajm-objects-${VERSION}"/>
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<tstamp>
<format property="BUILD_DATE" pattern="MMMM d, yyyy (HH:mm z)" timezone="GMT" locale="en"/>
</tstamp>
<target name="jar" description="generate ${jar_name} file" depends="compile">
<jar destfile="${lib}/${jar_name}" basedir="${build}">
<manifest>
<attribute name="Library" value="ajm objects (MXJ) for MaxMSP"/>
<attribute name="Version" value="${VERSION}"/>
<attribute name="Author" value="Adam Murray"/>
<attribute name="URL" value="http://compusition.com"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="OS" value="${os.name} ${os.version} (${os.arch})"/>
</manifest>
</jar>
</target>
<target name="compile" description="compile the ajm.objects source, omitting tests" depends="clean">
<mkdir dir="${build}/"/>
<javac destdir="${build}" classpathref="classpath" debug="on" source="1.5" target="1.5" includeantruntime="false">
<src path="${src}"/>
<exclude name="**/*Test.java"/>
</javac>
</target>
<target name="clean" description="delete build artifacts">
<delete dir="${build}"/>
<delete file="${lib}/${jar_name}"/>
<delete dir="${dist}"/>
</target>
<target name="compile_tests" description="compile all ajm.objects source, including tests" depends="clean">
<mkdir dir="${build}/"/>
<javac srcdir="${src}" destdir="${build}" classpathref="classpath" debug="on" source="1.5" target="1.5"/>
</target>
<target name="test" description="run unit tests (requires junit.jar)" depends="compile_tests">
<junit fork="true" >
<classpath>
<path refid="classpath"/>
<path location="${build}"/>
</classpath>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${src}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="javadoc" description="generate standard javadoc documentation">
<javadoc
destdir="doc/api"
author="true"
version="true"
use="true"
classpathref="max.classpath"
windowtitle="ajm.* mxj externals">
<fileset dir="src">
<exclude name="**/*Test.java"/>
</fileset>
<doctitle><![CDATA[<h1>Test</h1>]]></doctitle>
<!-- TODO: put in a creative commons license -->
<bottom><![CDATA[<i>Copyright © 2007-2010 Adam Murray. All Rights Reserved.</i>]]></bottom>
<tag name="attribute" scope="fields" description="<br/>This field is a Max object attribute." />
<tag name="nodoc" scope="all" description="" />
</javadoc>
</target>
<target name="dist" description="package up ajm objects for distribution" depends="clean, jar">
<mkdir dir="${dist}"/>
<copy todir="${dist}">
<fileset dir="${basedir}" includes="*.txt"/>
<fileset dir="${basedir}" includes="*.example"/>
<fileset dir="${basedir}" includes="ajm/**">
<exclude name="**/*cosy*"/> <!-- not ready yet -->
</fileset>
</copy>
<replace dir="${dist}" token="@@VERSION" value="${VERSION}">
<include name="**/*.txt"/>
<include name="**/*.maxpat"/>
<include name="**/*.maxhelp"/>
</replace>
<replace dir="${dist}" token="@@BUILD_DATE" value="${BUILD_DATE}">
<include name="**/*.txt"/>
<include name="**/*.maxpat"/>
<include name="**/*.maxhelp"/>
</replace>
<fixcrlf srcdir="${dist}" includes="*.txt" eol="crlf" eof="asis" /> <!-- So things display properly on Notepad in Windows -->
<zip destfile="${dist}/${dist_name}.zip">
<zipfileset dir="${dist}" includes="*.txt" prefix="${dist_name}"/>
<zipfileset dir="${dist}" includes="*.example" prefix="${dist_name}"/>
<zipfileset dir="${dist}" includes="ajm/**" prefix="${dist_name}"/> <!-- the Max patches -->
<zipfileset dir="${basedir}" includes="lib/**" prefix="${dist_name}">
<exclude name="**/max.jar"/>
<exclude name="**/*junit*.jar"/>
<exclude name="**/bsf.jar"/>
</zipfileset>
<zipfileset dir="${basedir}" includes="license/**" prefix="${dist_name}"/>
</zip>
<delete dir="${dist}" excludes="${dist_name}.zip" includeEmptyDirs="true"/>
</target>
</project>