-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
100 lines (84 loc) · 2.65 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
jacoco
kotlin("jvm") version "1.9.10"
`maven-publish`
}
group = "id.walt.servicematrix"
version = "1.1.4"
repositories {
mavenCentral()
}
dependencies {
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10")
// Reflection
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.10")
// Configuration
implementation("com.sksamuel.hoplite:hoplite-core:2.7.5")
implementation("com.sksamuel.hoplite:hoplite-hocon:2.7.5")
// Testing
testImplementation("io.kotest:kotest-runner-junit5:5.7.2")
testImplementation("io.kotest:kotest-assertions-core:5.7.2")
}
tasks.withType<Test> {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set("waltid-servicematrix")
description.set("Kotlin/Java library for service registration.")
url.set("https://walt.id")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:[email protected]:walt-id/waltid-servicematrix.git")
developerConnection.set("scm:[email protected]:walt-id/waltid-servicematrix.git")
url.set("https://github.com/walt-id/waltid-servicematrix/tree/main")
}
}
from(components["java"])
}
}
repositories {
maven {
url = uri("https://maven.walt.id/repository/waltid/")
val usernameFile = File("secret_maven_username.txt")
val passwordFile = File("secret_maven_password.txt")
val secretMavenUsername = System.getenv()["MAVEN_USERNAME"] ?: if (usernameFile.isFile) {
usernameFile.readLines()[0]
} else {
""
}
val secretMavenPassword = System.getenv()["MAVEN_PASSWORD"] ?: if (passwordFile.isFile) {
passwordFile.readLines()[0]
} else {
""
}
credentials {
username = secretMavenUsername
password = secretMavenPassword
}
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
jacoco.toolVersion = "0.8.8"
tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
}