Skip to content

Commit 51f4e1b

Browse files
committed
use kotlincrypto version catalog
1 parent 1a73303 commit 51f4e1b

File tree

4 files changed

+41
-34
lines changed

4 files changed

+41
-34
lines changed

amplifyframework/build.gradle.kts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
22

33
plugins {
4-
kotlin("multiplatform")
5-
id("com.android.library")
4+
alias(libs.plugins.kotlin.multiplatform)
5+
alias(libs.plugins.android.library)
66
id("maven-publish")
77
}
88

@@ -28,15 +28,15 @@ kotlin {
2828
sourceSets {
2929
val commonMain by getting {
3030
dependencies {
31-
implementation("org.jetbrains:annotations:24.1.0")
32-
implementation("com.ionspin.kotlin:bignum:0.3.8")
33-
implementation("org.kotlincrypto:secure-random:0.1.0")
34-
implementation(platform("org.kotlincrypto.macs:bom:0.3.0"))
35-
implementation("org.kotlincrypto.macs:hmac-sha2")
36-
implementation(platform("org.kotlincrypto.hash:bom:0.3.0"))
37-
implementation("org.kotlincrypto.hash:sha2")
38-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
39-
implementation("io.ktor:ktor-client-core:2.3.6")
31+
implementation(libs.jetbrainsAnnotations)
32+
implementation(libs.bignum)
33+
implementation(kotlincrypto.random.secure)
34+
implementation(platform(kotlincrypto.macs.bom))
35+
implementation(kotlincrypto.macs.hmac.sha2)
36+
implementation(platform(kotlincrypto.hash.bom))
37+
implementation(kotlincrypto.hash.sha2)
38+
implementation(libs.kotlinx.datetime)
39+
implementation(libs.ktor.client.core)
4040
}
4141
}
4242
val commonTest by getting {
@@ -49,9 +49,9 @@ kotlin {
4949

5050
android {
5151
namespace = "com.jump.sdk.amplifyframework"
52-
compileSdk = 34
52+
compileSdk = libs.versions.compileSdk.get().toInt()
5353
defaultConfig {
54-
minSdk = 26
54+
minSdk = libs.versions.minSdk.get().toInt()
5555
}
5656
compileOptions {
5757
sourceCompatibility = JavaVersion.VERSION_17

build.gradle.kts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id("com.android.library").version("8.10.0").apply(false)
3-
kotlin("multiplatform").version("2.1.21").apply(false)
4-
id("io.gitlab.arturbosch.detekt") version "1.23.8"
5-
id("com.github.ben-manes.versions") version "0.52.0"
2+
alias(libs.plugins.android.library).apply(false)
3+
alias(libs.plugins.kotlin.multiplatform).apply(false)
4+
alias(libs.plugins.detekt)
5+
alias(libs.plugins.benManes.versions)
66
}
77

88
tasks.register("clean", Delete::class) {
@@ -28,10 +28,9 @@ allprojects {
2828
}
2929
}
3030
dependencies {
31-
val detektVersion = "1.23.8"
32-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:$detektVersion")
33-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion")
34-
detektPlugins("com.braisgabin.detekt:kotlin-compiler-wrapper:0.0.4")
35-
detektPlugins("com.github.hbmartin:hbmartin-detekt-rules:0.1.7")
31+
detektPlugins(libs.detekt.libraries)
32+
detektPlugins(libs.detekt.formatting)
33+
detektPlugins(libs.detekt.kotlinCompilerWrapper)
34+
detektPlugins(libs.detekt.hbmartin)
3635
}
3736
}

gradle/libs.versions.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ detekt = "1.23.8"
55
hbmartinRules = "0.1.7"
66
jbAnnotations = "26.0.2"
77
bignum = "0.3.10"
8-
cryptoRandom = "0.5.0"
9-
cryptoMacs = "0.7.0"
8+
kotlinxDatetime = "0.4.1"
9+
ktor = "2.3.6"
10+
benManesVersions = "0.52.0"
11+
kotlinCompilerWrapper = "0.0.4"
12+
compileSdk = "34"
13+
minSdk = "26"
1014

1115
[libraries]
1216
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
17+
detekt-libraries = { group = "io.gitlab.arturbosch.detekt", name = "detekt-rules-libraries", version.ref = "detekt" }
1318
detekt-hbmartin = { group = "me.haroldmartin", name = "hbmartin-detekt-rules", version.ref = "hbmartinRules" }
19+
detekt-kotlinCompilerWrapper = { group = "com.braisgabin.detekt", name = "kotlin-compiler-wrapper", version.ref = "kotlinCompilerWrapper" }
1420
jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.ref = "jbAnnotations" }
1521
bignum = { group = "com.ionspin.kotlin", name = "bignum", version.ref = "bignum" }
16-
crypto-random = { group = "org.kotlincrypto", name = "random", version.ref = "cryptoRandom" }
17-
crypto-macs = { group = "org.kotlincrypto", name = "macs", version.ref = "cryptoMacs" }
18-
19-
implementation(platform("org.kotlincrypto.macs:bom:0.3.0"))
20-
implementation("org.kotlincrypto.macs:hmac-sha2")
21-
implementation(platform("org.kotlincrypto.hash:bom:0.3.0"))
22-
implementation("org.kotlincrypto.hash:sha2")
23-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
24-
implementation("io.ktor:ktor-client-core:2.3.6")
22+
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinxDatetime" }
23+
ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
2524

2625
[plugins]
2726
android-library = { id = "com.android.library", version.ref = "agp" }
27+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
2828
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
29-
hbmartinRules = { id = "com.hbmartin.rules", version.ref = "hbmartinRules" }
29+
benManes-versions = { id = "com.github.ben-manes.versions", version.ref = "benManesVersions" }

settings.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ pluginManagement {
77
}
88

99
dependencyResolutionManagement {
10+
versionCatalogs {
11+
create("libs") {
12+
from(files("gradle/libs.versions.toml"))
13+
}
14+
create("kotlincrypto") {
15+
from("org.kotlincrypto:version-catalog:0.7.1")
16+
}
17+
}
1018
repositories {
1119
google()
1220
mavenCentral()

0 commit comments

Comments
 (0)