-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
93 lines (72 loc) · 1.98 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
/*
* Copyright (c) teris.io & Oleg Sklyar, 2018. All rights reserved
*/
import java.nio.file.Paths
buildscript {
repositories.jcenter()
dependencies.add("classpath", "com.silvertern.gradle:nox:0.15.0")
}
version = "0.1.0"
group = "io.teris.caffeinated"
plugins.apply(JavaPlugin)
repositories.jcenter()
dependencies {
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
compile("com.github.ben-manes.caffeine:caffeine:2.6.2")
testCompile("junit:junit:4.12")
testCompile("org.mockito:mockito-core:2.12.0")
testCompile("org.awaitility:awaitility:3.1.0")
}
// OSGi manifest generation
plugins.apply(nox.OSGi)
jar.manifest {
spec(group + "." + name, version)
}
// test and release
plugins.apply(JacocoPlugin)
plugins.apply(MavenPlugin)
task("integration", type: Test) {
enabled = false
dependsOn(test)
}
tasks.withType(AbstractCompile) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
tasks.withType(Test) {
jacoco {
append = true
destinationFile = Paths.get((String) buildDir.absolutePath, "jacoco", (String) name + ".exec").toFile()
}
}
jacocoTestReport.reports {
xml.enabled = false
html.enabled = false
csv.enabled = false
}
task("sourcesJar", type: Jar, dependsOn: classes) {
classifier = "sources"
from(sourceSets.main.allSource)
}
javadoc {
setFailOnError(false)
options.addStringOption('Xdoclint:none', '-quiet')
}
task("javadocJar", type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from(javadoc.destinationDir)
}
task("coverage", type: JacocoReport) {
dependsOn(integration)
executionData(fileTree(Paths.get(rootProject.buildDir.absolutePath, "jacoco").toFile()).include("*.exec"))
setSourceDirectories(files(sourceSets.main.java.srcDirs))
setClassDirectories(files(sourceSets.main.output))
reports {
xml.enabled = true
xml.setDestination(Paths.get((String) buildDir.absolutePath, "reports", "jacoco", "report.xml").toFile())
html.enabled = false
csv.enabled = false
}
}
artifacts.add("archives", sourcesJar)
artifacts.add("archives", javadocJar)