-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
83 lines (73 loc) · 2.32 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
plugins {
kotlin("multiplatform") version "1.9.0"
id("io.kotest.multiplatform") version "5.7.2"
id("maven-publish")
}
val kotestVersion = "5.7.2"
group = "com.ewoudje"
val gitRevision = "git rev-parse HEAD".execute()
version = "0.1.0+" + gitRevision.substring(0, 10)
repositories {
mavenCentral()
maven {
name = "VS Maven"
url = uri(project.findProperty("vs_maven_url") ?: "https://maven.valkyrienskies.org/")
val vsMavenUsername = project.findProperty("vs_maven_username") as String?
val vsMavenPassword = project.findProperty("vs_maven_password") as String?
if (vsMavenPassword != null && vsMavenUsername != null) {
credentials {
username = vsMavenUsername
password = vsMavenPassword
}
}
}
}
kotlin {
targets {
jvm {
jvmToolchain(17)
withJava()
}
}
targets.all {
compilations.all {
kotlinOptions {
verbose = true
}
}
}
sourceSets {
val commonMain by getting
val jvmMain by getting
val jvmTest by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.0")
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
}
}
}
publishing {
repositories {
val vsMavenUsername = project.findProperty("vs_maven_username") as String?
val vsMavenPassword = project.findProperty("vs_maven_password") as String?
val vsMavenUrl = project.findProperty("vs_maven_url") as String?
if (vsMavenUrl != null && vsMavenPassword != null && vsMavenUsername != null) {
println("Publishing to VS Maven ($version)")
maven {
url = uri(vsMavenUrl)
credentials {
username = vsMavenUsername
password = vsMavenPassword
}
}
}
}
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
fun String.execute(envp: Array<String>? = null, dir: File = projectDir): String {
val process = Runtime.getRuntime().exec(this, envp, dir)
return process.inputStream.reader().readText()
}