Skip to content

Commit 0778a2d

Browse files
authored
Merge pull request #92 from azrael8576/chore/cleanup-dependencies
Remove unnecessary FlowPreview & RequiresOptIn opt-in
2 parents d41e1f3 + 5d569be commit 0778a2d

File tree

15 files changed

+71
-61
lines changed

15 files changed

+71
-61
lines changed

app/build.gradle.kts

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ android {
4444
release {
4545
isMinifyEnabled = true
4646
applicationIdSuffix = AtBuildType.RELEASE.applicationIdSuffix
47-
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
47+
proguardFiles(
48+
getDefaultProguardFile("proguard-android-optimize.txt"),
49+
"proguard-rules.pro",
50+
)
4851

4952
// To publish on the Play store a private signing key is required, but to allow anyone
5053
// who clones the code to sign and run the release variant, use the debug signing key.
@@ -66,29 +69,36 @@ android {
6669
}
6770

6871
dependencies {
69-
implementation(project(":feature:login"))
70-
implementation(project(":feature:teacherschedule"))
71-
implementation(project(":feature:home"))
72-
implementation(project(":feature:contactme"))
73-
74-
implementation(project(":core:designsystem"))
75-
implementation(project(":core:common"))
76-
implementation(project(":core:data"))
77-
implementation(project(":core:model"))
78-
implementation(project(":core:datastore"))
79-
80-
androidTestImplementation(project(":core:designsystem"))
81-
androidTestImplementation(project(":core:datastore-test"))
82-
androidTestImplementation(project(":core:testing"))
72+
implementation(projects.feature.login)
73+
implementation(projects.feature.teacherschedule)
74+
implementation(projects.feature.home)
75+
implementation(projects.feature.contactme)
76+
77+
implementation(projects.core.designsystem)
78+
implementation(projects.core.common)
79+
implementation(projects.core.data)
80+
implementation(projects.core.model)
81+
implementation(projects.core.datastore)
82+
83+
androidTestImplementation(projects.core.designsystem)
84+
androidTestImplementation(projects.core.datastoreTest)
85+
androidTestImplementation(projects.core.testing)
86+
8387
androidTestImplementation(libs.androidx.navigation.testing)
8488
androidTestImplementation(libs.accompanist.testharness)
85-
testImplementation(project(":core:datastore-test"))
86-
testImplementation(project(":core:testing"))
89+
90+
testImplementation(projects.core.datastoreTest)
91+
testImplementation(projects.core.testing)
92+
8793
testImplementation(libs.androidx.navigation.testing)
8894
testImplementation(libs.accompanist.testharness)
89-
debugImplementation(project(":ui-test-hilt-manifest"))
95+
96+
debugImplementation(projects.uiTestHiltManifest)
97+
9098
debugImplementation(libs.androidx.compose.ui.testManifest)
9199

100+
kspTest(libs.hilt.compiler)
101+
92102
implementation(libs.androidx.core.ktx)
93103
implementation(libs.androidx.activity.compose)
94104

@@ -111,4 +121,4 @@ dependencies {
111121

112122
// LeakCanary
113123
debugImplementation(libs.leakcanary)
114-
}
124+
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class AndroidHiltConventionPlugin : Plugin<Project> {
1414
dependencies {
1515
"implementation"(libs.findLibrary("hilt.android").get())
1616
"ksp"(libs.findLibrary("hilt.compiler").get())
17-
"kspAndroidTest"(libs.findLibrary("hilt.compiler").get())
18-
"kspTest"(libs.findLibrary("hilt.compiler").get())
1917
}
2018
}
2119
}

build-logic/convention/src/main/kotlin/com/wei/amazingtalker/KotlinAndroid.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ private fun Project.configureKotlin() {
6262
allWarningsAsErrors = warningsAsErrors.toBoolean()
6363
freeCompilerArgs = freeCompilerArgs +
6464
listOf(
65-
"-opt-in=kotlin.RequiresOptIn",
6665
// Enable experimental coroutines APIs, including Flow
6766
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
68-
"-opt-in=kotlinx.coroutines.FlowPreview",
6967
)
7068
}
7169
}

core/common/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ android {
1313
}
1414

1515
dependencies {
16-
implementation(project(":core:model"))
16+
implementation(projects.core.model)
1717

1818
// LifeCycle
1919
implementation(libs.androidx.lifecycle.runtimeCompose)
2020

2121
// Coroutines
2222
implementation(libs.kotlinx.coroutines.android)
23-
}
23+
}

core/data-test/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
}
99

1010
dependencies {
11-
api(project(":core:data"))
11+
api(projects.core.data)
1212

1313
implementation(libs.hilt.android.testing)
14-
}
14+
}

core/data/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
}
1515

1616
dependencies {
17-
implementation(project(":core:common"))
18-
implementation(project(":core:network"))
19-
implementation(project(":core:model"))
20-
implementation(project(":core:datastore"))
21-
}
17+
implementation(projects.core.common)
18+
implementation(projects.core.network)
19+
implementation(projects.core.model)
20+
implementation(projects.core.datastore)
21+
}

