-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
92 lines (77 loc) · 2.77 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
import java.util.regex.Pattern;
import java.util.regex.Matcher;
allprojects {
apply plugin: 'java'
apply plugin: "jacoco"
apply plugin: 'idea'
group = 'org.iconic'
description = """Iconic Framework"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
// Java 8 minimum
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.compilerArgs << "-Xlint:all" << "-Xlint:-processing"
}
dependencies {
compile group: 'io.github.classgraph', name: 'classgraph', version: '4.4.12'
compile group: 'org.projectlombok', name: 'lombok', version: '1.16.16'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
compile group: 'com.google.inject', name: 'guice', version: '4.2.0'
}
// JaCoCo relies on the test task's execution data by default so we need to point it at JUnit 5's task instead.
// Note: we still rely on the test task as JUnit 5 aliases the test command
task junitCodeCoverageReport(type: JacocoReport, dependsOn: test) {
// Use the junitPlatformTest task as our execution data
executionData test
sourceSets sourceSets.main
}
// Run this task to display our test coverage.
task coverage(dependsOn: junitCodeCoverageReport) {
doLast {
String output = new File('build/reports/jacoco/junitCodeCoverageReport/html/index.html').getText('UTF-8')
Matcher matcher = Pattern.compile(/Total.*?([0-9]{1,3})%/).matcher(output);
if (matcher.find()) {
println matcher.group(0)
.replaceAll("\\<[^>]*>", "|")
.replaceAll("\\|\\|", " | ")
.replaceAll("Total", "Total Coverage")
.replaceAll("of", "missed statements out of")
}
}
}
task report(dependsOn: coverage) {
doLast {
exec {
commandLine 'cmd', '/c', 'start', '/max', "build/reports/jacoco/junitCodeCoverageReport/html/index.html"
}
}
}
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0'
}
}
subprojects {
apply plugin: 'com.github.hierynomus.license'
license {
header = file('../LICENSE')
ext.year = new Date().format('yyyy')
ext.name = 'Iconic'
mapping {
fxml='XML_STYLE'
}
excludes(["**/*.txt", "**/*.png", "**/*.jpg", "**/*.jpeg", "**/*.svg"])
}
}