-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
190 lines (163 loc) · 7.02 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<project name="oxdoc" default="jar" basedir=".">
<description>Ant build file for oxdoc</description>
<property file="build.properties"/>
<property name="version" value="1.2beta"/>
<property name="src" location="src"/>
<property name="srcmisc" location="src/misc"/>
<property name="srctest" location="test"/>
<property name="bin" location="bin"/>
<property name="css" location="css"/>
<property name="build" location="build"/>
<property name="docs" location="docs"/>
<property name="zips" location="zips"/>
<property name="javacc" location="lib/" />
<property name="junit" location="lib/junit-4.13.2.jar" />
<property name="mockito" location="lib/mockito-core-5.4.0.jar" />
<property name="byte-buddy" location="lib/byte-buddy-1.14.5.jar" />
<property name="byte-buddy-agent" location="lib/byte-buddy-agent-1.14.5.jar" />
<property name="hamcrest" location="lib/hamcrest-core-1.3.jar" />
<property name="pkg-bin" value="${zips}/oxdoc-${version}-bin" />
<property name="pkg-src" value="${zips}/oxdoc-${version}-src" />
<defaultexcludes add="**/*.bak"/>
<target name="clean">
<delete file="${bin}/oxdoc.jar"/>
<delete file="${src}/Constants.java"/>
<delete dir="${build}"/>
<delete dir="${docs}"/>
<delete>
<fileset dir="${src}/parser" includes="*.java"/>
</delete>
<delete dir="${zips}"/>
</target>
<target name="parser">
<mkdir dir="${src}/parser"/>
<javacc target="${src}/parser/ox.jj" outputdirectory="${src}/parser"
javacchome="${javacc}"
debuglookahead="false"
debugparser="false"
static="false" />
</target>
<target name="doc" depends="parser">
<javadoc packagenames="*"
defaultexcludes="yes"
destdir="${docs}"
use="true"
stylesheetfile="${src}/javadoc.css"
windowtitle="oxdoc Development Documentation">
<fileset dir="src" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<target name="compile" depends="parser">
<mkdir dir="${build}"/>
<javac srcdir="${src}/writeconstants" destdir="${build}" nowarn="on" debug="${debug}" includeantruntime="off" />
<java fork="yes" classname="oxdoc.writeconstants.WriteConstants" classpath="${build}" output="${src}/Constants.java">
<arg value="${version}" />
</java>
<delete file="${build}/OxDoc.class"/>
<delete file="${build}/Constants.class"/>
<javac srcdir="${src}" destdir="${build}" nowarn="on" debug="${debug}" includeantruntime="off" />
</target>
<target name="jar" depends="compile">
<mkdir dir="${bin}"/>
<copy file="${css}/default.css" tofile="${build}/oxdoc/oxdoc.css" />
<copy file="${css}/default-noicons.css" tofile="${build}/oxdoc/oxdoc-noicons.css" />
<copy file="${css}/default-print.css" tofile="${build}/oxdoc/print.css" />
<copy todir="${build}/oxdoc/icons">
<fileset dir="icons" defaultexcludes="yes" includes="*.png" />
</copy>
<jar jarfile="${bin}/oxdoc.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="oxdoc.OxDocCmd" />
</manifest>
</jar>
</target>
<target name="build" depends="jar">
<copy file="${srcmisc}/oxdoc" todir="${bin}" />
<copy file="${srcmisc}/oxdoc.bat" todir="${bin}" />
</target>
<target name="test" depends="build">
<javac srcdir="${srctest}" destdir="${build}" classpath="${junit}:${mockito}" nowarn="on" debug="on" includeantruntime="off" />
<junit fork="true">
<classpath>
<pathelement location="${build}" />
<pathelement location="${junit}"/>
<pathelement location="${mockito}"/>
<pathelement location="${byte-buddy}"/>
<pathelement location="${byte-buddy-agent}"/>
<pathelement location="${hamcrest}"/>
</classpath>
<batchtest>
<fileset dir="${srctest}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<target name="dist" depends="test,pkg-bin,pkg-src">
</target>
<target name="prepare-pkg">
<copy file="README.md" todir="${target}" />
<copy file="LICENSE" todir="${target}" />
<copy todir="${target}/css"> <fileset dir="css" /> </copy>
<copy todir="${target}/example"> <fileset dir="example" /> </copy>
</target>
<target name="pkg-bin" depends="jar">
<antcall target="prepare-pkg"><param name="target" value="${pkg-bin}"/></antcall>
<copy file="manual/manual.pdf" todir="${pkg-bin}/manual" />
<copy file="${srcmisc}/oxdoc" todir="${pkg-bin}/bin" />
<copy file="${srcmisc}/oxdocgui" todir="${pkg-bin}/bin" />
<copy file="${srcmisc}/oxdoc.bat" todir="${pkg-bin}/bin" />
<copy file="${srcmisc}/oxdocgui.bat" todir="${pkg-bin}/bin" />
<copy file="${bin}/oxdoc.jar" todir="${pkg-bin}/bin" />
<copy todir="${pkg-bin}/icons">
<fileset dir="icons" defaultexcludes="yes" includes="*.png" />
</copy>
<zip destfile="${pkg-bin}.zip">
<zipfileset dir="${pkg-bin}" prefix="oxdoc/" />
</zip>
<tar destfile="${pkg-bin}.tar.gz" compression="gzip">
<tarfileset dir="${pkg-bin}" prefix="oxdoc/">
<exclude name="bin/oxdoc"/>
<exclude name="bin/oxdocgui"/>
</tarfileset>
<tarfileset dir="${pkg-bin}" prefix="oxdoc/" filemode="755">
<include name="bin/oxdoc"/>
<include name="bin/oxdocgui"/>
</tarfileset>
</tar>
</target>
<target name="pkg-src" depends="">
<antcall target="prepare-pkg"><param name="target" value="${pkg-src}"/></antcall>
<copy file="build.xml" todir="${pkg-src}" />
<copy file="oxdoc-conv.xml" todir="${pkg-src}" />
<copy todir="${pkg-src}/src">
<fileset dir="${src}" defaultexcludes="yes" excludes="parser/**,*.bak" />
</copy>
<copy todir="${pkg-src}/manual">
<fileset dir="manual" defaultexcludes="yes" includes="*.tex,manual.pdf" />
</copy>
<copy todir="${pkg-src}/icons">
<fileset dir="icons" defaultexcludes="yes" includes="*.png" />
</copy>
<zip destfile="${pkg-src}.zip" basedir="${pkg-src}">
<zipfileset dir="${pkg-src}" prefix="oxdoc/" />
</zip>
<tar destfile="${pkg-src}.tar.gz" basedir="${pkg-src}" compression="gzip">
<tarfileset dir="${pkg-src}" prefix="oxdoc/" />
</tar>
</target>
<target name="rebuild" depends="clean,dist" />
<target name="jalopy">
<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin" />
<jalopy convention="oxdoc-conv.xml">
<fileset dir="./" >
<include name="src/**/*.java" />
<exclude name="src/parser/*.java" />
</fileset>
</jalopy>
</target>
</project>