kotlin-crawler-app-bom/build.gradle.kts

94 lines
2.2 KiB
Text
Raw Normal View History

2020-09-20 12:29:25 +02:00
buildscript {
extra.apply {
set("coroutinesVersion", "1.5")
set("kotlinVersion", "1.5.20")
2020-09-20 12:29:25 +02:00
}
}
plugins {
`java-platform`
`maven-publish`
}
group = "de.pheerai"
version = "0.0.4-SNAPSHOT"
2020-09-20 12:29:25 +02:00
repositories {
mavenCentral()
google()
2020-09-20 12:29:25 +02:00
}
javaPlatform {
allowDependencies()
}
dependencies {
api(platform("org.jetbrains.kotlin:kotlin-bom:${getFromExtra<String>("kotlinVersion")}"))
api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:${getFromExtra<String>("coroutinesVersion")}"))
api("org.jetbrains.kotlinx", "kotlinx-coroutines-core")
api("org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
2020-09-20 12:29:25 +02:00
api("com.github.ajalt.clikt", "clikt") {
version { cliktConstraints() }
}
api("org.jsoup", "jsoup") {
version { jsoupConstraints() }
}
2020-09-20 12:29:25 +02:00
api("org.jetbrains.kotlinx", "kotlinx-html-jvm") {
version { kotlinxHtmlConstraints() }
}
2020-09-20 12:29:25 +02:00
api("io.kotest", "kotest-runner-junit5-jvm") {
version { kotestConstraints() }
}
api("io.kotest", "kotest-assertions-core-jvm") {
version { kotestConstraints() }
}
2020-09-20 12:29:25 +02:00
}
publishing {
publications {
create<MavenPublication>("CrawlerBom") {
2020-09-20 12:29:25 +02:00
from(components["javaPlatform"])
}
}
2021-02-21 14:38:16 +01:00
repositories {
maven {
2021-03-05 21:22:44 +01:00
url = uri("https://git.f3l.de/api/v4/projects/160/packages/maven")
2021-02-21 14:38:16 +01:00
name = "GitLab"
credentials(HttpHeaderCredentials::class.java) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
2021-02-21 14:43:02 +01:00
authentication {
2021-02-21 14:49:38 +01:00
create<HttpHeaderAuthentication>("header")
2021-02-21 14:43:02 +01:00
}
2021-02-21 14:38:16 +01:00
}
}
2020-09-20 12:29:25 +02:00
}
inline fun <reified T> getFromProperties(name: String): T = project.properties[name] as T
inline fun <reified T> getFromExtra(name: String): T = extra[name] as T
fun MutableVersionConstraint.kotestConstraints() {
prefer("4.6.0")
strictly("[4.3.0,5.0.0[")
}
fun MutableVersionConstraint.kotlinxHtmlConstraints() {
prefer("0.7.2")
strictly("[0.7.0,0.8.0[")
}
fun MutableVersionConstraint.jsoupConstraints() {
prefer("1.13.1")
strictly("[1.13.0,1.14.0[")
}
fun MutableVersionConstraint.cliktConstraints() {
prefer("3.2.0")
strictly("[3.0.0,4.0.0[")
}