forked from mehulsbhatt/db-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
229 lines (217 loc) · 7.1 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
buildscript {
repositories {
jcenter()
}
}
plugins {
id "net.ltgt.errorprone" version "0.0.11"
id 'net.researchgate.release' version '2.6.0'
id "com.jfrog.bintray" version "1.7.3"
id 'com.github.ben-manes.versions' version '0.15.0'
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
repositories {
mavenCentral()
jcenter()
}
dependencies {
def springVersion = '4.3.7.RELEASE'
compile 'org.slf4j:slf4j-api:1.7.24',
"org.springframework:spring-jdbc:${springVersion}",
"org.springframework:spring-tx:${springVersion}",
"org.springframework:spring-context:${springVersion}"
compileOnly 'com.google.code.findbugs:jsr305:3.0.1',
'com.google.code.findbugs:annotations:3.0.1'
testCompile "org.springframework:spring-test:${springVersion}",
'com.opentable.components:otj-pg-embedded:0.9.0',
'org.postgresql:postgresql:9.4.1208',
'junit:junit:4.12',
'org.apache.logging.log4j:log4j-core:2.8.2',
'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2',
'org.mockito:mockito-core:1.10.19',
'com.tngtech.archunit:archunit-junit:0.4.0',
'nl.jqno.equalsverifier:equalsverifier:2.3.2',
'com.github.marschall:memoryfilesystem:1.0.0'
testCompileOnly 'com.google.code.findbugs:jsr305:3.0.1',
'com.google.code.findbugs:annotations:3.0.1'
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
jar {
manifest {
attributes(
'Implementation-Version': "$project.version",
'Implementation-Title': "$project.name",
'Built-By': java.lang.System.getProperty('user.name'),
'Built-Date': new Date().format('yyyy-MM-dd'),
'Copyright': '2017 NBCO Yandex.Money LLC',
'License': 'MIT'
)
}
from(projectDir.absolutePath) {
include "CHANGELOG.md", "README.md"
into "META-INF"
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
release {
git {
requireBranch = 'master'
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'findbugs'
dependencies {
findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.0.3',
'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
}
findbugs {
toolVersion = "3.0.1"
sourceSets = [sourceSets.main]
effort = "max"
reportLevel = "medium"
ignoreFailures = false
}
tasks.withType(FindBugs) {
reports {
html.enabled = true
xml.enabled = false
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'checkstyle'
checkstyle {
toolVersion = "8.1"
sourceSets = [sourceSets.main]
ignoreFailures = false
configFile = file("checkstyle.xml")
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'idea'
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
vcs = 'Git'
}
module {
downloadJavadoc = true
downloadSources = true
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'jdepend'
jdepend {
ignoreFailures = false
sourceSets = [sourceSets.main]
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
test {
systemProperty "file.encoding", "UTF-8"
testLogging {
events "skipped", "failed"
exceptionFormat "full"
showExceptions true
showCauses true
showStackTraces true
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: "jacoco"
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'INSTRUCTION'
minimum = 0.90
}
limit {
counter = 'BRANCH'
minimum = 0.80
}
limit {
counter = 'CLASS'
minimum = 0.99
}
}
}
}
jacocoTestReport {
reports {
html.enabled = true
xml.enabled = true
}
}
check.dependsOn jacocoTestCoverageVerification
check.dependsOn jacocoTestReport
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'maven'
apply plugin: 'maven-publish'
javadoc {
exclude "**/internal/**"
options {
docEncoding = 'UTF-8'
charSet = 'UTF-8'
encoding = 'UTF-8'
failOnError = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId 'ru.yandex.money.common'
artifactId 'db-queue'
version project.version
artifact sourcesJar
artifact javadocJar
}
}
}
bintrayUpload.onlyIf { !project.version.endsWith("-SNAPSHOT") }
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['MyPublication']
dryRun = false
publish = true
pkg {
name = 'db-queue'
repo = 'maven'
userOrg = 'yandex-money'
desc = ' Worker-queue implementation on top of Java and database'
websiteUrl = 'https://github.com/yandex-money/db-queue'
issueTrackerUrl = 'https://github.com/yandex-money/db-queue/issues'
vcsUrl = 'https://github.com/yandex-money/db-queue.git'
licenses = ['MIT']
labels = ['postgresql', 'queue', 'java', 'database']
publicDownloadNumbers = true
githubRepo = 'yandex-money/db-queue'
githubReleaseNotesFile = 'README.md'
version {
name = project.version
released = new Date()
vcsTag = project.version
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////