-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
159 lines (128 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
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies {
classpath group: 'com.bmuschko', name: 'gradle-clover-plugin', version: '2.2.2'
classpath group: 'com.github.ben-manes', name: 'gradle-versions-plugin', version: '0.20.0'
classpath group: 'me.champeau.gradle', name: 'jmh-gradle-plugin', version: '0.4.8'
classpath group: 'org.owasp', name: 'dependency-check-gradle', version: '5.3.2.1'
classpath group: 'gradle.plugin.com.github.spotbugs', name: 'spotbugs-gradle-plugin', version: '2.0.0'
classpath group: 'org.ajoberstar.reckon', name: 'reckon-gradle', version: '0.9.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'
apply plugin: 'maven-publish'
apply plugin: 'com.bmuschko.clover'
apply plugin: 'com.github.spotbugs'
apply plugin: 'org.owasp.dependencycheck'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'io.ultrabrew.' + rootProject.name
archivesBaseName = rootProject.name + '-' + name
repositories {
jcenter()
}
dependencies {
compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.9'
testCompile group: 'org.jmockit', name: 'jmockit', version: '1.44'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.2'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.3.2'
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.2'
testCompile 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.8.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
}
spotbugs {
sourceSets = [sourceSets.main]
}
spotbugsMain.reports {
xml.enabled = false
html.enabled = true
}
spotbugsTest.reports {
xml.enabled = false
html.enabled = true
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc.options {
noQualifiers << 'java.*'
}
reckon {
scopeFromProp()
snapshotFromProp()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
afterEvaluate {
artifactId = archivesBaseName
}
}
}
repositories {
maven {
def artifactory = 'https://oss.jfrog.org/artifactory/oss-snapshot-local'
def bintray = 'https://api.bintray.com/maven/ultrabrew/m2/' + rootProject.name + '/;publish=1'
afterEvaluate {
url = version.toString().endsWith('-SNAPSHOT') ? artifactory : bintray
}
credentials {
username = System.getenv('BINTRAY_USER')
password = System.getenv('BINTRAY_API_KEY')
}
}
}
}
// disable the tasks for the 'examples' aggregator project
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.forEach {
if (it.project.name == 'examples') {
it.onlyIf { false }
}
}
}
}