1
1
plugins {
2
- id( " com. android.application" )
3
- id( " org.jetbrains .kotlin.android" )
2
+ alias(libs.plugins. android.application)
3
+ alias(libs.plugins .kotlin.android)
4
4
}
5
5
6
6
android {
7
+ compileSdk = libs.versions.compileSdk.get().toInt()
7
8
namespace = " com.compose.weatherapplite"
8
- compileSdk = 34
9
+ testNamespace = " test.com.compose.weatherapplite "
9
10
10
11
defaultConfig {
11
12
applicationId = " com.compose.weatherapplite"
12
- minSdk = 26
13
- targetSdk = 34
13
+ minSdk = libs.versions.minSdk.get().toInt()
14
+ targetSdk = libs.versions.targetSdk.get().toInt()
14
15
versionCode = 1
15
16
versionName = " 1.0"
16
-
17
+ vectorDrawables.useSupportLibrary = true
17
18
testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
18
- vectorDrawables {
19
- useSupportLibrary = true
20
- }
21
19
}
22
20
23
21
buildTypes {
@@ -29,19 +27,20 @@ android {
29
27
)
30
28
}
31
29
}
30
+
32
31
compileOptions {
33
- sourceCompatibility = JavaVersion .VERSION_1_8
34
- targetCompatibility = JavaVersion .VERSION_1_8
35
- }
36
- kotlinOptions {
37
- jvmTarget = " 1.8"
32
+ sourceCompatibility = JavaVersion .VERSION_17
33
+ targetCompatibility = JavaVersion .VERSION_17
38
34
}
35
+
39
36
buildFeatures {
40
37
compose = true
41
38
}
39
+
42
40
composeOptions {
43
- kotlinCompilerExtensionVersion = " 1.4.3 "
41
+ kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
44
42
}
43
+
45
44
packaging {
46
45
resources {
47
46
excludes + = " /META-INF/{AL2.0,LGPL2.1}"
@@ -50,34 +49,27 @@ android {
50
49
}
51
50
52
51
dependencies {
53
- // Tooling - Preview
54
- implementation( platform(" androidx.compose:compose-bom:2023.03.00 " ) )
55
- debugImplementation( " androidx.compose.ui:ui-tooling " )
56
- implementation( " androidx.compose.ui:ui-tooling-preview " )
52
+ // Compose - BOM - (Bill of Materials)
53
+ val composeBom = platform(libs. androidx.compose.bom )
54
+ implementation(composeBom )
55
+ androidTestImplementation(composeBom )
57
56
58
- // Compose UI
59
- implementation(" androidx.compose.ui:ui" )
60
- implementation(" androidx.compose.ui:ui-graphics" )
61
-
62
- // Compose Jetpack Core
63
- implementation(" androidx.activity:activity-compose:1.8.0" )
64
- implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.6.2" )
65
- implementation(" androidx.core:core-ktx:1.12.0" )
57
+ // Tooling - Preview
58
+ debugImplementation(libs.androidx.compose.ui.tooling)
59
+ implementation(libs.androidx.compose.ui.tooling.preview)
66
60
67
- // Compose UI - Material 3
68
- implementation(" androidx.compose.material3:material3" )
61
+ // Compose - Jetpack Core
62
+ implementation(libs.androidx.activity.compose)
63
+ implementation(libs.androidx.lifecycle.runtime)
64
+ implementation(libs.androidx.core.ktx)
69
65
70
- // Unit & UI Tests
71
- testImplementation(" junit:junit:4.13.2" )
72
- androidTestImplementation(" androidx.test.ext:junit:1.1.5" )
73
- androidTestImplementation(" androidx.test.espresso:espresso-core:3.5.1" )
74
- androidTestImplementation(" androidx.compose.ui:ui-test-junit4" )
75
- debugImplementation(" androidx.compose.ui:ui-test-manifest" )
66
+ // Compose - UI
67
+ implementation(libs.androidx.compose.ui)
76
68
77
- // Compose - BOM(Bill of Materials)
78
- androidTestImplementation(platform( " androidx.compose:compose-bom:2023.03.00 " ) )
69
+ // Compose - UI - Material 3
70
+ implementation(libs. androidx.compose.material3 )
79
71
80
72
// Retrofit
81
- implementation(" com.squareup.retrofit2: retrofit:2.9.0 " )
82
- implementation(" com.squareup.retrofit2: converter-gson:2.9.0 " )
73
+ implementation(libs. retrofit)
74
+ implementation(libs. converter.gson )
83
75
}
0 commit comments