forked from palych-piter/Excel2DB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
130 lines (94 loc) · 2.95 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
group 'excel2db'
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
version '3.0'
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
}
}
sourceSets {
main {
java {
exclude 'src/main/resources/excel2db.properties'
}
}
}
//For building a single jar with all dependencies run "gradlew shadowJar"
// Configure the shadow jar task
shadowJar {
// exclude properties file from jar
exclude('excel2db.properties')
mergeServiceFiles()
//here we set a name format of jar file
archiveName = "excel2db-${version}.${extension}"
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
compile 'ch.qos.logback:logback-classic:1.2.2'
compile 'javax.persistence:persistence-api:1.0.2'
compile ('org.springframework:spring-context:4.3.7.RELEASE'){
exclude module: 'commons-logging' // force Spring to use jcl-over-slf4j bridge
}
compile 'org.springframework.boot:spring-boot-starter-test:1.5.3.RELEASE'
compile 'org.apache.poi:poi:4.0.1'
compile 'org.apache.poi:poi-ooxml:4.0.1'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'org.postgresql:postgresql:42.2.5'
compile 'org.mongodb:mongodb-driver:3.5.0'
//jdbc drivers -- oracle, the Oracle driver is officially NOT shared in the Maven Repo
//because of license aspects
compile files('libs/ojdbc6.jar')
//Derby is used as a mockup object for In-Memory testing
compile 'org.apache.derby:derby:10.13.1.1'
compile('junit:junit:4.12'){
exclude group: 'org.hamcrest'
}
compile 'org.hamcrest:hamcrest-library:1.3'
}
jar {
manifest {
attributes(
"Implementation-Title": "Gradle",
"Implementation-Version": version,
"Main-Class": "excel2db.excel2db"
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
//filtering out test classes, only test suites should be run
test {
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
//exclude certain classes to avoid double running - suites + test classes
exclude '**/InitInputFilesImplTest.class'
exclude '**/PopulateTablePostgresImplTest.class'
exclude '**/PopulateCellsImplTest.class'
}
//the copyFiles task executes right after the shadowJar and copy
//the property and test files into the build folder
task copyFiles {
doLast {
copy {
from 'src/main/resources/excel2db.properties'
into 'build/libs/'
}
copy {
from '/test.xlsx'
into 'build/libs/'
}
}
}
shadowJar.finalizedBy(copyFiles)
}