forked from microsoft/mssql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
94 lines (81 loc) · 2.62 KB
/
build.gradle
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
/****************************************************************
* Gradle Scipt for Building Microsoft JDBC Driver for SQL Server
****************************************************************
* Instruction for Building JDBC Driver:
* For building jre9 version of the driver,
* use command 'gradle build' or 'gradle build -PbuildProfile=build43'
* Whereas, for building jre8 version of the driver,
* use command 'gradle build -PbuildProfile=build42'
****************************************************************/
apply plugin: 'java'
version = '6.5.4-SNAPSHOT'
def jreVersion = ""
def testOutputDir = file("build/classes/java/test")
def archivesBaseName = 'mssql-jdbc'
def excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
allprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
}
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "build43")){
jreVersion = "jre10"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
sourceCompatibility = 10
targetCompatibility = 10
}
if((hasProperty('buildProfile') && buildProfile == "build42")) {
jreVersion = "jre8"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc43.java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
jar.archiveName = "${archivesBaseName}-${version}.${jreVersion}-preview.jar"
jar {
manifest {
attributes 'Title': "Microsoft JDBC Driver ${version} for SQL Server",
'Version': version,
'Vendor': 'Microsoft Corporation'
}
}
sourceSets {
main {
java {
srcDirs 'src/main/java'
exclude excludedFile
}
resources {
srcDirs "$projectDir"
include 'META-INF/services/java.sql.Driver'
}
}
test {
resources {
srcDirs 'src/test/resources'
include '**/*.csv'
output.resourcesDir = testOutputDir
}
}
}
//Get dependencies from Maven central repository
repositories {
mavenCentral()
}
dependencies {
compile 'com.microsoft.azure:azure-keyvault:1.0.0',
'com.microsoft.azure:adal4j:1.5.0'
testCompile 'junit:junit:4.12',
'org.junit.platform:junit-platform-console:1.2.0',
'org.junit.platform:junit-platform-commons:1.2.0',
'org.junit.platform:junit-platform-engine:1.2.0',
'org.junit.platform:junit-platform-launcher:1.2.0',
'org.junit.platform:junit-platform-runner:1.2.0',
'org.junit.platform:junit-platform-surefire-provider:1.2.0',
'org.junit.jupiter:junit-jupiter-api:5.2.0',
'org.junit.jupiter:junit-jupiter-engine:5.2.0',
'com.zaxxer:HikariCP:3.1.0',
'org.apache.commons:commons-dbcp2:2.0'
}