-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
156 lines (136 loc) · 4.17 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
plugins {
id 'java-library'
id 'checkstyle'
id 'pmd'
id 'com.github.spotbugs' version "$spotbugsVersion"
id 'jacoco'
id 'maven-publish'
id 'signing'
}
group 'io.github.ricall.junit5-wiremock'
version '2.0.0'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
def initProperty = { if (!project.hasProperty(it)) ext[it]='' }
['deployUsername', 'deployPassword'].forEach(initProperty)
repositories {
mavenCentral()
}
dependencies {
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
implementation "com.github.tomakehurst:wiremock-jre8:$wiremockVersion"
implementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
testImplementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
test {
useJUnitPlatform()
}
checkstyle {
configProperties += [
cacheFile: file('build/checkstyleCache'),
suppressFile: file('config/checkstyle/supressions.xml'),
headerFile: file('config/checkstyle/javaHeader.txt'),
]
}
pmdMain {
ruleSets = []
ruleSetFiles = files("config/pmd/main-ruleset.xml")
}
pmdTest {
ruleSets = []
ruleSetFiles = files("config/pmd/test-ruleset.xml")
}
tasks.matching { it.name.startsWith('spotbugs')}*.reports {
html.enabled = true
}
jacocoTestReport {
finalizedBy jacocoTestCoverageVerification
reports {
html.destination file("$reportsDir/coverage")
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
minimum = 0.5
}
limit {
counter = 'BRANCH'
minimum = 0.4
}
}
}
}
check.dependsOn jacocoTestReport
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'JUnit 5 WireMock Extension'
description = '''\
A JUnit 5 extension library that allows you to run WireMockServer in your JUnit tests.
Operates in a similar fashion to the JUnit4 WireMockRule @Rule classes that ship with Wiremock.
'''.stripIndent()
url = 'https://github.com/ricall/junit5-wiremock'
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'ricall'
name = 'Richard Allwood'
email = 'richard.m.allwood@gmail.com'
timezone = '+10'
}
}
scm {
connection = 'git@github.com:ricall/junit5-wiremock.git'
developerConnection = 'git@github.com:ricall/junit5-wiremock.git'
url = 'https://github.com/ricall/junit5-wiremock'
}
}
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username deployUsername
password deployPassword
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
task install(dependsOn: [build, publishToMavenLocal]) {
group 'Publishing'
description 'Installs artifacts to local Maven repository'
}
task release(dependsOn: [build, publish]) {
group 'Publishing'
description 'Builds everything for the release.'
}