-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle.kts
93 lines (81 loc) · 2.43 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
kotlin("jvm") version "1.7.22"
id("java")
id("com.github.ben-manes.versions") version "0.44.0"
id("org.jetbrains.dokka") version "1.7.20"
idea
}
group = "de.hpi.dbs2"
version = "1.0-SNAPSHOT"
val groupIdentifier = project.property("groupIdentifier") as String
require(groupIdentifier.isNotBlank()) {
"Please set your group identifier in the gradle.properties file"
}
println("Using groupIdentifier=$groupIdentifier")
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20")
implementation("com.github.ajalt.clikt:clikt:3.5.0")
implementation("org.apache.commons:commons-csv:1.9.0")
implementation("com.google.guava:guava:31.1-jre")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
testImplementation("io.kotest:kotest-assertions-core:5.5.4")
}
kotlin {
jvmToolchain(17)
}
tasks {
withType<JavaExec> {
enableAssertions = true
}
test {
enableAssertions = true
testLogging {
showStandardStreams = true
}
useJUnitPlatform()
}
withType<KotlinJvmCompile> {
kotlinOptions {
apiVersion = "1.7"
languageVersion = "1.7"
freeCompilerArgs = listOf("-Xcontext-receivers")
}
}
withType<DependencyUpdatesTask> {
val unstable = Regex("^.*?(?:alpha|beta|unstable|ea).*\$", RegexOption.IGNORE_CASE)
rejectVersionIf {
candidate.version.matches(unstable)
}
}
listOf(
"exercise0",
"exercise1",
"exercise2",
"exercise3",
).forEach { exerciseDescriptor ->
register<Zip>("pack${exerciseDescriptor.capitalized()}") {
archiveFileName.set("group$groupIdentifier-$exerciseDescriptor.zip")
from("src/main/kotlin/$exerciseDescriptor/") {
into("kotlin")
}
from("src/main/java/$exerciseDescriptor/") {
into("java")
}
destinationDirectory.set(File("."))
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}