Skip to content

Commit

Permalink
Add remote version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
sylwester-zielinski committed Jul 25, 2024
1 parent e914737 commit 6a03b50
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 73 deletions.
57 changes: 12 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 8 additions & 15 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}

0 comments on commit 6a03b50

Please sign in to comment.