Skip to content

Commit d2d6aa9

Browse files
committed
migration gradle dependencies to version catalogs
1 parent 94125de commit d2d6aa9

File tree

5 files changed

+72
-27
lines changed

5 files changed

+72
-27
lines changed

.idea/AndroidProjectSystem.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deviceManager.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
2-
id 'com.android.application'
3-
id 'org.jetbrains.kotlin.android'
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
44
}
55

66
android {
77
namespace 'com.iamageo.beautiful_dialog'
8-
compileSdk 34
8+
compileSdk libs.versions.compile.sdk.get().toInteger()
99

1010
defaultConfig {
1111
applicationId "com.iamageo.beautiful_dialog"
12-
minSdk 21
13-
targetSdk 34
12+
minSdk libs.versions.min.sdk.get().toInteger()
13+
targetSdk libs.versions.target.sdk.get().toInteger()
1414
versionCode 1
1515
versionName "1.0"
1616

@@ -28,21 +28,20 @@ android {
2828
}
2929
}
3030
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
31+
sourceCompatibility JavaVersion.toVersion(libs.versions.java.get())
32+
targetCompatibility JavaVersion.toVersion(libs.versions.java.get())
3333
}
3434
kotlinOptions {
35-
jvmTarget = '1.8'
35+
jvmTarget = libs.versions.jvm.get()
3636
}
3737
}
3838

3939
dependencies {
40-
41-
implementation 'androidx.core:core-ktx:1.13.1'
42-
implementation 'androidx.appcompat:appcompat:1.6.1'
43-
implementation 'com.google.android.material:material:1.11.0'
44-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
40+
implementation(libs.androidx.core.ktx)
41+
implementation(libs.androidx.appcompat)
42+
implementation(libs.material)
43+
implementation(libs.androidx.constraintlayout)
4544

4645
implementation project(path: ':library')
47-
testImplementation 'junit:junit:4.13.2'
46+
testImplementation(libs.junit)
4847
}

gradle/libs.versions.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[versions]
2+
compile-sdk = "36"
3+
min-sdk = "21"
4+
target-sdk = "36"
5+
java = "1.8"
6+
jvm = "1.8"
7+
android-gradle-plugin = "8.13.0"
8+
kotlin = "1.8.22"
9+
core-ktx = "1.17.0"
10+
appcompat = "1.7.1"
11+
material = "1.13.0"
12+
constraintlayout = "2.2.1"
13+
lottie = "6.6.7"
14+
junit4 = "4.13.2"
15+
16+
[libraries]
17+
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
18+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
19+
material = { module = "com.google.android.material:material", version.ref = "material" }
20+
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
21+
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" }
22+
junit = { module = "junit:junit", version.ref = "junit4" }
23+
24+
[plugins]
25+
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
26+
android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
27+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

library/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'com.android.library'
3-
id 'org.jetbrains.kotlin.android'
2+
alias(libs.plugins.android.library)
3+
alias(libs.plugins.kotlin.android)
44
id 'maven-publish'
55
}
66

@@ -9,11 +9,11 @@ version = '1.1.0'
99

1010
android {
1111
namespace 'com.iamageo.library'
12-
compileSdk 34
12+
compileSdk libs.versions.compile.sdk.get().toInteger()
1313

1414
defaultConfig {
15-
minSdk 21
16-
targetSdk 34
15+
minSdk libs.versions.min.sdk.get().toInteger()
16+
targetSdk libs.versions.target.sdk.get().toInteger()
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
consumerProguardFiles "consumer-rules.pro"
@@ -26,11 +26,11 @@ android {
2626
}
2727
}
2828
compileOptions {
29-
sourceCompatibility JavaVersion.VERSION_1_8
30-
targetCompatibility JavaVersion.VERSION_1_8
29+
sourceCompatibility JavaVersion.toVersion(libs.versions.java.get())
30+
targetCompatibility JavaVersion.toVersion(libs.versions.java.get())
3131
}
3232
kotlinOptions {
33-
jvmTarget = '1.8'
33+
jvmTarget = libs.versions.jvm.get()
3434
}
3535

3636
buildFeatures {
@@ -41,12 +41,12 @@ android {
4141

4242
dependencies {
4343

44-
implementation 'androidx.core:core-ktx:1.13.1'
45-
implementation 'androidx.appcompat:appcompat:1.6.1'
46-
implementation 'com.google.android.material:material:1.11.0'
47-
implementation 'com.airbnb.android:lottie:6.4.1'
44+
implementation(libs.androidx.core.ktx)
45+
implementation(libs.androidx.appcompat)
46+
implementation(libs.material)
47+
implementation(libs.lottie)
4848

49-
testImplementation 'junit:junit:4.13.2'
49+
testImplementation(libs.junit)
5050

5151
}
5252

0 commit comments

Comments
 (0)