-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (107 loc) · 2.35 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.7.1/userguide/building_java_projects.html
*/
plugins {
id 'java'
id 'application'
id 'jacoco'
}
repositories {
mavenCentral()
}
dependencies {
// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-nop
implementation 'org.slf4j:slf4j-nop:1.7.36'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
implementation 'org.reflections:reflections:0.10.2'
}
version = '0.1'
java {
modularity.inferModulePath = true
toolchain.languageVersion = JavaLanguageVersion.of(16)
}
compileJava {
options.encoding = 'UTF-8'
options.fork = true
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
tasks.named('javadoc') {
options.encoding = "UTF-8"
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
output.resourcesDir = file('build/out/bin')
java.outputDir = file('build/out/bin')
}
test {
java {
srcDirs = ['test']
}
resources {
srcDirs = ['test']
}
output.resourcesDir = file('build/out/testbins')
java.outputDir = file('build/out/testbins')
}
}
// Copy library into the run directories.
task copyForRun(type: Copy) {
from 'lib'
into 'build/libs/lib'
}
tasks.run {
dependsOn copyForRun
}
task copyForInstall(type: Copy) {
from 'lib'
into 'build/install/sof-language/lib/lib'
configure {
mustRunAfter installDist
}
}
task install {
dependsOn copyForInstall, installDist
}
application {
mainModule = 'sof'
mainClass = 'klfr.sof.cli.CLI'
applicationDefaultJvmArgs = ["-Dfile.encoding=UTF-8"]
}
tasks.run {
standardInput = System.in
}
tasks.named('test') {
// Use junit platform for unit tests.
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacoco {
toolVersion = "0.8.7"
reportsDirectory = layout.buildDirectory.dir('jcc-report')
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = false
}
}
task coverage {
dependsOn jacocoTestReport
dependsOn test
}