-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
76 lines (69 loc) · 1.84 KB
/
build.gradle.kts
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
plugins {
java
application
id("org.sourcegrade.submitter") version "0.5.1"
}
submit {
assignmentId = "h00" // do not change assignmentId
studentId = null // TU-ID z.B. "ab12cdef"
firstName = null
lastName = null
// Optionally require tests for prepareSubmission task. Default is true
requireTests = true
// Optionally require public tests for prepareSubmission task. Default is false
requirePublicTests = false
}
// !! Achtung !!
// Die studentId (TU-ID) ist keine Matrikelnummer
// Richtig z.B. ab12cdef
// Falsch z.B. 1234567
repositories {
mavenCentral()
}
val publicTest: SourceSet by sourceSets.creating {
val test = sourceSets.test.get()
compileClasspath += test.output + test.compileClasspath
runtimeClasspath += output + test.runtimeClasspath
}
dependencies {
implementation("org.jetbrains:annotations:23.0.0")
// JUnit only available in "test" source set (./src/test)
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}
application {
mainClass.set("h00.Main")
}
tasks {
val runDir = File("build/run")
named<JavaExec>("run") {
doFirst {
runDir.mkdirs()
}
workingDir = runDir
}
test {
doFirst {
runDir.mkdirs()
}
workingDir = runDir
useJUnitPlatform()
}
val publicTest by creating(Test::class) {
group = "verification"
doFirst {
runDir.mkdirs()
}
workingDir = runDir
testClassesDirs = publicTest.output.classesDirs
classpath = publicTest.compileClasspath + publicTest.runtimeClasspath
useJUnitPlatform()
}
named("check") {
dependsOn(publicTest)
}
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = "17"
targetCompatibility = "17"
}
}