diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a227795..2a0f1dd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,7 @@ @Suppress("DSL_SCOPE_VIOLATION") plugins { alias(libs.plugins.sopt.android.application) + alias(libs.plugins.sopt.android.test) alias(libs.plugins.sopt.android.hilt) } @@ -25,15 +26,11 @@ android { } dependencies { - implementation(projects.core.ui) - implementation(projects.core.model) implementation(projects.core.designsystem) + implementation(projects.core.datastore) implementation(projects.core.database) implementation(projects.core.common) implementation(projects.core.data) - implementation(projects.core.domain) + implementation(projects.feature.main) - implementation(projects.feature.home) - implementation(projects.feature.search) - implementation(projects.feature.mypage) } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 734baf7..fd697fd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,24 +15,19 @@ tools:targetApi="31"> - - - - - - + + + - \ No newline at end of file diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 688327a..86dd599 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -51,5 +51,15 @@ gradlePlugin { id = "sopt.plugin.data" implementationClass = "DataPlugin" } + + register("AndroidTest") { + id = "sopt.android.test" + implementationClass = "AndroidTestPlugin" + } + + register("UnitTest") { + id = "sopt.plugin.test" + implementationClass = "UnitTestPlugin" + } } } \ No newline at end of file diff --git a/build-logic/convention/src/main/java/AndroidTestPlugin.kt b/build-logic/convention/src/main/java/AndroidTestPlugin.kt new file mode 100644 index 0000000..9836a53 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidTestPlugin.kt @@ -0,0 +1,16 @@ +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.sopt.convention.libs + +class AndroidTestPlugin : Plugin { + override fun apply(target: Project) { + with(target){ + dependencies { + "androidTestImplementation"(libs.findLibrary("androidx.test.runner").get()) + "debugImplementation"(libs.findLibrary("androidx.test.core").get()) + "androidTestImplementation"(libs.findLibrary("kotlinx.coroutines.test").get()) + } + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/java/UnitTestPlugin.kt b/build-logic/convention/src/main/java/UnitTestPlugin.kt new file mode 100644 index 0000000..3e83f3d --- /dev/null +++ b/build-logic/convention/src/main/java/UnitTestPlugin.kt @@ -0,0 +1,16 @@ +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.sopt.convention.libs + +class UnitTestPlugin : Plugin { + override fun apply(target: Project) { + with(target){ + dependencies { + "testImplementation"(libs.findLibrary("kotlinx.coroutines.test").get()) + "testImplementation"(libs.findLibrary("mockito").get()) + "testImplementation"(libs.findLibrary("junit").get()) + } + } + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 31a58bb..b731b76 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ plugins { alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.hilt) apply false + alias(libs.plugins.android.test) apply false } buildscript { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c332ee1..b5fcab5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,10 @@ android-gradle-plugin = "8.3.1" core-ktx = "1.12.0" junit = "4.13.2" +mockito = "3.3.3" androidx-test-ext-junit = "1.1.5" +androidx-test-runner = "1.5.2" +androidx-test = "1.5.0" espresso-core = "3.5.1" appcompat = "1.6.1" material = "1.11.0" @@ -65,14 +68,17 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } google-service = { id = "com.google.gms.google-services", version.ref = "google-service" } navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidx-navigation" } +android-test = { id = "com.android.test", version.ref = "android-gradle-plugin" } sopt-android-application = { id = "sopt.android.application", version = "unspecified" } sopt-android-library = { id = "sopt.android.library", version = "unspecified" } -sopt-android-hilt = { id = "sopt.android.hilt", version = "unspecified"} +sopt-android-hilt = { id = "sopt.android.hilt", version = "unspecified" } sopt-java-library = { id = "sopt.java.library", version = "unspecified" } +sopt-android-test = { id = "sopt.android.test", version = "unspecified" } sopt-plugin-feature = { id = "sopt.plugin.feature", version = "unspecified" } sopt-plugin-room = { id = "sopt.plugin.room", version = "unspecified" } sopt-plugin-data = { id = "sopt.plugin.data", version = "unspecified" } +sopt-plugin-test = { id = "sopt.plugin.test", version = "unspecified" } [libraries] # Dependencies of the included build-logic @@ -81,7 +87,10 @@ kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-p ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" } junit = { group = "junit", name = "junit", version.ref = "junit" } +mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" } androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" } +androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidx-test-runner" } +androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidx-test" } espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" } appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } @@ -100,6 +109,7 @@ orbit-viewmodel = { group = "org.orbit-mvi", name = "orbit-viewmodel", version.r kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" } +kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" } kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" } retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }