-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
200 lines (176 loc) · 4.89 KB
/
Copy pathbuild.gradle
File metadata and controls
200 lines (176 loc) · 4.89 KB
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
197
198
199
200
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html
*/
// Docker dependencies and properties
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.bmuschko:gradle-docker-plugin:3.2.3"
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
}
}
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.6.3'
}
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: "com.bmuschko.docker-java-application"
apply plugin: 'org.junit.platform.gradle.plugin'
// You can add additional instructions to the dockerfile using dockerDistTar and Dockerfile task dsl:
//dockerDistTar {
//instruction {'RUN ls -la'}
//environmentVariable('JAVA_OPTS', '-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap')
//}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
test {
java {
srcDir 'src/test/java'
}
}
}
docker {
javaApplication {
baseImage = 'openjdk:8'
//maintainer = '<name> "<email>"'
// ports = [9090, 5701]
tag = 'kmeans:1.0'
}
}
// Java Application Dependencies & properties
sourceCompatibility = 1.8
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// For internal usage
compile 'com.google.guava:guava:21.0'
// Compile all jars in the lib directory of the project
//compile fileTree(dir:'lib', include: ['*.jar'])
// JUnit Jupiter API and TestEngine implementation
testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0")
testCompile("org.junit.platform:junit-platform-runner:1.0.0")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0")
}
findbugs {
ignoreFailures = true
toolVersion = "3.0.1"
effort = "max"
//findbugsTest.enabled=false
sourceSets = [sourceSets.main]
}
pmd {
ignoreFailures = true
//pmdTest.enabled = false
toolVersion = '5.8.1'
consoleOutput = true
sourceSets = [sourceSets.main, sourceSets.test]
ruleSets = [
'java-basic',
'java-braces',
'java-clone',
'java-codesize',
//'java-comments',
//'java-controversial',
'java-coupling',
'java-design',
'java-empty',
'java-finalizers',
'java-imports',
'java-junit',
'java-naming',
'java-optimizations',
'java-strictexception',
'java-strings',
'java-sunsecure',
'java-typeresolution',
'java-unnecessary',
'java-unusedcode'
]
}
checkstyle {
// Whether to allow the build to continue if there are warnings. Default: ignoreFailures = false
ignoreFailures = true
sourceSets = [sourceSets.main]
// Checkstyle version
toolVersion "8.10"
}
junitPlatform {
// platformVersion '1.1.0'
filters {
engines {
include 'junit-jupiter'
// exclude 'custom-engine'
}
tags {
// include 'fast'
exclude 'slow'
}
// includeClassNamePattern '.*Test'
}
// configurationParameter 'junit.jupiter.conditions.deactivate', '*'
enableStandardTestTask true
reportsDir file("${buildDir}/test-results/junit-platform") // this is the default
//logManager 'org.apache.logging.log4j.jul.LogManager'
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '4.6.1'
}
tasks.withType(FindBugs) {
reports {
xml.enabled false
html.enabled true
}
}
jacocoTestReport {
// Show code coverage results
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
executionData fileTree(project.rootDir.absolutePath).include("**/${buildDir}/jacoco/*.exec")
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
reports {
xml.enabled true
xml.destination "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
csv.enabled false
html.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.html")
}
}
test {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Always run tests, even when nothing changed.
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
finalizedBy jacocoTestReport
}
// Main class
mainClassName = 'map.main/MainTest'