Skip to content

Commit e66f33a

Browse files
authored
Merge pull request #6 from GetStream/refactor/version-catalog
Migrate buildSrc to version catalog
2 parents 5e6b0de + 0a1a4b6 commit e66f33a

File tree

25 files changed

+195
-322
lines changed

25 files changed

+195
-322
lines changed

app/build.gradle.kts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ android {
3535
}
3636

3737
packagingOptions {
38-
resources.excludes.add("META-INF/LICENSE.txt")
39-
resources.excludes.add("META-INF/NOTICE.txt")
40-
resources.excludes.add("LICENSE.txt")
41-
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
38+
resources {
39+
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
40+
}
4241
}
4342

4443
buildTypes {
@@ -63,27 +62,27 @@ dependencies {
6362
implementation(project(":feature-calls"))
6463

6564
// material
66-
implementation(Dependencies.material)
65+
implementation(libs.androidx.appcompat)
6766

6867
// compose
69-
implementation(Dependencies.composeActivity)
70-
implementation(Dependencies.composeAnimation)
71-
implementation(Dependencies.composeRuntime)
72-
implementation(Dependencies.composeTooling)
73-
implementation(Dependencies.composeConstraintLayout)
68+
implementation(libs.androidx.activity.compose)
69+
implementation(libs.androidx.compose.runtime)
70+
implementation(libs.androidx.compose.ui.tooling)
71+
implementation(libs.androidx.compose.ui.tooling.preview)
72+
implementation(libs.androidx.compose.constraintlayout)
7473

7574
// jetpack
76-
implementation(Dependencies.appStartUp)
77-
implementation(Dependencies.hiltAndroid)
78-
implementation(Dependencies.hiltNavigation)
79-
kapt(Dependencies.hiltCompiler)
75+
implementation(libs.androidx.startup)
76+
implementation(libs.hilt.android)
77+
implementation(libs.androidx.hilt.navigation.compose)
78+
kapt(libs.hilt.compiler)
8079

8180
// image loading
82-
implementation(Dependencies.landscapistGlide)
81+
implementation(libs.landscapist.glide)
8382

8483
// pager
85-
implementation(Dependencies.accompanistPager)
86-
implementation(Dependencies.accompanistIndicator)
84+
implementation(libs.accompanist.pager)
85+
implementation(libs.accompanist.indicator)
8786

88-
implementation(Dependencies.timber)
87+
implementation(libs.timber)
8988
}

app/src/main/kotlin/io/getstream/whatsappclone/navigation/WhatsAppNavigation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package io.getstream.whatsappclone.navigation
1818

1919
import androidx.compose.foundation.layout.padding
20-
import androidx.compose.material.Scaffold
20+
import androidx.compose.material3.Scaffold
2121
import androidx.compose.ui.Modifier
2222
import androidx.hilt.navigation.compose.hiltViewModel
2323
import androidx.navigation.NavGraphBuilder

app/src/main/kotlin/io/getstream/whatsappclone/ui/WhatsAppTabPager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import androidx.compose.foundation.layout.padding
2222
import androidx.compose.material.Tab
2323
import androidx.compose.material.TabRow
2424
import androidx.compose.material.TabRowDefaults
25-
import androidx.compose.material.Text
2625
import androidx.compose.material3.Icon
2726
import androidx.compose.material3.MaterialTheme
27+
import androidx.compose.material3.Text
2828
import androidx.compose.runtime.Composable
2929
import androidx.compose.runtime.LaunchedEffect
3030
import androidx.compose.runtime.rememberCoroutineScope

app/src/main/kotlin/io/getstream/whatsappclone/ui/WhatsAppTopBar.kt

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616

1717
package io.getstream.whatsappclone.ui
1818

19-
import androidx.compose.foundation.layout.Arrangement
20-
import androidx.compose.foundation.layout.Row
2119
import androidx.compose.foundation.layout.Spacer
2220
import androidx.compose.foundation.layout.fillMaxWidth
23-
import androidx.compose.foundation.layout.padding
2421
import androidx.compose.foundation.layout.size
25-
import androidx.compose.foundation.layout.wrapContentWidth
26-
import androidx.compose.material.TopAppBar
2722
import androidx.compose.material3.Icon
2823
import androidx.compose.material3.MaterialTheme
24+
import androidx.compose.material3.SmallTopAppBar
2925
import androidx.compose.material3.Text
26+
import androidx.compose.material3.TopAppBarDefaults
3027
import androidx.compose.runtime.Composable
3128
import androidx.compose.ui.Modifier
3229
import androidx.compose.ui.res.stringResource
@@ -38,44 +35,36 @@ import io.getstream.whatsappclone.designsystem.theme.WhatsAppCloneComposeTheme
3835

3936
@Composable
4037
fun WhatsAppTopBar() {
41-
TopAppBar(
38+
SmallTopAppBar(
4239
modifier = Modifier.fillMaxWidth(),
43-
backgroundColor = MaterialTheme.colorScheme.primary,
44-
elevation = 0.dp
45-
) {
46-
Row(
47-
modifier = Modifier
48-
.wrapContentWidth()
49-
.padding(12.dp)
50-
) {
40+
title = {
5141
Text(
5242
text = stringResource(id = R.string.app_name),
5343
color = MaterialTheme.colorScheme.tertiary,
5444
style = MaterialTheme.typography.titleLarge
5545
)
46+
},
47+
actions = {
48+
Icon(
49+
modifier = Modifier.size(26.dp),
50+
imageVector = WhatsAppIcons.Search,
51+
tint = MaterialTheme.colorScheme.tertiary,
52+
contentDescription = null
53+
)
5654

57-
Row(
58-
modifier = Modifier.fillMaxWidth(),
59-
horizontalArrangement = Arrangement.End
60-
) {
61-
Icon(
62-
modifier = Modifier.size(26.dp),
63-
imageVector = WhatsAppIcons.Search,
64-
tint = MaterialTheme.colorScheme.tertiary,
65-
contentDescription = null
66-
)
67-
68-
Spacer(modifier = Modifier.size(16.dp))
55+
Spacer(modifier = Modifier.size(16.dp))
6956

70-
Icon(
71-
modifier = Modifier.size(26.dp),
72-
imageVector = WhatsAppIcons.MoreVert,
73-
tint = MaterialTheme.colorScheme.tertiary,
74-
contentDescription = null
75-
)
76-
}
77-
}
78-
}
57+
Icon(
58+
modifier = Modifier.size(26.dp),
59+
imageVector = WhatsAppIcons.MoreVert,
60+
tint = MaterialTheme.colorScheme.tertiary,
61+
contentDescription = null
62+
)
63+
},
64+
colors = TopAppBarDefaults.smallTopAppBarColors(
65+
containerColor = MaterialTheme.colorScheme.primary
66+
)
67+
)
7968
}
8069

8170
@Preview

benchmark/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation(Dependencies.androidXTestRunner)
53-
implementation(Dependencies.macroBenchmark)
54-
implementation(Dependencies.profileInstaller)
55-
implementation(Dependencies.uiAutomator)
52+
implementation(libs.androidx.test.runner)
53+
implementation(libs.androidx.test.uiautomator)
54+
implementation(libs.androidx.benchmark.macro)
55+
implementation(libs.androidx.profileinstaller)
5656
}
5757

