Skip to content

Commit

Permalink
Add more dependencies to r8 test
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt committed Aug 24, 2024
1 parent 3057899 commit 38779a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion test/proguard/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ repositories {
val r8: Configuration by configurations.creating

dependencies {
implementation(project(":mordant"))
implementation(project(":mordant-omnibus"))
implementation(project(":mordant-markdown"))
implementation(project(":mordant-coroutines"))
r8(libs.r8)
}

Expand Down
12 changes: 8 additions & 4 deletions test/proguard/src/main/kotlin/R8SmokeTest.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package com.github.ajalt.mordant.main

import com.github.ajalt.mordant.animation.coroutines.animateInCoroutine
import com.github.ajalt.mordant.animation.progress.animateOnThread
import com.github.ajalt.mordant.animation.progress.execute
import com.github.ajalt.mordant.markdown.Markdown
import com.github.ajalt.mordant.rendering.AnsiLevel
import com.github.ajalt.mordant.terminal.Terminal
import com.github.ajalt.mordant.widgets.progress.progressBar
import com.github.ajalt.mordant.widgets.progress.progressBarLayout
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

fun main(args: Array<String>) {
suspend fun main(args: Array<String>) = coroutineScope{
// make sure that the terminal detection doesn't crash.
Terminal()

// make sure animations and markdown don't crash.
val t = Terminal(interactive = true, ansiLevel = AnsiLevel.TRUECOLOR)
val animation = progressBarLayout { progressBar() }.animateOnThread(t, total = 1)
animation.execute()
val animation = progressBarLayout { progressBar() }.animateInCoroutine(t, total = 1)
launch { animation.execute() }
t.print(Markdown("- Your args: **${args.asList()}**"))
Thread.sleep(100)
delay(100)
animation.update { completed = 1 }
}

0 comments on commit 38779a5

Please sign in to comment.