forked from christophjahn/antdoclet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
172 lines (125 loc) · 4.74 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
<project name="antdoclet-kk-1.2" default="dist" basedir=".">
<description>
This is the main build script for [AntDoclet](https://github.com/dobladez/antdoclet), a tool to automatically
generate documentation for your custom [Ant](http://ant.apache.org)
Tasks.
This version has been enhanced by [Christoph Jahn](https://github.com/christophjahn/antdoclet) witth bug fix contributions by [Kaj Kandler](https://github.com/KajKandler/antdoclet)
</description>
<!-- Property Definitions ====== -->
<property file="build.properties" />
<!-- Directory locations ===== -->
<property name="build.home" value="build" />
<property name="src.home" value="src/java" />
<!-- configure your ant location for build -->
<property name="ant.home" value="apache-ant-1.7.1" />
<property name="lib.home" value="lib" />
<property name="dist.home" value="dist" />
<property name="root.home" value="root" />
<property name="templates.home" value="templates" />
<property name="dist.name" value="antdoclet-kk-1.2" />
<!-- Compilation Classpath ===== -->
<path id="compile.classpath">
<fileset id="ant" dir="${ant.home}">
<include name="**/*.jar" />
</fileset>
<fileset id="libs" dir="${lib.home}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${build.home}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- ALL Target ===== -->
<target name="all" depends="clean,srcdist,dist" description="Build from scratch and create distribution bundle" />
<target name="init">
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/classes" />
<mkdir dir="${dist.home}" />
</target>
<!-- Clean Target ===== -->
<target name="clean" description="Delete old build directories">
<delete dir="${build.home}" />
<delete dir="${dist.home}" />
<delete dir="web" />
<delete file="velocity.log" />
<delete includeemptydirs="true">
<fileset dir="${basedir}">
<include name="output.*/**" />
</fileset>
</delete>
</target>
<!-- Build Target ===== -->
<target name="build" description="Compile all Java code" depends="init">
<javac srcdir="${src.home}" destdir="${build.home}/classes" debug="true" deprecation="true">
<include name="**/*.java" />
<classpath refid="compile.classpath" />
<classpath path="${build.home}/classes" />
</javac>
<jar jarfile="${build.home}/${ant.project.name}.jar">
<fileset dir="${build.home}/classes" />
</jar>
</target>
<!-- Dist. Target ===== -->
<target name="dist" description="Build a binary AntDoclet distribution" depends="build">
<property name="dist.target" value="${dist.home}/${dist.name}" />
<mkdir dir="${dist.target}" />
<copy todir="${dist.target}">
<fileset dir="${root.home}" />
<fileset dir="${basedir}" includes="README.md"/>
</copy>
<mkdir dir="${dist.target}/lib" />
<copy todir="${dist.target}/lib">
<fileset dir="${lib.home}">
<exclude name="markdown*" />
</fileset>
<fileset dir="${build.home}">
<include name="*.jar" />
</fileset>
</copy>
<mkdir dir="${dist.target}/templates" />
<copy todir="${dist.target}/templates">
<fileset dir="${templates.home}" />
</copy>
<delete file="${dist.target}.zip" />
<zip destfile="${dist.target}.zip" basedir="${dist.home}" >
<include name="${dist.name}/**" />
</zip>
</target>
<!-- SrcDist. Target ===== -->
<target name="srcdist" description="Build a source AntDoclet distribution" depends="clean">
<property name="srcdist.target" value="${dist.home}/${dist.name}-src" />
<mkdir dir="${srcdist.target}" />
<copy todir="${srcdist.target}">
<fileset dir="${basedir}/src" >
<exclude name="${dist.home}*/**"/>
<exclude name="fuego*/**"/>
</fileset>
</copy>
<delete file="${srcdist.target}.zip" />
<zip destfile="${srcdist.target}.zip" basedir="${dist.home}" />
</target>
<!-- Web Target ===== -->
<target name="web" description="Generate static project web site" depends="init">
<mkdir dir="web"/>
<concat destfile="web/index.html" append="false">
<header filtering="no" file="src/web/header.html" />
<fileset dir="${basedir}" includes="README.md"/>
<filterchain>
<filterreader classname="com.petebevin.markdown.MarkdownFilter">
<classpath refid="compile.classpath"/>
</filterreader>
</filterchain>
<footer filtering="no" file="src/web/footer.html" />
</concat>
<concat destfile="web/examples.html" append="false">
<header filtering="no" file="src/web/header.html" />
<fileset dir="src/web/" includes="examples.txt"/>
<filterchain>
<filterreader classname="com.petebevin.markdown.MarkdownFilter">
<classpath refid="compile.classpath"/>
</filterreader>
</filterchain>
<footer filtering="no" file="src/web/footer.html" />
</concat>
</target>
</project>