File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ dependencies {
140140}
141141
142142tasks.test {
143+ systemProperty(" java.awt.headless" , " true" )
143144 useJUnitPlatform()
144145 workingDir = file(" build/test" )
145146 workingDir.mkdirs()
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import processing.app.*
3939import processing.app.api.Contributions.ExamplesList.Companion.listAllExamples
4040import processing.app.api.Sketch.Companion.Sketch
4141import processing.app.ui.theme.*
42+ import java.awt.GraphicsEnvironment
4243import java.io.File
4344import kotlin.io.path.Path
4445import kotlin.io.path.exists
@@ -554,10 +555,14 @@ fun Sketch.card(onOpen: () -> Unit = {}) {
554555}
555556
556557fun noBaseWarning () {
557- Messages .showWarning(
558- " No Base" ,
559- " No Base instance provided, this ui is likely being previewed."
560- )
558+ if (Base .isCommandLine() || GraphicsEnvironment .isHeadless()) {
559+ System .err.println (" No Base instance provided, this ui is likely being previewed" );
560+ } else {
561+ Messages .showWarning(
562+ " No Base" ,
563+ " No Base instance provided, this ui is likely being previewed."
564+ )
565+ }
561566}
562567
563568val size = DpSize (970 .dp, 600 .dp)
You can’t perform that action at this time.
0 commit comments