forked from microsoft/mssql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
166 lines (148 loc) · 5.8 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
<project name="sqljdbc" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
----- Building sqljdbc Project -----
</description>
<!-- set global properties for this build -->
<property name="artifactId" value="mssql-jdbc"/>
<property name="version" value="6.1.2"/>
<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="bvtTest" location="src/test/java/com/microsoft/sqlserver/jdbc/bvt/"/>
<property name="bvtTest_Classes" location="${build}/classes/test/bvt"/>
<!-- download dependencies -->
<ivy:resolve>
<dependency org="com.microsoft.azure" name="azure-keyvault" rev="0.9.7"/>
<dependency org="junit" name="junit" rev="4.12"/>
<dependency org="org.junit.platform" name="junit-platform-console" rev="1.0.0-M3"/>
<dependency org="org.junit.platform" name="junit-platform-commons" rev="1.0.0-M3"/>
<dependency org="org.junit.platform" name="junit-platform-engine" rev="1.0.0-M3"/>
<dependency org="org.junit.platform" name="junit-platform-launcher" rev="1.0.0-M3"/>
<dependency org="org.junit.platform" name="junit-platform-runner" rev="1.0.0-M3"/>
<dependency org="org.junit.platform" name="junit-platform-surefire-provider" rev="1.0.0-M3"/>
<dependency org="org.junit.jupiter" name="junit-jupiter-api" rev="5.0.0-M3"/>
<dependency org="org.junit.jupiter" name="junit-jupiter-engine" rev="5.0.0-M3"/>
</ivy:resolve>
<!-- retrieves all the dependencies of the resolve call to lib directory -->
<ivy:retrieve />
<target name="init" >
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${bvtTest_Classes}"/>
</target>
<target name="compile" depends="init"
description="compile the source">
<mkdir dir="${CLASSES_DST_DIR}"/>
<javac srcdir="${src}"
destdir="${CLASSES_DST_DIR}"
fork="yes"
deprecation="on"
encoding="UTF-8"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
debug="true"
debuglevel="${DEBUG_LEVEL}"
excludes="${EXCLUDE_STUBS}" >
<classpath>
<fileset dir="lib"/>
</classpath>
</javac>
</target>
<target name="build41" description="generate the distribution">
<antcall target="compile">
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc41"/>
<param name="JAVA_VERSION" value="1.7"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre7.jar">
<manifest>
<attribute name="Title" value="Microsoft JDBC Driver ${version} for SQL Server"/>
<attribute name="Version" value="${version}"/>
<attribute name="Vendor" value="Microsoft Corporation"/>
</manifest>
<fileset dir="${build}/classes/jdbc41"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test41"/>
</target>
<target name="build42" description="generate the distribution">
<antcall target="compile">
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc42"/>
<param name="JAVA_VERSION" value="1.8"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre8.jar">
<manifest>
<attribute name="Title" value="Microsoft JDBC Driver ${version} for SQL Server"/>
<attribute name="Version" value="${version}"/>
<attribute name="Vendor" value="Microsoft Corporation"/>
</manifest>
<fileset dir="${build}/classes/jdbc42"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test42"/>
</target>
<target name="build" description="generate the distribution">
<antcall target="clean"/>
<antcall target="build41"/>
<antcall target="build42"/>
</target>
<target name="compile_test"
description="compile the junit source">
<javac classpathref="${JDBC_VERSION}" srcdir="${bvtTest}"
destdir="${bvtTest_Classes}"
encoding="UTF-8"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
description="compiling the junit source" >
</javac>
</target>
<target name="Test41" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.7"/>
<param name="JDBC_VERSION" value="test_classpath41"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath41" /></classpath>
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
</junit>
</target>
<target name="Test42" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.8"/>
<param name="JDBC_VERSION" value="test_classpath42"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath42" /></classpath>
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
</junit>
</target>
<path id="test_classpath41">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre7.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>
<path id="test_classpath42">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre8.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>
<target name="clean"
description="clean up">
<delete dir="${build}"/>
</target>
</project>