-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
173 lines (151 loc) · 4.48 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
import com.github.spotbugs.SpotBugsTask
/*
* Copyright 2021 Cyface GmbH
*
* This file is part of the Cyface Crawler.
*
* The Cyface Crawler is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Cyface Crawler is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Cyface Crawler. If not, see <http://www.gnu.org/licenses/>.
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:6.2.2'
}
}
plugins {
id 'eclipse'
id 'idea'
//noinspection SpellCheckingInspection
id 'com.github.johnrengelman.shadow' version '6.1.0' apply false
id "com.github.spotbugs" version "3.0.0" apply false
}
wrapper {
gradleVersion = '6.3'
}
repositories {
mavenCentral()
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'maven-publish'
apply plugin: 'com.github.spotbugs'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'java'
group = 'de.cyface'
version = '1.0.1'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
checkstyle {
toolVersion = '8.31'
// use one common config file for all subprojects
configFile = project(':').file("config/checkstyle/checkstyle.xml")
//noinspection SpellCheckingInspection
configProperties = ["suppressionFile": project(':').file("config/checkstyle/suppressions.xml")]
ignoreFailures = true
showViolations = true
}
}
ext {
commonsLangVersion = '3.9'
commonsCliVersion = '1.4'
orgJsonVersion = '20200518'
httpClientVersion = '4.5.10'
slf4jVersion = '1.7.29'
jdbcPostgresDriverVersion = '42.2.6'
mongoDatabaseVersion = '4.2.2'
// Versions of testing dependencies
junitVersion = '5.6.1'
mockitoVersion = '3.3.3'
hamcrestVersion = '2.2'
jacocoVersion = '0.8.5'
spotBugsPluginVersion = '1.10.1'
}
// Code Quality Checker
dependencies {
// Testing Dependencies
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
spotbugsPlugins "com.h3xstream.findsecbugs:findsecbugs-plugin:$spotBugsPluginVersion"
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
jacoco {
toolVersion = "$jacocoVersion"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled true
html.destination file("${buildDir}/reports/jacocoHtml")
}
}
spotbugs {
toolVersion = '4.0.2'
ignoreFailures = true
excludeFilter = file("$rootProject.projectDir/config/spotbugs/excludeFilter.xml")
}
tasks.withType(SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
pluginClasspath = project.configurations.spotbugsPlugins
}
pmd {
toolVersion = '6.22.0'
//noinspection GroovyAssignabilityCheck
incrementalAnalysis = true
ruleSetFiles = project(':').files('config/pmd.xml')
rulePriority = 4
ruleSets = []
// There are so many violations and currently it is not really important in this application.
ignoreFailures = true
}
// Definitions for the maven-publish Plugin
publishing {
// The following repositories are used to publish artifacts to.
repositories {
maven {
name = 'github'
url = uri("https://maven.pkg.github.com/cyface-de/crawler")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD")
}
}
maven {
name = 'local'
url = "file://${rootProject.buildDir}/repo"
}
}
}
}