buildscript { extra.apply { set("coroutinesVersion", "1.4.1") set("kotlinVersion", "1.4.30") } } plugins { `java-platform` `maven-publish` } group = "de.pheerai" version = "0.0.3-SNAPSHOT" repositories { mavenCentral() google() } javaPlatform { allowDependencies() } dependencies { api(platform("org.jetbrains.kotlin:kotlin-bom:${getFromExtra("kotlinVersion")}")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:${getFromExtra("coroutinesVersion")}")) api("org.jetbrains.kotlinx", "kotlinx-coroutines-core") api("com.github.ajalt.clikt", "clikt") { version { cliktConstraints() } } api("org.jsoup", "jsoup") { version { jsoupConstraints() } } api("org.jetbrains.kotlinx", "kotlinx-html-jvm") { version { kotlinxHtmlConstraints() } } api("io.kotest", "kotest-runner-junit5-jvm") { version { kotestConstraints() } } api("io.kotest", "kotest-assertions-core-jvm") { version { kotestConstraints() } } } publishing { publications { create("CrawlerBom") { from(components["javaPlatform"]) } } repositories { maven { url = uri("https://git.f3l.de/api/v4/groups/160/packages/maven") name = "GitLab" credentials(HttpHeaderCredentials::class.java) { name = "Job-Token" value = System.getenv("CI_JOB_TOKEN") } authentication { create("header") } } } } inline fun getFromProperties(name: String): T = project.properties[name] as T inline fun getFromExtra(name: String): T = extra[name] as T fun MutableVersionConstraint.kotestConstraints() { prefer("4.3.1") strictly("[4.3.0,4.4.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.0.1") strictly("[3.0.0,3.1.0[") }