-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
159 lines (126 loc) · 4.51 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
id 'io.freefair.lombok' version "8.6"
id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version "1.1.0"
}
group 'it.firegloves'
version '1.10.1'
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
}
def poiVersion = '5.2.5'
def comonsLang3Version = '3.14.0'
def comonsMath3Version = '3.6.1'
def comonsCollectionsVersion = '4.4'
def slf4jVersion = '2.0.13'
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
implementation (group: 'org.apache.poi', name: 'poi-ooxml', version: poiVersion) {
exclude group: 'org.apache.commons', module: 'commons-compress'
}
// TODO remove when poi-ooxml will update its dependency
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.26.2'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation group: 'org.apache.commons', name: 'commons-lang3', version: comonsLang3Version
// https://mvnrepository.com/artifact/org.apache.commons/commons-math3
implementation group: 'org.apache.commons', name: 'commons-math3', version: comonsMath3Version
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
implementation group: 'org.apache.commons', name: 'commons-collections4', version: comonsCollectionsVersion
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
////////// TEST DEPENDENCIES
// junit
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
testImplementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.4.0'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.11.0'
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
testImplementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.4.0'
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'MemPOI'
description = 'A library to simplify export from database to Excel files using Apache POI'
url = 'https://github.com/firegloves/MemPOI'
inceptionYear = '2019'
scm {
url = 'https://github.com/firegloves/MemPOI.git'
connection = 'scm:git:git://github.com/firegloves/MemPOI.git'
developerConnection = 'cm:git:ssh://github.com/firegloves/MemPOI.git'
}
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'firegloves'
name = 'Luca Corsetti'
email = '[email protected]'
}
}
}
from(components.java)
}
}
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// JACOCO START
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacoco {
toolVersion = "0.8.11"
reportsDirectory = layout.buildDirectory.dir("reports/jacoco")
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(false)
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
includes = [ 'it.firegloves.mempoi.*' ]
minimum = 0.7
}
}
}
dependsOn jacocoTestReport
}
check.dependsOn jacocoTestCoverageVerification
// JACOCO END