From e18088cd9b3992a8d6b8633a51fd11e176043c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Sun, 21 Feb 2021 13:59:17 +0100 Subject: [PATCH] Rename to `crawler`-app and change to version constraints --- build.gradle.kts | 56 ++++++++++++++++++++++++++++++--------------- settings.gradle.kts | 3 +-- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c126e9d..407fbf8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,7 @@ buildscript { extra.apply { set("coroutinesVersion", "1.4.1") - set("jsoupVersion", "1.13.1") - set("kotestVersion", "4.3.1") - set("kotlinxHtmlVersion", "0.7.2") - set("cliktVersion", "3.0.1") - set("kotlinVersion", "1.4.20") + set("kotlinVersion", "1.4.30") } } @@ -18,14 +14,8 @@ group = "de.pheerai" version = "0.0.3-SNAPSHOT" repositories { - jcenter() mavenCentral() - mavenLocal { - mavenContent { - includeGroup("de.pheerai.eap") - includeGroup("de.pheerai") - } - } + google() } javaPlatform { @@ -38,18 +28,28 @@ dependencies { api("org.jetbrains.kotlinx", "kotlinx-coroutines-core") - api("com.github.ajalt.clikt", "clikt", getFromExtra("cliktVersion")) - api("org.jsoup", "jsoup", getFromExtra("jsoupVersion")) + api("com.github.ajalt.clikt", "clikt") { + version { cliktConstraints() } + } + api("org.jsoup", "jsoup") { + version { jsoupConstraints() } + } - api("org.jetbrains.kotlinx", "kotlinx-html-jvm", getFromExtra("kotlinxHtmlVersion")) + api("org.jetbrains.kotlinx", "kotlinx-html-jvm") { + version { kotlinxHtmlConstraints() } + } - api("io.kotest", "kotest-runner-junit5-jvm", getFromExtra("kotestVersion")) - api("io.kotest", "kotest-assertions-core-jvm", getFromExtra("kotestVersion")) + api("io.kotest", "kotest-runner-junit5-jvm") { + version { kotestConstraints() } + } + api("io.kotest", "kotest-assertions-core-jvm") { + version { kotestConstraints() } + } } publishing { publications { - create("NativeBom") { + create("CrawlerBom") { from(components["javaPlatform"]) } } @@ -57,3 +57,23 @@ publishing { 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[") +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a89c447..aca67ef 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1 @@ -rootProject.name = "kotlin-native-app-bom" - +rootProject.name = "kotlin-crawler-app-bom"