Skip to content

Commit

Permalink
Use version catalogs for libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
MiSikora committed Nov 12, 2021
1 parent 22afd7d commit b95fe77
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[versions]
kotest = "4.6.0"
androidxTest = "1.3.0"

[libraries]
android-x-startupRuntime = { module = "androidx.startup:startup-runtime", version = "1.1.0" }
android-x-test-coreKtx = { module = "androidx.test:core-ktx", version.ref = "androidxTest" }
android-x-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidxTest" }
android-x-test-runner = { module = "androidx.test:runner", version.ref = "androidxTest" }
android-x-test-junitKtx = { module = "androidx.test.ext:junit-ktx", version = "1.1.3" }
android-material = { module = "com.google.android.material:material", version = "1.4.0" }

kotest-runnerJunit5 = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" }
kotest-assertions = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "kotest" }
kotest-property = { module = "io.kotest:kotest-property-jvm", version.ref = "kotest" }

junit4 = { module = "junit:junit", version = "4.13.2" }
2 changes: 1 addition & 1 deletion library/ruler-android-startup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

dependencies {
api project(':library:ruler-android')
implementation libs.android.x.startupRuntime
implementation deps.android.x.startupRuntime
}

apply from: "$rootDir/gradle/dokka-config.gradle"
Expand Down
10 changes: 5 additions & 5 deletions library/ruler-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
dependencies {
api project(':library:ruler')

androidTestUtil libs.android.x.test.orchestrator
androidTestImplementation libs.android.x.testExtJunitKtx
androidTestImplementation libs.android.x.test.coreKtx
androidTestImplementation libs.android.x.test.runner
androidTestImplementation libs.kotest.assertions
androidTestUtil deps.android.x.test.orchestrator
androidTestImplementation deps.android.x.test.junitKtx
androidTestImplementation deps.android.x.test.coreKtx
androidTestImplementation deps.android.x.test.runner
androidTestImplementation deps.kotest.assertions
}

apply from: "$rootDir/gradle/dokka-config.gradle"
Expand Down
6 changes: 3 additions & 3 deletions library/ruler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ plugins {
test.useJUnitPlatform()

dependencies {
testImplementation libs.kotest.runnerJunit5
testImplementation libs.kotest.assertions
testImplementation libs.kotest.property
testImplementation deps.kotest.runnerJunit5
testImplementation deps.kotest.assertions
testImplementation deps.kotest.property
}

apply from: "$rootDir/gradle/dokka-config.gradle"
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ android {
}

dependencies {
implementation libs.android.material
implementation deps.android.material
implementation project(":library:ruler-android-startup")
}
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ include(
":library:ruler-android-startup",
":sample",
)

enableFeaturePreview("VERSION_CATALOGS")

dependencyResolutionManagement {
defaultLibrariesExtensionName.set("deps")
}

0 comments on commit b95fe77

Please sign in to comment.