1
+ <!--
2
+
3
+ Copyright 2005 Bytecode Pty Ltd.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+
17
+ -->
18
+
19
+ <project name =" opencsv" default =" jar" >
20
+
21
+ <target name =" init" description =" Initialise build parameters" >
22
+ <property name =" src.dir" location =" src" />
23
+ <property name =" test.dir" location =" test" />
24
+ <property name =" doc.dir" location =" doc" />
25
+ <property name =" classes.dir" location =" build/classes" />
26
+ <property name =" test.classes.dir" location =" build/test.classes" />
27
+ <property name =" deploy.dir" location =" deploy" />
28
+ <property name =" lib.dir" location =" lib" />
29
+ <property name =" app.name" value =" opencsv" />
30
+
31
+ <!-- where resulting binaries are placed -->
32
+ <property name =" dist.src.dir" location =" ${ deploy.dir } /src" />
33
+
34
+ <!-- Setup our version info -->
35
+ <property name =" version.file" value =" build.version" />
36
+ <property file =" ${ version.file } " />
37
+
38
+ <property name =" build.version.brief"
39
+ value=" ${ build.release.major } .${ build.release.minor } " />
40
+ <property name =" build.version"
41
+ value=" ${ build.version.brief } .${ build.number } " />
42
+ <property name =" build.version.tag"
43
+ value=" Release_${ build.release.major } _${ build.release.minor } _${ build.number } " />
44
+
45
+ <property name =" zip.dir.name"
46
+ value=" ${ app.name } -${ build.release.major } .${ build.release.minor } " />
47
+
48
+ <mkdir dir =" ${ deploy.dir } " />
49
+
50
+ <!-- Setup a useful classpath -->
51
+ <path id =" useful.jars" >
52
+ <fileset dir =" ${ lib.dir } " >
53
+ <include name =" **/*.jar" />
54
+ </fileset >
55
+ </path >
56
+
57
+ </target >
58
+
59
+ <target name =" build" depends =" init" description =" Compile opencsv" >
60
+
61
+ <mkdir dir =" ${ classes.dir } " />
62
+
63
+ <javac srcdir =" ${ src.dir } " destdir =" ${ classes.dir } "
64
+ classpathref=" useful.jars" />
65
+
66
+ </target >
67
+
68
+ <target name =" jar" depends =" clean,build" description =" Create opencsv jar file" >
69
+ <mkdir dir =" ${ deploy.dir } " />
70
+
71
+ <tstamp >
72
+ <format property =" build.timestamp" pattern =" yyyy-MM-dd HH:mm:ss" locale =" en" />
73
+ </tstamp >
74
+
75
+ <jar destfile =" ${ deploy.dir } /${ app.name } -${ build.version.brief } .jar"
76
+ basedir=" ${ classes.dir } " >
77
+ <include name =" **/*.class" />
78
+ <manifest >
79
+ <attribute name =" Build-Timestamp" value =" ${ build.timestamp } " />
80
+ <attribute name =" Implementation-Title" value =" ${ app.name } " />
81
+ <attribute name =" Implementation-Version" value =" ${ build.version.brief } " />
82
+ </manifest >
83
+ </jar >
84
+ </target >
85
+
86
+ <target name =" deploy.src" depends =" jar,javadoc"
87
+ description=" Deploys a source code distro" >
88
+
89
+ <delete dir =" ${ dist.src.dir } /${ zip.dir.name } " />
90
+ <mkdir dir =" ${ dist.src.dir } /${ zip.dir.name } " />
91
+
92
+ <copy todir =" ${ dist.src.dir } /${ zip.dir.name } " >
93
+ <fileset dir =" ${ basedir } " >
94
+ <include name =" src/**/*.*" />
95
+ <include name =" test/**/*.*" />
96
+ <include name =" lib/**/*.*" />
97
+ <include name =" doc/**/*.*" />
98
+ <include name =" examples/**/*.*" />
99
+ <include name =" deploy/*.jar" />
100
+ </fileset >
101
+ <fileset dir =" ${ basedir } " includes =" *.*" />
102
+ </copy >
103
+
104
+ <property name =" src.tar.name"
105
+ value=" ${ dist.src.dir } /${ zip.dir.name } -src-with-libs.tar" />
106
+
107
+ <tar destfile =" ${ src.tar.name } " basedir =" ${ dist.src.dir } "
108
+ includes=" ${ zip.dir.name } /**/*.*" />
109
+
110
+ <gzip src =" ${ src.tar.name } " destfile =" ${ src.tar.name } .gz" />
111
+
112
+ <delete file =" ${ src.tar.name } " />
113
+
114
+ </target >
115
+
116
+ <target name =" test" depends =" build" description =" Runs junit test suite" >
117
+
118
+ <mkdir dir =" ${ test.classes.dir } " />
119
+
120
+ <javac srcdir =" ${ test.dir } " destdir =" ${ test.classes.dir } "
121
+ classpathref=" useful.jars" >
122
+ <classpath >
123
+ <pathelement location =" ${ classes.dir } " />
124
+ </classpath >
125
+
126
+ </javac >
127
+
128
+ <java classname =" au.com.bytecode.opencsv.CSVReaderTest" >
129
+ <classpath >
130
+ <pathelement location =" ${ lib.dir } /junit.jar" />
131
+ <pathelement location =" ${ classes.dir } " />
132
+ <pathelement location =" ${ test.classes.dir } " />
133
+ </classpath >
134
+ </java >
135
+
136
+ </target >
137
+
138
+ <target name =" clean" depends =" init" description =" Remove all class files" >
139
+ <delete dir =" ${ classes.dir } " />
140
+ <delete dir =" ${ test.classes.dir } " />
141
+ <delete dir =" ${ deploy.dir } " />
142
+ </target >
143
+
144
+ <target name =" version" depends =" init"
145
+ description=" Update the version file and tag the CVS build" >
146
+
147
+ <cvs command =" update ${ version.file } " failonerror =" true" />
148
+
149
+ <propertyfile file =" ${ version.file } "
150
+ comment=" OpenCSV Version Build Properties File." >
151
+ <entry key =" build.number" type =" int" default =" 0" operation =" +"
152
+ pattern=" 000" />
153
+ <entry key =" build.release.minor" type =" int"
154
+ value=" ${ build.release.minor } " pattern =" 0" />
155
+ <entry key =" build.release.major" type =" int"
156
+ value=" ${ build.release.major } " pattern =" 0" />
157
+ <entry key =" build.date" type =" date" value =" now" />
158
+ <entry key =" build.user" type =" string" value =" ${ user.name } " />
159
+ </propertyfile >
160
+
161
+ <cvs command =" commit -m Release ${ version.file } " failonerror =" true" />
162
+
163
+ <property file =" ${ version.file } " />
164
+
165
+ <echo >CVS Tag is ${ build.version.tag } . Version is ${ build.version } </echo >
166
+
167
+ <cvs command =" tag -R ${ build.version.tag } " failonerror =" true" />
168
+
169
+ </target >
170
+
171
+ <target name =" javadoc" depends =" init"
172
+ description=" Generate javadoc for the package" >
173
+
174
+ <javadoc packagenames =" au.com.bytecode.opencsv.*" sourcepath =" src"
175
+ defaultexcludes=" yes" destdir =" ${ doc.dir } /api" author =" true" version =" true"
176
+ use=" true" windowtitle =" opencsv API ${ build.version.brief } " >
177
+ <doctitle ><![CDATA[ <h1>opencsv</h1>]]>
178
+ </doctitle >
179
+ <bottom ><![CDATA[ <i>Copyright © 2005-2006 <a href="http://www.bytecode.com.au"/>Bytecode Pty Ltd.</a></i>]]>
180
+ </bottom >
181
+
182
+ </javadoc >
183
+
184
+ </target >
185
+
186
+ </project >
0 commit comments