David
10/13/2023, 10:09 AMkonsist-starter-android-gradle-kotlin-junit-4
(Other probably work too but this was the most similar to our setup)
2. Run the konsist tests: ./gradlew konsist_test:test
, see successful result
3. Modify app/src/main/java/com/sample/MainActivity.kt
and change class name to MainActivit
4. Run the konsist tests again: ./gradlew konsist_test:test
, see successful result 👀
My full output:
rawa@Davids-MacBook-Pro ➜ konsist-starter-android-gradle-kotlin-junit-4 git:(main) ./gradlew konsist_test:test
BUILD SUCCESSFUL in 4s
26 actionable tasks: 6 executed, 20 up-to-date
rawa@Davids-MacBook-Pro ➜ konsist-starter-android-gradle-kotlin-junit-4 git:(main) vim app/src/main/java/com/sample/MainActivity.kt
rawa@Davids-MacBook-Pro ➜ konsist-starter-android-gradle-kotlin-junit-4 git:(main) ✗ ./gradlew konsist_test:test
BUILD SUCCESSFUL in 447ms
26 actionable tasks: 26 up-to-date
rawa@Davids-MacBook-Pro ➜ konsist-starter-android-gradle-kotlin-junit-4 git:(main) ✗
It seems like it does not care to refresh any cache, I'm not an expert on the build system. But creating an explicit dependency on the project will trigger a rebuild of :app
module, and then the project will be recompile and tests fail correctly.
In konsist_test/build.gradle.kts
add dependency:
implementation(project(":app"))
Marcin Wisniowski
10/13/2023, 10:49 AM--rerun
to the Gradle command to make it run anyway.igor.wojda
10/13/2023, 10:49 AMMarcin Wisniowski
10/13/2023, 10:50 AM./gradlew konsist_test:test --rerun
to prevent Gradle thinking it’s up to date.igor.wojda
10/13/2023, 10:51 AMMarcin Wisniowski
10/13/2023, 10:52 AMigor.wojda
10/13/2023, 10:52 AMMarcin Wisniowski
10/13/2023, 10:53 AMigor.wojda
10/13/2023, 10:55 AM./gradlew konsist_test:test --rerun-tasks
is a way to goDavid
10/13/2023, 11:00 AMigor.wojda
10/13/2023, 11:01 AM