From c0de363db5b81b9d545ca99daae1423547a00d38 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Fri, 11 Sep 2026 16:05:25 +0200 Subject: [PATCH] test(arch): keep the alarm engine free of Android The engine and the domain stay plain Kotlin, which is the only reason the DST, skip and snooze behaviour can be pinned by 326 JVM tests instead of an emulator. That is worth a test that fails the build when it stops being true. Co-Authored-By: Claude Opus 5 --- .../clockula/ArchitectureRulesTest.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt b/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt index 5cb6e2f..69309d3 100644 --- a/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt +++ b/app/src/test/java/de/jeanlucmakiola/clockula/ArchitectureRulesTest.kt @@ -46,6 +46,9 @@ class ArchitectureRulesTest { "TimerEntity", "WorldClockEntity", "LapEntity", + "AlarmStateEntity", + "AlarmStateDao", + "AlarmStateMapper", "AlarmDao", "TimerDao", "WorldClockDao", @@ -66,4 +69,21 @@ class ArchitectureRulesTest { assertThat(offenders).isEmpty() } + + @Test + fun `the alarm engine and its pure neighbours stay free of Android types`() { + val jvmTestable = kotlinSources.filter { file -> + val path = file.invariantSeparatorsPath + path.contains("de/jeanlucmakiola/clockula/domain/alarm/") || + path.endsWith("de/jeanlucmakiola/clockula/alarm/AlarmEngine.kt") || + path.endsWith("de/jeanlucmakiola/clockula/alarm/AlarmResolver.kt") || + path.contains("de/jeanlucmakiola/clockula/system/") + } + + val offenders = jvmTestable.filter { file -> + file.readLines().any { it.startsWith("import android.") || it.startsWith("import androidx.") } + }.map { it.invariantSeparatorsPath } + + assertThat(offenders).isEmpty() + } }