Skip to content

Commit f8c72a6

Browse files
authored
Merge pull request #62 from Dai1678/feature/kotest
Kotestの導入
2 parents ab22972 + 3f34795 commit f8c72a6

File tree

34 files changed

+398
-340
lines changed

34 files changed

+398
-340
lines changed

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ jobs:
7373
script: ./gradlew connectedCheck --no-daemon --stacktrace
7474

7575
- name: Run kover coverage report
76+
if: always()
7677
run: ./gradlew koverXmlReport --no-daemon --stacktrace
7778

7879
- name: Upload Coverage to CodeCov
7980
uses: codecov/codecov-action@v4
81+
if: always()
8082
with:
81-
fail_ci_if_error: true
8283
files: ./build/reports/kover/report.xml
83-
token: ${{ secrets.CODECOV_TOKEN }} # TODO Add CODECOV_TOKEN to your repository secrets
84+
token: ${{ secrets.CODECOV_TOKEN }}
8485
verbose: true
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.dai.android.architecture.template.provider
22

33
object ServerEnvironment {
4-
const val BASE_URL = "https://hoge.com"
4+
const val BASE_URL =
5+
"https://raw.githubusercontent.com/Dai1678/AndroidArchitectureTemplate/main/core/network/src/test/resources/"
56
}

build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
2727
}
2828
}
2929

30-
@Suppress("UnstableApiUsage")
31-
testOptions.animationsDisabled = true
32-
3330
lint(Lint::configure)
3431
}
3532
}

build-logic/convention/src/main/java/AndroidFeatureConventionPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
1818
apply("android.architecture.template.detekt")
1919
}
2020
extensions.configure<LibraryExtension> {
21-
testOptions.animationsDisabled = true
2221
lint(Lint::configure)
2322
}
2423

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
2222
extensions.configure<LibraryExtension> {
2323
configureKotlinAndroid(this)
2424
defaultConfig.targetSdk = 34
25-
testOptions.animationsDisabled = true
2625
// The resource prefix is derived from the module name,
2726
// so resources inside ":core:module1" must be prefixed with "core_module1_"
2827
resourcePrefix =

build-logic/convention/src/main/java/KoverConventionPlugin.kt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,29 @@ class KoverConventionPlugin : Plugin<Project> {
2121
configure<KoverProjectExtension> {
2222
reports {
2323
filters {
24-
includes.packages("dev.dai.android.architecture.*")
24+
includes.packages("dev.dai.android.architecture.template.*")
2525
excludes {
2626
packages(
2727
"dagger.hilt.*",
2828
"hilt_aggregated_deps",
29-
"dev.dai.android.architecture.designsystem",
30-
"dev.dai.android.architecture.ui",
29+
"dev.dai.android.architecture.template.designsystem",
30+
"dev.dai.android.architecture.template.provider",
31+
"dev.dai.android.architecture.template.di",
32+
"dev.dai.android.architecture.template.*.di"
3133
)
3234
classes(
3335
// classes generated by Hilt
34-
"Hilt_*",
36+
"Hilt_**",
3537
"*_HiltModules*",
3638
"*Factory*",
3739
"*Module*",
3840
// classes project specific
39-
"*App",
40-
"*Provider",
41-
"*NavHostKt",
42-
"*Activity*",
43-
"ComposableSingletons*",
44-
"*ScreenKt*",
41+
"*App*",
42+
"BuildConfig",
43+
"*Provider*",
44+
"*NavHost*",
45+
"ComposableSingletons",
46+
"*Screen*",
4547
)
4648
androidGeneratedClasses()
4749
}

build-logic/convention/src/main/java/dev/dai/android/architecture/template/buildlogic/AndroidCompose.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,5 @@ internal fun Project.configureAndroidCompose(
2626
implementation(libs.library("androidx-compose-ui-tooling-preview"))
2727
debugImplementation(libs.library("androidx-compose-ui-tooling"))
2828
}
29-
30-
testOptions {
31-
unitTests {
32-
// For Robolectric
33-
isIncludeAndroidResources = true
34-
}
35-
}
3629
}
3730
}

build-logic/convention/src/main/java/dev/dai/android/architecture/template/buildlogic/KotlinAndroid.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ internal fun Project.configureKotlinAndroid(
2727
sourceCompatibility = JavaVersion.VERSION_17
2828
targetCompatibility = JavaVersion.VERSION_17
2929
}
30+
31+
@Suppress("UnstableApiUsage")
32+
testOptions {
33+
animationsDisabled = true
34+
unitTests.isIncludeAndroidResources = true
35+
unitTests.all { it.useJUnitPlatform() }
36+
}
3037
}
3138

3239
extensions.configure<KotlinAndroidProjectExtension> {

codecov.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ignore:
2+
- "dagger.hilt.*"
3+
- "hilt_aggregated_deps"
4+
- "Hilt_**"
5+
- "*_HiltModules*"
6+
- "*Factory*"
7+
- "*Module*"
8+
- "*/designsystem/*"
9+
- "*/ui/*"
10+
- "*/di/*"
11+
- "*App*"
12+
- "*Provider*"
13+
- "*NavHost*"
14+
- "ComposableSingletons"
15+
- "*Screen*"
16+
- "*Fragment"
17+
- "*Activity"
18+
- "*/BuildConfig"

core/data/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ dependencies {
1313
testImplementation(project(":core:testing"))
1414

1515
implementation(libs.kotlinx.coroutines.android)
16-
implementation(libs.kotlinx.coroutines.test)
16+
17+
testImplementation(libs.kotlinx.coroutines.test)
18+
testImplementation(libs.kotest.runner.junit5)
19+
testImplementation(libs.kotest.assertions.core)
20+
testImplementation(libs.kotest.property)
1721
}

0 commit comments

Comments
 (0)