5858
androidComponents {

build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
1919
configureKotlinAndroid(this)
2020
defaultConfig.targetSdk = 32
2121
}
22-
23-
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
24-
dependencies {
25-
configurations.configureEach {
26-
resolutionStrategy {
27-
28-
}
29-
}
30-
}
3122
}
3223
}
3324
}

build.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ buildscript {
33
google()
44
maven("https://plugins.gradle.org/m2/")
55
}
6-
dependencies {
7-
classpath(Dependencies.androidGradlePlugin)
8-
classpath(Dependencies.kotlinGradlePlugin)
9-
classpath(Dependencies.kotlinSerializationPlugin)
10-
classpath(Dependencies.ksp)
11-
classpath(Dependencies.spotlessGradlePlugin)
12-
classpath(Dependencies.hiltPlugin)
13-
}
6+
}
7+
8+
plugins {
9+
alias(libs.plugins.android.application) apply false
10+
alias(libs.plugins.kotlin.jvm) apply false
11+
alias(libs.plugins.kotlin.serialization) apply false
12+
alias(libs.plugins.ksp) apply false
13+
alias(libs.plugins.hilt) apply false
14+
alias(libs.plugins.spotless) apply false
1415
}

buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 0 additions & 110 deletions
This file was deleted.

core-database/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434
dependencies {
3535
implementation(project(":core-model"))
3636

37-
implementation(Dependencies.roomRuntime)
38-
implementation(Dependencies.roomKtx)
39-
ksp(Dependencies.roomCompiler)
37+
implementation(libs.androidx.room.runtime)
38+
implementation(libs.androidx.room.ktx)
39+
ksp(libs.androidx.room.compiler)
4040
}

core-designsystem/build.gradle.kts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ plugins {
2020
}
2121

2222
dependencies {
23-
api(Dependencies.composeUI)
24-
api(Dependencies.composeMaterial)
25-
api(Dependencies.composeMaterial3)
26-
api(Dependencies.composeMaterialIcon)
27-
api(Dependencies.composeFoundation)
28-
api(Dependencies.composeFoundationLayout)
29-
api(Dependencies.composeConstraintLayout)
30-
api(Dependencies.composeRuntime)
31-
api(Dependencies.composeTooling)
32-
api(Dependencies.landscapistGlide)
23+
// image loading
24+
api(libs.landscapist.glide)
25+
26+
api(libs.androidx.compose.runtime)
27+
api(libs.androidx.compose.ui)
28+
api(libs.androidx.compose.ui.tooling)
29+
api(libs.androidx.compose.ui.tooling.preview)
30+
api(libs.androidx.compose.material.iconsExtended)
31+
api(libs.androidx.compose.material)
32+
api(libs.androidx.compose.material3)
33+
api(libs.androidx.compose.foundation)
34+
api(libs.androidx.compose.foundation.layout)
35+
api(libs.androidx.compose.constraintlayout)
3336
}

0 commit comments

Comments
 (0)