forked from microsoft/mssql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
103 lines (91 loc) · 3 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
/****************************************************************
* 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 = '7.3.1-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 = "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 == "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 'org.osgi:org.osgi.core:4.3.1',
'org.osgi:org.osgi.compendium:4.3.1'
compileOnly 'com.microsoft.azure:azure-keyvault:1.2.0',
'com.microsoft.azure:azure-keyvault-webkey:1.2.0',
'com.microsoft.rest:client-runtime:1.6.5',
'com.microsoft.azure:adal4j:1.6.3'
testCompile 'org.junit.platform:junit-platform-console:1.4.0',
'org.junit.platform:junit-platform-commons:1.4.0',
'org.junit.platform:junit-platform-engine:1.4.0',
'org.junit.platform:junit-platform-launcher:1.4.0',
'org.junit.platform:junit-platform-runner:1.4.0',
'org.junit.platform:junit-platform-surefire-provider:1.3.2',
'org.junit.jupiter:junit-jupiter-api:5.4.0',
'org.junit.jupiter:junit-jupiter-engine:5.4.0',
'com.zaxxer:HikariCP:3.3.1',
'org.apache.commons:commons-dbcp2:2.6.0',
'org.slf4j:slf4j-nop:1.7.26',
'org.eclipse.gemini.blueprint:gemini-blueprint-mock:2.1.0.RELEASE'
}