diff --git a/build.gradle.kts b/build.gradle.kts index edc538a..a691f03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,44 +25,20 @@ private val iosFrameworkName = "KmpLog" rootProject.group = "${properties["GROUP"]}" rootProject.version = version -buildscript { - repositories { - gradlePluginPortal() - google() - mavenCentral() - maven(url = "https://jitpack.io") - maven(url = "https://plugins.gradle.org/m2/") - } - - dependencies { - classpath("com.android.tools.build:gradle:${properties["version.plugin.androidGradle"]}") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${properties["version.kotlin"]}") - classpath("com.github.ben-manes:gradle-versions-plugin:${properties["version.plugin.outdated"]}") - } -} - -repositories { - gradlePluginPortal() - google() - mavenCentral() - maven(url = "https://jitpack.io") - maven(url = "https://plugins.gradle.org/m2/") -} - -// Versions of plugins are now configured once in pluginManagement block in settings.gradle.kts. +@Suppress("DSL_SCOPE_VIOLATION") plugins { - kotlin("multiplatform") - id("io.gitlab.arturbosch.detekt") - id("org.jlleitschuh.gradle.ktlint") - id("com.github.ben-manes.versions") - id("com.android.library") + alias(externalLibs.plugins.arturbosch.detekt) + alias(externalLibs.plugins.jlleitschuh.gradle.ktlint) + alias(externalLibs.plugins.ben.manes) + alias(externalLibs.plugins.android.library) + alias(externalLibs.plugins.kotlin.multiplatform) + alias(externalLibs.plugins.kmmbridge) id("maven-publish") - id("co.touchlab.kmmbridge") } dependencies { - detektPlugins("io.gitlab.arturbosch.detekt:detekt-cli:${properties["version.plugin.detekt"]}") - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${properties["version.plugin.detekt"]}") + detektPlugins(externalLibs.detekt.formatting) + detektPlugins(externalLibs.detekt.cli) } apply(plugin = "io.gitlab.arturbosch.detekt") @@ -138,18 +114,9 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation( - "co.touchlab:stately-concurrency:" + - "${properties["version.stately.concurrency"]}", - ) - implementation( - "org.jetbrains.kotlinx:kotlinx-coroutines-core:" + - "${properties["version.kotlin.coroutines"]}", - ) - implementation( - "org.jetbrains.kotlinx:kotlinx-datetime:" + - "${properties["version.kotlin.datetime"]}", - ) + implementation(externalLibs.touchlab.stately.concurrency) + implementation(externalLibs.kotlinx.coroutines.core) + implementation(externalLibs.kotlinx.datetime) } } val jvmMain by getting diff --git a/gradle.properties b/gradle.properties index 0f0d858..7c38592 100644 --- a/gradle.properties +++ b/gradle.properties @@ -42,16 +42,3 @@ android.nonTransitiveRClass=true build.android.minimumSdk=24 build.android.targetSdk=34 build.android.compileSdk=34 - -# Plugins: -version.plugin.androidGradle=8.1.2 -version.plugin.ktlintGradle=11.6.1 -version.plugin.detekt=1.23.3 -version.plugin.outdated=0.49.0 -version.plugin.kmmbridge=0.5.5 - -# Dependencies: -version.kotlin=1.9.23 -version.kotlin.coroutines=1.7.3 -version.kotlin.datetime=0.4.1 -version.stately.concurrency=1.2.3 diff --git a/settings.gradle.kts b/settings.gradle.kts index 04774d3..0bae5eb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,31 +21,24 @@ rootProject.name = "kmplog" pluginManagement { repositories { + mavenLocal() gradlePluginPortal() google() mavenCentral() } - - resolutionStrategy { - val props = extra.properties - - eachPlugin { - when ("${requested.id}") { - "org.jetbrains.kotlin.multiplatform" -> useVersion("${props["version.kotlin"]}") - "io.gitlab.arturbosch.detekt" -> useVersion("${props["version.plugin.detekt"]}") - "org.jlleitschuh.gradle.ktlint" -> useVersion("${props["version.plugin.ktlintGradle"]}") - "com.github.ben-manes.versions" -> useVersion("${props["version.plugin.outdated"]}") - "com.android.library" -> useVersion("${props["version.plugin.androidGradle"]}") - "co.touchlab.kmmbridge" -> useVersion("${props["version.plugin.kmmbridge"]}") - } - } - } } dependencyResolutionManagement { repositories { + mavenLocal() gradlePluginPortal() google() mavenCentral() } + + versionCatalogs { + val externalLibs by creating { + from("com.arithings.mobile:version-catalog:1.0.5") + } + } }