forked from microsoft/mssql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
141 lines (127 loc) · 4.29 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
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
/****************************************************************
* Gradle Scipt for Building Microsoft JDBC Driver for SQL Server
****************************************************************
* Instruction for Building JDBC Driver:
* For building particular version of the driver, use commands:
* jre14 - - PS> gradle build
PS> gradle build -PbuildProfile=jre14
* jre11 - - PS> gradle build -PbuildProfile=jre11
* jre8 - - PS> gradle build -PbuildProfile=jre8
*
* For Excluding Groups in command line:
* PS> gradle build -PbuildProfile=jre11 "-PexcludedGroups=['xSQLv15','xGradle']"
****************************************************************/
apply plugin: 'java'
version = '9.1.0-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"
}
}
test {
useJUnitPlatform {
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','reqExternalSetup','NTLM','MSI','clientCertAuth','fedAuth')
}
}
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre14")){
jreVersion = "jre14"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
jar {
manifest {
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
}
}
sourceCompatibility = 14
targetCompatibility = 14
}
if (hasProperty('buildProfile') && buildProfile == "jre11"){
jreVersion = "jre11"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
jar {
manifest {
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
}
}
sourceCompatibility = 11
targetCompatibility = 11
}
if(hasProperty('buildProfile') && buildProfile == "jre8") {
jreVersion = "jre8"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc43.java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
test {
useJUnitPlatform {
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','NTLM','reqExternalSetup','MSI','clientCertAuth','fedAuth','xJDBC42')
}
}
}
jar.archiveFileName = "${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", "AE_Certificates"
output.resourcesDir = testOutputDir
}
}
}
//Get dependencies from Maven central repository
repositories {
mavenCentral()
}
dependencies {
compile 'org.osgi:org.osgi.core:6.0.0',
'org.osgi:org.osgi.compendium:5.0.0'
compileOnly 'com.microsoft.azure:azure-keyvault:1.2.2',
'com.microsoft.azure:azure-keyvault-webkey:1.2.1',
'com.microsoft.rest:client-runtime:1.7.0',
'com.microsoft.azure:adal4j:1.6.4',
'org.antlr:antlr4-runtime:4.7.2',
'com.google.code.gson:gson:2.8.6',
'org.bouncycastle:bcprov-jdk15on:1.64',
'org.bouncycastle:bcpkix-jdk15on:1.64'
testCompile 'org.junit.platform:junit-platform-console:1.5.2',
'org.junit.platform:junit-platform-commons:1.5.2',
'org.junit.platform:junit-platform-engine:1.5.2',
'org.junit.platform:junit-platform-launcher:1.5.2',
'org.junit.platform:junit-platform-runner:1.5.2',
'org.junit.platform:junit-platform-surefire-provider:1.3.2',
'org.junit.jupiter:junit-jupiter-api:5.6.0',
'org.junit.jupiter:junit-jupiter-engine:5.6.0',
'org.junit.jupiter:junit-jupiter-params:5.6.0',
'com.zaxxer:HikariCP:3.4.1',
'org.apache.commons:commons-dbcp2:2.6.0',
'org.slf4j:slf4j-nop:1.7.29',
'org.antlr:antlr4-runtime:4.7.2',
'org.eclipse.gemini.blueprint:gemini-blueprint-mock:2.1.0.RELEASE',
'com.google.code.gson:gson:2.8.6',
'org.bouncycastle:bcprov-jdk15on:1.64',
'com.microsoft.azure:adal4j:1.6.4',
'com.microsoft.azure:azure-keyvault:1.2.2',
'com.microsoft.azure:azure-keyvault-webkey:1.2.1',
'com.h2database:h2:1.4.200'
}