-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
181 lines (149 loc) · 4.35 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
plugins {
id 'java'
id 'idea'
id 'maven'
id 'signing'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.6.3'
}
group = 'io.smartmachine'
ext.releaseVersion = '0.9.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.signRelease = !("$System.env.TRAVIS" == "true")
configurations {
provided
testCompile.extendsFrom provided
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile 'com.couchbase.client:java-client:2.4.5'
compile 'eu.infomas:annotation-detector:3.0.5'
provided 'io.dropwizard:dropwizard-core:1.1.1'
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:2.8.9"
testCompile "io.dropwizard:dropwizard-testing:1.1.1"
}
task integrationTest(type: Test) {
useJUnit {
includeCategories 'io.smartmachine.couchbase.test.IntegrationTests'
}
}
test {
useJUnit {
includeCategories 'io.smartmachine.couchbase.test.UnitTests'
}
}
tasks.withType(Test) {
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
testLogging.showExceptions = true
testLogging.showStackTraces = true
testLogging.showCauses = true
testLogging.exceptionFormat = "full"
beforeTest { descriptor ->
logger.lifecycle("\n* Running test: " + descriptor)
}
systemProperty 'net.spy.log.LoggerImpl', 'net.spy.memcached.compat.log.SLF4JLogger'
}
jacoco {
toolVersion = "0.7.6.201602180812"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
javadoc {
classpath = configurations.compile + configurations.provided
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from "build/docs/javadoc"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
signing {
required {
signRelease
}
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment)}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUser, password: sonatypePassword)
}
pom.project {
name 'dropwizard-couchbase'
packaging 'jar'
description 'Couchbase persistence module for dropwizard.'
url 'http://smartmachine.io/dropwizard-couchbase'
scm {
url 'scm:git@github.com:smartmachine/dropwizard-smartmachine.git'
connection 'scm:git@github.com:smartmachine/dropwizard-smartmachine.git'
developerConnection 'scm:git@github.com:smartmachine/dropwizard-smartmachine.git'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
distribution 'repo'
}
}
developers {
developer {
id 'knutster'
name 'Conrad Christensen'
}
}
}
}
}
}
task release(dependsOn: 'uploadArchives') << {
description 'Build a release version of the library and upload it to Maven Central.'
println "Released version: $version to https://oss.sonatype.org"
}
task snapshot(dependsOn: install) << {
description 'Install a version of this library in the local .m2 repo.'
println "Installed version: $version in local .m2 repo."
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(release)) {
version = releaseVersion
} else {
version = "$releaseVersion-SNAPSHOT"
}
}
sourceSets {
main {
compileClasspath = compileClasspath + configurations.provided
}
}
plugins.withType(IdeaPlugin) {
idea {
module {
scopes.PROVIDED.plus += [configurations.provided]
scopes.COMPILE.minus += [configurations.provided]
scopes.TEST.minus += [configurations.provided]
scopes.RUNTIME.minus += [configurations.provided]
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}