diff --git a/app/src/test/kotlin/waituntil/AppTest.kt b/app/src/test/kotlin/waituntil/AppTest.kt deleted file mode 100644 index b39b0d4..0000000 --- a/app/src/test/kotlin/waituntil/AppTest.kt +++ /dev/null @@ -1,16 +0,0 @@ -/* - * This Kotlin source file was generated by the Gradle 'init' task. - */ -package de.jotoho.waituntil - -import kotlin.test.Test -import kotlin.test.assertNotNull - -class AppTest { - /* - @Test fun appHasAGreeting() { - val classUnderTest = App() - assertNotNull(classUnderTest.greeting, "app should have a greeting") - } - */ -} diff --git a/app/build.gradle.kts b/build.gradle.kts similarity index 89% rename from app/build.gradle.kts rename to build.gradle.kts index cd8a815..cf34629 100644 --- a/app/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,8 @@ * User Manual available at https://docs.gradle.org/7.2/userguide/building_java_projects.html */ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. id("org.jetbrains.kotlin.jvm") version "1.+" @@ -26,7 +28,7 @@ dependencies { // Align versions of all Kotlin components implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - // Use the Kotlin JDK 8 standard library. + // Use the Kotlin standard library. implementation("org.jetbrains.kotlin:kotlin-stdlib") // Use the Kotlin test library. @@ -41,7 +43,11 @@ java { targetCompatibility = JavaVersion.VERSION_17 } -tasks.withType() { +tasks.test { + useJUnitPlatform() +} + +tasks.withType() { kotlinOptions.jvmTarget = "17" } diff --git a/settings.gradle.kts b/settings.gradle.kts index d59993a..599ab7a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,4 +8,3 @@ */ rootProject.name = "waituntil" -include("app") diff --git a/app/src/main/kotlin/de/jotoho/waituntil/sleeping.kt b/src/main/kotlin/de/jotoho/waituntil/sleeping.kt similarity index 94% rename from app/src/main/kotlin/de/jotoho/waituntil/sleeping.kt rename to src/main/kotlin/de/jotoho/waituntil/sleeping.kt index 8feb564..b318873 100644 --- a/app/src/main/kotlin/de/jotoho/waituntil/sleeping.kt +++ b/src/main/kotlin/de/jotoho/waituntil/sleeping.kt @@ -1,12 +1,11 @@ package de.jotoho.waituntil -import java.lang.Math import java.time.Instant import java.time.ZonedDateTime import java.time.format.DateTimeFormatter import java.time.format.FormatStyle import java.time.temporal.ChronoUnit -import java.util.TimeZone +import java.util.* public fun waitUntilTimeStamp(timestamp: ZonedDateTime) { Thread.sleep(Math.max(Instant.now().until(timestamp, ChronoUnit.MILLIS), 0)) diff --git a/app/src/main/kotlin/de/jotoho/waituntil/start.kt b/src/main/kotlin/de/jotoho/waituntil/start.kt similarity index 85% rename from app/src/main/kotlin/de/jotoho/waituntil/start.kt rename to src/main/kotlin/de/jotoho/waituntil/start.kt index abfdc68..4ed1795 100644 --- a/app/src/main/kotlin/de/jotoho/waituntil/start.kt +++ b/src/main/kotlin/de/jotoho/waituntil/start.kt @@ -1,16 +1,6 @@ package de.jotoho.waituntil -import java.util.Locale -import java.time.format.DateTimeFormatter -import java.util.TimeZone -import java.time.Instant -import java.time.LocalTime -import java.time.LocalDate -import java.time.ZonedDateTime -import java.time.temporal.ChronoUnit - -import de.jotoho.waituntil.waitUntilTimeStamp -import de.jotoho.waituntil.calculateAndAnnounceTargetTime +import java.util.* // This file contains the main function and other utility function necessary for interpreting the terminal arguments. // See README.md and LICENSE.md for license information diff --git a/app/src/main/kotlin/de/jotoho/waituntil/timecalc.kt b/src/main/kotlin/de/jotoho/waituntil/timecalc.kt similarity index 100% rename from app/src/main/kotlin/de/jotoho/waituntil/timecalc.kt rename to src/main/kotlin/de/jotoho/waituntil/timecalc.kt