-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.gradle
97 lines (84 loc) · 2.28 KB
/
tasks.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
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
checkstyle {
configFile = file("$rootDir/build_config/checkstyle.xml")
toolVersion = 8.2
}
checkstyleMain {
source = fileTree(dir: 'src/main', include: '**/*.java')
}
checkstyleTest {
source = fileTree(dir: 'src/test', include: '**/*.java')
}
task jarSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'source'
}
task testJar(type: Jar) {
from sourceSets.test.output
classifier = 'tests'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://dl.bintray.com/sudiptosarkar/maven"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
artifact jarSources
}
maven(MavenPublication) {
from components.java
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
model {
tasks.generatePomFileForMavenPublication {
destination = file("$buildDir/libs/" + rootProject.name + "-" + rootProject.version + ".pom")
}
}
build {
dependsOn testJar
dependsOn install
}
test {
testLogging {
// showStandardStreams = true
useJUnit()
exceptionFormat = 'full'
afterSuite { desc, result ->
if (desc.className) { // will match the outermost suite
println "\n Test Suite: " + desc.className
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)\n"
}
}
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport