This repository was archived by the owner on Feb 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.shared
More file actions
94 lines (79 loc) · 2.05 KB
/
build.shared
File metadata and controls
94 lines (79 loc) · 2.05 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
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
testImplementation (
"junit:junit:4.13.2",
"org.threadly:threadly-test:1.0"
)
implementation (
"org.threadly:threadly:7.0"
)
}
compileJava {
options.compilerArgs << "-Xlint:all"// << "-Werror"
}
compileTestJava {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
plugins.withType(JavaPlugin) {
checkstyle.sourceSets = [sourceSets.main]
}
test {
maxParallelForks = Math.min(8, Math.max(1, (int)(Runtime.getRuntime().availableProcessors() / 2)))
jacoco {
excludes = ['**/package-info**','**/*Test']
destinationFile = file("$buildDir/reports/jacoco/test.exec")
}
getReports().getJunitXml().setDestination(file("$buildDir/reports/tests/xml"))
getReports().getHtml().setDestination(file("$buildDir/reports/tests/html"))
setBinaryResultsDirectory(file("$buildDir/reports/tests/bin"))
}
test.dependsOn("jar")
jacocoTestReport {
reports {
csv.required = false
xml.required = true
xml.destination = file("$buildDir/reports/jacoco/jacoco.xml")
html.required = true
html.destination = file("$buildDir/reports/jacoco/html")
}
doLast {
println "Test results available at:"
println "html - $buildDir/reports/tests/html/index.html"
println "Test coverage reports available at:"
println "html - $buildDir/reports/jacoco/html/index.html"
}
}
test.finalizedBy("jacocoTestReport")
jar {
manifest {
attributes (
'Implementation-Title': 'Ambush',
'Implementation-Version': archiveVersion
)
}
}
javadoc {
source = sourceSets.main.allJava
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PUBLIC
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}