-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
196 lines (167 loc) · 6.56 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
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies {
classpath group: 'com.bmuschko', name: 'gradle-clover-plugin', version: '3.0.1'
classpath group: 'com.github.ben-manes', name: 'gradle-versions-plugin', version: '0.38.0'
classpath group: 'me.champeau.gradle', name: 'jmh-gradle-plugin', version: '0.5.3'
classpath group: 'org.owasp', name: 'dependency-check-gradle', version: '6.1.5'
classpath group: 'gradle.plugin.com.github.spotbugs.snom', name: 'spotbugs-gradle-plugin', version: '4.7.0'
classpath group: 'org.ajoberstar.reckon', name: 'reckon-gradle', version: '0.13.0'
}
}
apply plugin: 'idea'
apply plugin: 'org.ajoberstar.reckon'
apply plugin: 'com.github.ben-manes.versions'
description = """Measure behavior of critical components in production"""
subprojects {
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'com.bmuschko.clover'
apply plugin: 'com.github.spotbugs'
apply plugin: 'org.owasp.dependencycheck'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'io.ultrabrew.' + rootProject.name
archivesBaseName = rootProject.name + '-' + name
repositories {
mavenCentral()
}
dependencies {
compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.9'
testImplementation group: 'org.jmockit', name: 'jmockit', version: '1.44'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.3.2'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
clover group: 'org.openclover', name: 'clover', version: '4.2.1'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
}
test {
useJUnitPlatform()
// Required as of JMockIt 1.42
// https://jmockit.github.io/tutorial/Introduction.html#runningTests
doFirst {
jvmArgs "-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}"
}
testLogging {
events 'passed', 'skipped', 'failed'
}
reports {
html.enabled = true
}
}
clover {
targetPercentage = '100.000%'
report {
html = true
testResultsDir = project.tasks.getByName('test').reports.junitXml.destination
testResultsInclude = 'TEST-*.xml'
}
}
check.dependsOn cloverGenerateReport, dependencyCheckAnalyze
dependencyCheck {
skipConfigurations = ['clover', 'jmh', 'spotbugs']
format = 'ALL'
failBuildOnCVSS = 4.0
cve {
// workaround to the broken NVD files: https://github.com/jeremylong/DependencyCheck/issues/3306
urlModified = "https://freedumbytes.gitlab.io/setup/nist-nvd-mirror/nvdcve-1.1-modified.json.gz"
urlBase = "https://freedumbytes.gitlab.io/setup/nist-nvd-mirror/nvdcve-1.1-%d.json.gz"
}
}
spotbugsMain.reports {
html.enabled = true
}
spotbugsTest {
enabled = false
}
java {
withJavadocJar()
withSourcesJar()
}
reckon {
scopeFromProp()
snapshotFromProp()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from components.java
pom {
name = project.name
project.afterEvaluate {
description = project.description
}
url = 'http://ultrabrew.io'
scm {
connection = 'scm:git:git://github.com/ultrabrew/metrics.git'
developerConnection = 'scm:git:ssh://github.com:ultrabrew/metrics.git'
url = 'https://github.com/ultrabrew/metrics.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'mmannerm'
name = 'Mika Mannermaa'
}
developer {
id = 'smrutilal2'
name = 'Smruti Ranjan Sahoo'
}
developer {
id = 'lonemeow'
name = 'Ilpo Ruotsalainen'
}
developer {
id = 'manolama'
name = 'Chris Larsen'
}
developer {
id = 'arungupta'
name = 'Arun Gupta'
}
}
}
}
}
repositories {
maven {
def snapshotRepository = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
def stagingRepository = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
afterEvaluate {
url = version.toString().endsWith('-SNAPSHOT') ? snapshotRepository : stagingRepository
}
credentials {
username = System.getenv('OSS_USER')
password = System.getenv('OSS_PASSWORD')
}
}
}
}
signing {
if (project.hasProperty('signingKey') && project.hasProperty('signingPassword')) {
def signingKeyEncoded = findProperty("signingKey")
def signingKey = new String(signingKeyEncoded.decodeBase64())
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}
// disable the tasks for the 'examples' aggregator project
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.forEach {
if (it.project.name == 'examples') {
it.onlyIf { false }
}
}
}
}