Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TOML versioning #12

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ repositories {

// Versions of plugins are now configured once in pluginManagement block in settings.gradle.kts.
plugins {
kotlin("multiplatform")
id("io.gitlab.arturbosch.detekt")
id("org.jlleitschuh.gradle.ktlint")
id("com.github.ben-manes.versions")
id("com.android.library")
id("maven-publish")
id("co.touchlab.kmmbridge")
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.detektPlugin)
alias(libs.plugins.ktlinPlugin)
alias(libs.plugins.versionsPlugin)
alias(libs.plugins.androidLibrary)
`maven-publish`
alias(libs.plugins.kmmbridgePlugin)
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-cli:${properties["version.plugin.detekt"]}")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${properties["version.plugin.detekt"]}")
detektPlugins(libs.detektCliPlugin)
detektPlugins(libs.detektFormattingPlugin)
}

apply(plugin = "io.gitlab.arturbosch.detekt")
Expand Down Expand Up @@ -138,18 +138,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(libs.stately)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.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
25 changes: 25 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[versions]
kotlin = "1.9.23"
coroutines = "1.7.3"
datetime = "0.4.1"
stately = "1.2.3"
androidGradle = "8.7.0"
ktlint = "11.6.1"
detekt = "1.23.3"
outdated = "0.49.0"
kmmbridge = "0.5.5"

[libraries]
stately = { module = "co.touchlab:stately-concurrency", version.ref = "stately" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" }
detektFormattingPlugin = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detektCliPlugin = { module = "io.gitlab.arturbosch.detekt:detekt-cli", version.ref = "detekt" }

[plugins]
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
detektPlugin = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ktlinPlugin = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
versionsPlugin = { id = "com.github.ben-manes.versions", version.ref = "outdated" }
androidLibrary = { id = "com.android.library", version.ref = "androidGradle" }
kmmbridgePlugin = { id = "co.touchlab.kmmbridge", version.ref = "kmmbridge" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 04 07:32:53 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
15 changes: 0 additions & 15 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ pluginManagement {
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 {
Expand Down
Loading