-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (76 loc) · 2.33 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
}
}
plugins {
id 'application'
id 'java'
id 'jacoco'
}
mainClassName = 'Main'
group 'com.domination'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'javafx-gradle-plugin'
repositories {
mavenCentral()
}
dependencies {
testCompile(
'org.junit.jupiter:junit-jupiter-api:5.1.0',
'org.jmockit:jmockit:1.41',
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.1.0'
)
compile(
'com.opencsv:opencsv:4.1'
)
}
test {
jvmArgs "-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}"
}
project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')
jacoco {
toolVersion = "0.8.2"
applyTo junitPlatformTestTask
}
// create junit platform jacoco task
project.task(type: JacocoReport, "junitPlatformJacocoReport",
{
sourceDirectories = files("./src/")
classDirectories = files("$buildDir/classes/java/main")
reports {
xml.enabled = true
html.enabled = true
xml.destination file("$buildDir/reports/jacoco/test/jacocoTestReport.xml")
html.destination file("$buildDir/reports/jacoco/test/jacocoTestReport.html")
}
executionData junitPlatformTestTask
onlyIf = {
true
}
doFirst {
try {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, excludes: ['views/**', '**/Screen.class'])
})
} catch (e) {
println "jacoco: no exclusion patterns due to ${e.message}"
}
}
})
}
jfx {
// minimal requirement for jfxJar-task
mainClass = 'Main'
// minimal requirement for jfxNative-task
vendor = 'DomiNation'
}