core/data/src/main/java/com/wei/amazingtalker/core/data/di/DataModule.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ import dagger.hilt.components.SingletonComponent
1515

1616
@Module
1717
@InstallIn(SingletonComponent::class)
18-
interface DataModule {
18+
abstract class DataModule {
1919
@Binds
20-
fun bindsProfileRepository(profileRepository: FakeProfileRepository): ProfileRepository
20+
internal abstract fun bindsProfileRepository(profileRepository: FakeProfileRepository): ProfileRepository
2121

2222
@Binds
23-
fun bindsTeacherScheduleRepository(teacherScheduleRepository: DefaultTeacherScheduleRepository): TeacherScheduleRepository
23+
internal abstract fun bindsTeacherScheduleRepository(
24+
teacherScheduleRepository: DefaultTeacherScheduleRepository,
25+
): TeacherScheduleRepository
2426

2527
@Binds
26-
fun bindsNetworkMonitor(networkMonitor: ConnectivityManagerNetworkMonitor): NetworkMonitor
28+
internal abstract fun bindsNetworkMonitor(networkMonitor: ConnectivityManagerNetworkMonitor): NetworkMonitor
2729

2830
@Binds
29-
fun bindsUserDataRepository(userDataRepository: DefaultUserDataRepository): UserDataRepository
31+
internal abstract fun bindsUserDataRepository(userDataRepository: DefaultUserDataRepository): UserDataRepository
3032
}

core/datastore-test/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ android {
99
}
1010

1111
dependencies {
12-
api(project(":core:datastore"))
13-
implementation(project(":core:testing"))
14-
implementation(project(":core:common"))
15-
implementation(project(":core:model"))
12+
api(projects.core.datastore)
13+
implementation(projects.core.testing)
14+
implementation(projects.core.common)
15+
implementation(projects.core.model)
1616

1717
// DataStore
1818
implementation(libs.androidx.datastore)
1919

2020
// Protobuf
2121
implementation(libs.protobuf.kotlin.lite)
22-
}
22+
}

core/datastore/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ android {
1818
}
1919

2020
dependencies {
21-
api(project(":core:datastore-proto"))
22-
implementation(project(":core:common"))
23-
implementation(project(":core:model"))
21+
api(projects.core.datastoreProto)
22+
implementation(projects.core.common)
23+
implementation(projects.core.model)
2424

2525
// DataStore
2626
implementation(libs.androidx.datastore)
2727

2828
// Protobuf
2929
implementation(libs.protobuf.kotlin.lite)
30-
}
30+
}

core/designsystem/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313
}
1414

1515
dependencies {
16-
androidTestImplementation(project(":core:testing"))
16+
androidTestImplementation(projects.core.testing)
1717

1818
// Write trace events to the system trace buffer.
1919
api(libs.androidx.tracing.ktx)
@@ -48,4 +48,4 @@ dependencies {
4848
implementation(libs.coil.kt.svg)
4949
// kotlin datetime
5050
implementation(libs.kotlinx.datetime)
51-
}
51+
}

core/domain/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
}
99

1010
dependencies {
11-
implementation(project(":core:common"))
12-
implementation(project(":core:data"))
13-
implementation(project(":core:model"))
14-
implementation(project(":core:network"))
15-
}
11+
implementation(projects.core.common)
12+
implementation(projects.core.data)
13+
implementation(projects.core.model)
14+
implementation(projects.core.network)
15+
}

core/network/src/main/java/com/wei/amazingtalker/core/network/di/FlavoredNetworkModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import dagger.hilt.components.SingletonComponent
1212
*/
1313
@Module
1414
@InstallIn(SingletonComponent::class)
15-
interface FlavoredNetworkModule {
15+
internal interface FlavoredNetworkModule {
1616
@Binds
1717
fun binds(implementation: RetrofitAtNetwork): AtNetworkDataSource
1818
}

core/network/src/main/java/com/wei/amazingtalker/core/network/di/NetworkModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import javax.inject.Singleton
1313

1414
@Module
1515
@InstallIn(SingletonComponent::class)
16-
object NetworkModule {
16+
internal object NetworkModule {
1717
@Provides
1818
@Singleton
1919
fun providesNetworkJson(): Json =

core/testing/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ android {
99
}
1010

1111
dependencies {
12-
implementation(project(":core:common"))
13-
implementation(project(":core:data"))
14-
implementation(project(":core:model"))
15-
implementation(project(":core:domain"))
16-
implementation(project(":core:network"))
17-
implementation(project(":core:designsystem"))
12+
implementation(projects.core.common)
13+
implementation(projects.core.data)
14+
implementation(projects.core.model)
15+
implementation(projects.core.domain)
16+
implementation(projects.core.network)
17+
implementation(projects.core.designsystem)
1818

1919
api(libs.junit4)
2020
api(libs.androidx.activity.compose)

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ dependencyResolutionManagement {
1515
}
1616
}
1717
rootProject.name = "amazingtalker"
18+
19+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
1820
include(":app")
1921

2022
include(":core:network")

0 commit comments

Comments
 (0)