Skip to content

Commit

Permalink
create and use testing-convention plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Feb 20, 2024
1 parent 331da05 commit 04951b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
20 changes: 20 additions & 0 deletions build-logic/src/main/kotlin/testing-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import gradle.kotlin.dsl.accessors._624aae704a5c30b505ab3598db099943.androidTestImplementation
import gradle.kotlin.dsl.accessors._624aae704a5c30b505ab3598db099943.testImplementation

applyBundle("testing") {
dependencies {
testImplementation(it)
}
}

applyBundle("mockk") {
dependencies {
testImplementation(it)
}
}

applyBundle("android-testing") {
dependencies {
androidTestImplementation(it)
}
}
5 changes: 1 addition & 4 deletions core/network-retrofit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id("library-convention")
id("hilt-convention")
id("testing-convention")

alias(libs.plugins.kotlin.serialization)
}
Expand All @@ -15,8 +16,4 @@ dependencies {
implementation(platform(libs.okhttp.bom))
implementation(libs.bundles.retrofit)
testImplementation(libs.okhttp.mockwebserver)

// Testing
testImplementation(libs.bundles.testing)
testImplementation(libs.bundles.mockk)
}
6 changes: 1 addition & 5 deletions core/storage-roomdb/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id("library-convention")
id("hilt-convention")
id("testing-convention")
}

android {
Expand All @@ -12,9 +13,4 @@ dependencies {
// Room
api(libs.bundles.room)
ksp(libs.room.compiler)

// Testing
testImplementation(libs.bundles.testing)
testImplementation(libs.bundles.mockk)
androidTestImplementation(libs.bundles.android.testing)
}
6 changes: 1 addition & 5 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id("library-convention")
id("hilt-convention")
id("testing-convention")
}

android {
Expand All @@ -26,9 +27,4 @@ dependencies {

// Lifecycle
implementation(libs.lifecycle.viewmodel.ktx)

// Testing
testImplementation(libs.bundles.testing)
testImplementation(libs.bundles.mockk)
androidTestImplementation(libs.bundles.android.testing)
}
7 changes: 1 addition & 6 deletions domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
plugins {
id("library-convention")
id("hilt-convention")
id("testing-convention")
}

android {
namespace = "com.nisrulz.example.spacexapi.domain"
}

dependencies {
// Testing
testImplementation(libs.bundles.testing)
testImplementation(libs.bundles.mockk)
}
6 changes: 1 addition & 5 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id("library-convention")
id("hilt-convention")
id("testing-convention")
}
android {
namespace = "com.nisrulz.example.spacexapi.presentation"
Expand Down Expand Up @@ -39,9 +40,4 @@ dependencies {

// Debug
debugImplementation(libs.bundles.compose.debug)

// Testing
testImplementation(libs.bundles.testing)
testImplementation(libs.bundles.mockk)
androidTestImplementation(libs.bundles.android.testing)
}

0 comments on commit 04951b0

Please sign in to comment.