-
Notifications
You must be signed in to change notification settings - Fork 46
/
build.xml
executable file
·241 lines (204 loc) · 9.42 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="compile" name="jtds" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="libs">
<fileset dir="lib" includes="*.jar"/>
</path>
<!-- include maven ant task lib -->
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<target name="init">
<tstamp/>
<property name="build" value="build"/>
<property name="build.compiler" value="modern"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="on"/>
<property name="src" value="src"/>
<property name="dist" value="dist"/>
<property name="test" value="test"/>
<property name="version" value="1.3.3"/>
</target>
<target name="clean" depends="init">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="prepare" depends="init">
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${build}/testclasses"/>
<mkdir dir="${build}/src"/>
<mkdir dir="${build}/testsrc"/>
<mkdir dir="${build}/testrep"/>
<copy todir="${build}/src">
<fileset dir="${src}/main" includes="**/*.java"/>
</copy>
<copy todir="${build}/testsrc">
<fileset dir="${src}/test" includes="**/*.java"/>
</copy>
<copy todir="${build}/classes">
<fileset dir="${src}/main" includes="**/*.properties"/>
</copy>
<copy todir="${build}/testclasses">
<fileset dir="${src}/test" includes="**/*.properties"/>
</copy>
</target>
<target name="compile" depends="init,prepare">
<javac destdir="${build}/classes" srcdir="${build}/src" classpathref="libs" debug="${javac.debug}" optimize="${javac.optimize}" encoding="latin1"/>
</target>
<target name="compile-test" depends="init,prepare,compile">
<javac destdir="${build}/testclasses" srcdir="${build}/testsrc" classpathref="libs" classpath="${build}/classes" debug="${javac.debug}" optimize="${javac.optimize}" encoding="latin1"/>
</target>
<target name="javadoc" depends="prepare">
<mkdir dir="${build}/doc"/>
<javadoc sourcepath="${build}/src;${build}/testsrc" destdir="${build}/doc" packagenames="net.sourceforge.jtds.*" Author="true"
Doctitle="jTDS API Documentation" Use="true" Version="true" bottom="Generated on ${TODAY}"
Windowtitle="jTDS API" Private="true" classpathref="libs" encoding="latin1">
<tag name="todo" description="To do:"/>
<tag name="created" description="Created:"/>
</javadoc>
<!-- create Maven javadoc artifact -->
<jar basedir="${build}/doc"
excludes="**/*Test*/**"
includes="**/*"
jarfile="${build}/${ant.project.name}-${version}-javadoc.jar">
<manifest>
<attribute name="Implementation-Title" value="jTDS JDBC Driver"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-URL" value="http://jtds.sourceforge.net"/>
<attribute name="Specification-Title" value="JDBC"/>
<attribute name="Specification-Version" value="3.0"/>
<attribute name="Main-Class" value="net.sourceforge.jtds.jdbc.Driver"/>
</manifest>
</jar>
<!-- create Maven sources artifact -->
<jar basedir="${build}/src"
excludes="**/*Test*/**"
includes="**/*.java"
jarfile="${build}/${ant.project.name}-${version}-sources.jar">
<manifest>
<attribute name="Implementation-Title" value="jTDS JDBC Driver"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-URL" value="http://jtds.sourceforge.net"/>
<attribute name="Specification-Title" value="JDBC"/>
<attribute name="Specification-Version" value="3.0"/>
</manifest>
</jar>
</target>
<target name="test" depends="compile,compile-test">
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<junit fork="no" haltonfailure="no" printsummary="yes">
<classpath>
<pathelement location="build/classes"/>
<pathelement location="build/testclasses"/>
<path refid="libs"/>
</classpath>
<formatter type="plain"/>
<batchtest todir="${build}/testrep" >
<fileset dir="${build}/testsrc">
<include name="**/*Test.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="dist" depends="clean,compile,javadoc">
<mkdir dir="${dist}"/>
<!-- runtime jar -->
<copy todir="${build}/classes/META-INF">
<fileset dir="${src}/META-INF" includes="**/*"/>
</copy>
<jar basedir="${build}/classes"
excludes="**/*Test*/**"
includes="**/*"
jarfile="${build}/${ant.project.name}-${version}.jar">
<manifest>
<attribute name="Implementation-Title" value="jTDS JDBC Driver"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-URL" value="http://jtds.sourceforge.net"/>
<attribute name="Specification-Title" value="JDBC"/>
<attribute name="Specification-Version" value="3.0"/>
<attribute name="Main-Class" value="net.sourceforge.jtds.jdbc.Driver"/>
</manifest>
</jar>
<!-- source package -->
<mkdir dir="${dist}/tmp"/>
<copy todir="${dist}/tmp/doc">
<fileset dir="${build}/doc" includes="**/*"/>
</copy>
<copy todir="${dist}/tmp">
<fileset dir="." includes="README,README.SSL,README.XA,README.SSO,CHANGELOG,LICENSE,*.bat,*.sh,*.xml,src/**/*,lib/**/*,html/**/*,conf/**/*.xml,conf/**/*.tmpl"/>
</copy>
<zip basedir="${dist}/tmp" includes="**/*" zipfile="${dist}/${ant.project.name}-${version}-src.zip"/>
<delete dir="${dist}/tmp"/>
<!-- binary package -->
<mkdir dir="${dist}/tmp"/>
<copy todir="${dist}/tmp">
<fileset dir="." includes="README,README.SSL,README.XA,README.SSO,CHANGELOG,LICENSE,conf/**/*.xml,conf/**/*.tmpl,html/**/*"/>
<fileset dir="${build}" includes="${ant.project.name}-${version}.jar"/>
</copy>
<mkdir dir="${dist}/tmp/x86/XA"/>
<copy todir="${dist}/tmp/x86/XA">
<fileset dir="lib/x86/XA" includes="JtdsXA.dll"/>
<fileset dir="src/XA" includes="*.sql"/>
</copy>
<mkdir dir="${dist}/tmp/x86/SSO"/>
<copy todir="${dist}/tmp/x86/SSO">
<fileset dir="lib/x86/SSO" includes="ntlmauth.dll"/>
</copy>
<mkdir dir="${dist}/tmp/x64/SSO"/>
<copy todir="${dist}/tmp/x64/SSO">
<fileset dir="lib/x64/SSO" includes="ntlmauth.dll"/>
</copy>
<mkdir dir="${dist}/tmp/IA64/SSO"/>
<copy todir="${dist}/tmp/IA64/SSO">
<fileset dir="lib/IA64/SSO" includes="ntlmauth.dll"/>
</copy>
<zip basedir="${dist}/tmp" includes="**/*" zipfile="${dist}/${ant.project.name}-${version}-dist.zip"/>
<delete dir="${dist}/tmp"/>
</target>
<!-- Maven repository upload, disabled by default -->
<target name="maven_upload" depends="dist" description="deploy release version to Maven staging repository">
<input message="Please enter GPG passphrase:" addproperty="passphrase" />
<!-- define Maven coordinates -->
<property name="groupId" value="jtds.sourceforge.net" />
<property name="artifactId" value="jtds" />
<!-- define artifact names, following the Maven conventions -->
<property name="maven-jar" value="${build}/${artifactId}-${version}.jar" />
<property name="maven-javadoc-jar" value="${build}/${artifactId}-${version}-javadoc.jar" />
<property name="maven-sources-jar" value="${build}/${artifactId}-${version}-sources.jar" />
<!-- defined Maven staging repository ID and URL -->
<property name="maven-staging-repository-id" value="sonatype-nexus-staging" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<!-- sign and deploy the driver artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Dgpg.passphrase=${passphrase}" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-jar}" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Dgpg.passphrase=${passphrase}" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-sources-jar}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Dgpg.passphrase=${passphrase}" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-javadoc-jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>