-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle.kts
135 lines (97 loc) · 3.23 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.0.21"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
version = "1.0.3"
allprojects {
group = "com.github.holgerbrandl"
repositories {
mavenCentral()
mavenLocal()
}
}
dependencies {
api("org.apache.commons:commons-math3:3.6.1")
// note update to latest version postponed because of regression errors
api("io.insert-koin:koin-core:3.1.2")
api("org.json:json:20240303")
api("com.github.holgerbrandl:jsonbuilder:0.10")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
api("io.github.oshai:kotlin-logging-jvm:6.0.9")
api("com.github.holgerbrandl:kdfutils:1.5.0")
implementation("com.google.code.gson:gson:2.10.1")
// implementation("org.jetbrains.kotlin:kotlin-reflect:2.0.21")
testImplementation("io.kotest:kotest-assertions-core:5.7.2")
//experimental dependencies use for experimentation
testImplementation("com.thoughtworks.xstream:xstream:1.4.20")
testImplementation("org.slf4j:slf4j-simple:1.7.30")
testImplementation(kotlin("script-runtime"))
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
//https://gist.github.com/domnikl/c19c7385927a7bef7217aa036a71d807
val jar by tasks.getting(Jar::class) {
manifest {
// attributes["Main-Class"] = "com.example.MainKt"
attributes["Implementation-Title"] = "kalasim"
attributes["Implementation-Version"] = project.version
}
}
java {
withJavadocJar()
withSourcesJar()
}
// see https://youtrack.jetbrains.com/issue/KT-52735
val compileKotlin: KotlinCompile by tasks
compileKotlin.compilerOptions {
freeCompilerArgs.addAll(listOf("-Xallow-any-scripts-in-source-roots"))
// freeCompilerArgs.addAll(listOf("-Xcontext-receivers"))
}
kotlin {
jvmToolchain(17)
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
url.set("https://www.kalasim.org")
name.set("kalasim")
description.set("kalasim is a process-oriented discrete event simulation engine")
scm {
connection.set("scm:git:github.com/holgerbrandl/kalasim.git")
url.set("https://github.com/holgerbrandl/kalasim.git")
}
licenses {
license {
name.set("MIT License")
url.set("https://raw.githubusercontent.com/holgerbrandl/kalasim/master/LICENSE")
}
}
developers {
developer {
id.set("holgerbrandl")
name.set("Holger Brandl")
email.set("holgerbrandl@gmail.com")
}
}
}
}
}
}
nexusPublishing {
// packageGroup.set("com.github.holgerbrandl.kalasim")
repositories {
sonatype()
}
}
signing {
sign(publishing.publications["maven"])
}
fun findProperty(s: String) = project.findProperty(s) as String?