This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
generated from DanySK/Template-for-Kotlin-JVM-Projects
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
116 lines (105 loc) · 3.28 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.gitSemVer)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.qa)
alias(libs.plugins.publishOnCentral)
alias(libs.plugins.multiJvmTesting)
alias(libs.plugins.taskTree)
alias(libs.plugins.collektive)
}
group = "it.unibo.collektive"
repositories {
mavenCentral()
}
dependencies {
implementation(libs.collektive)
implementation(libs.bundles.alchemist)
testImplementation(libs.bundles.kotlin.testing)
}
kotlin {
sourceSets.all {
languageSettings {
languageVersion = "2.0"
}
}
target {
compilations.all {
kotlinOptions {
allWarningsAsErrors = false
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
}
}
}
tasks.test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
showCauses = true
showStackTraces = true
events(*org.gradle.api.tasks.testing.logging.TestLogEvent.values())
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
publishOnCentral {
projectLongName = "Collektive-Alchemist integration"
projectDescription = "Integration of the Collektive DSL into the Alchemist simulator"
licenseName = "MIT License"
licenseUrl = "https://opensource.org/license/mit/"
publishing {
publications {
withType<MavenPublication> {
if ("OSSRH" !in name) {
artifact(tasks.javadocJar)
}
scmConnection = "git:git@github.com:Collektive/${rootProject.name}"
projectUrl = "https://github.com/Collektive/${rootProject.name}"
pom {
developers {
developer {
name = "Elisa Tronetti"
email = "elisa.tronetti@studio.unibo.it"
url = "https://github.com/ElisaTronetti"
}
developer {
name = "Nicolas Farabegoli"
email = "nicolas.farabegoli@unibo.it"
url = "https://nicolasfarabegoli.it"
}
}
}
}
}
}
}
multiJvm {
jvmVersionForCompilation.set(17)
}
plugins.withType<DetektPlugin> {
val check by tasks.getting
val detektAll by tasks.creating { group = "verification" }
tasks.withType<Detekt>()
.matching { task ->
task.name.let { it.endsWith("Main") || it.endsWith("Test") } && !task.name.contains("Baseline")
}
.all {
check.dependsOn(this)
detektAll.dependsOn(this)
}
}
// Enforce the use of the Kotlin version
configurations.matching { it.name != "detekt" }.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(rootProject.libs.versions.kotlin.get())
}
}
}