forked from iNamik/Java-Text-Table-Formatter
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
244 lines (212 loc) · 5.86 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?xml version="1.0"?>
<!-- $Id: build.xml,v 1.4 2010/07/25 03:20:55 dave Exp $ -->
<project name="iNamik Text Table Formatter" basedir="." default="all">
<!-- timestamps -->
<tstamp/>
<!-- load properties -->
<property file="build.properties" />
<!-- Ensure build version is defined -->
<fail unless="build.version" message="Missing Property: build.version" />
<!-- Ensure source dir is defined -->
<fail unless="src.dir" message="Missing Property: src.dir" />
<!-- Ensure build dir is defined -->
<fail unless="build.dir" message="Missing Property: build.dir" />
<!-- Ensure dist dir is defined -->
<fail unless="dist.dir" message="Missing Property: dist.dir" />
<!-- set classpath -->
<path id="build.cp">
<pathelement path="${java.class.path}"/>
<!--
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib-build">
<include name="**/*.jar"/>
</fileset>
-->
</path>
<echo message="${java.class.path}" />
<!-- init -->
<target name="init" unless="init.built">
<!-- make sure dist directory is created -->
<mkdir dir="${dist.dir}" />
<mkdir dir="${build.dir}" />
<!-- set init.built so multiple calls won't waste time -->
<property name="init.built" value="true"/>
</target>
<!-- all -->
<target name="all" depends="init,jars,version,license,zips,tars" description="Build everything."/>
<!-- classes -->
<target name="classes" depends="init" unless="classes.built">
<mkdir dir="${build.dir}/classes" />
<javac
srcdir = "${src.dir}"
destdir = "${build.dir}/classes"
source = "1.3"
classpathref = "build.cp"
debug = "on"
/>
<!-- copy non-java files -->
<!--
<copy todir="${build.dir}/classes" verbose="true">
<fileset dir="${src.dir}" excludes="**/*.java"/>
</copy>
-->
<property name="classes.built" value="true"/>
</target>
<!-- jars -->
<target name="jars" depends="init,classes" unless="jars.built">
<jar destfile="${dist.dir}/${project.name}.jar" basedir="${build.dir}/classes"/>
<property name="jars.built" value="true"/>
</target>
<!-- tars -->
<target name="tars" depends="init,jars" unless="tars.built">
<!-- src -->
<tar destfile="${dist.dir}/${project.name}-src.tar.gz" compression="gzip">
<!-- build -->
<tarfileset
dir = "."
prefix = "${project.name}"
includes = "build.xml,build.properties"
/>
<!-- src -->
<tarfileset
dir="${src.dir}"
prefix="${project.name}/src"
/>
<!-- version -->
<tarfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "VERSION.txt"
/>
<!-- license -->
<tarfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "LICENSE.txt"
/>
<!-- text files -->
<tarfileset
dir = "."
prefix = "${project.name}"
includes = "${dist.text_files}"
/>
</tar>
<!-- main dist -->
<tar destfile="${dist.dir}/${project.name}.tar.gz" compression="gzip">
<!-- jar -->
<tarfileset
dir = "${dist.dir}"
prefix = "${project.name}"
includes = "${project.name}.jar"
/>
<!-- version -->
<tarfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "VERSION.txt"
/>
<!-- license -->
<tarfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "LICENSE.txt"
/>
<!-- text files -->
<tarfileset
dir = "."
prefix = "${project.name}"
includes = "${dist.text_files}"
/>
</tar>
<property name="tars.built" value="true"/>
</target>
<!-- zips -->
<target name="zips" depends="init,jars" unless="zips.built">
<!-- src -->
<zip destfile="${dist.dir}/${project.name}-src.zip">
<!-- build -->
<zipfileset
dir = "."
prefix = "${project.name}"
includes = "build.xml,build.properties"
/>
<!-- src -->
<zipfileset
dir = "${src.dir}"
prefix = "${project.name}/src"
/>
<!-- version -->
<zipfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "VERSION.txt"
/>
<!-- license -->
<zipfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "LICENSE.txt"
/>
<!-- text files -->
<zipfileset
dir = "."
prefix = "${project.name}"
includes = "${dist.text_files}"
/>
</zip>
<!-- main dist -->
<zip destfile="${dist.dir}/${project.name}.zip">
<zipfileset
dir = "${dist.dir}"
prefix = "${project.name}"
includes = "${project.name}.jar"
/>
<!-- version -->
<zipfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "VERSION.txt"
/>
<!-- license -->
<zipfileset
dir = "${build.dir}"
prefix = "${project.name}"
includes = "LICENSE.txt"
/>
<!-- text files -->
<zipfileset
dir = "."
prefix = "${project.name}"
includes = "${dist.text_files}"
/>
</zip>
<property name="zips.built" value="true"/>
</target>
<!-- version -->
<target name="version">
<copy file="VERSION.txt" todir="${build.dir}" />
<replace file="${build.dir}/VERSION.txt" token="@build.version@" value="${build.version}" />
<replace file="${build.dir}/VERSION.txt" token="@build.date@" value="${TODAY}" />
<copy file="${build.dir}/VERSION.txt" todir="${dist.dir}" />
</target>
<!-- license -->
<target name="license">
<copy file="LICENSE.txt" todir="${build.dir}" />
<replace file="${build.dir}/LICENSE.txt" token="@build.version@" value="${build.version}" />
<copy file="${build.dir}/LICENSE.txt" todir="${dist.dir}" />
</target>
<!-- clean-all -->
<target name="clean-all" depends="clean-dist,clean-work"/>
<!-- clean -->
<target name="clean" depends="clean-work"/>
<!-- clean-dist -->
<target name="clean-dist">
<delete dir="${dist.dir}" />
</target>
<!-- clean-work -->
<target name="clean-work">
<delete dir="${build.dir}" />
</target>
</project>