Skip to content

Commit a36c8a3

Browse files
committed
Plugin tests bugfixes
1 parent 7379166 commit a36c8a3

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

java/gradle/src/main/kotlin/PDETask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ abstract class PDETask : SourceTask() {
5151
.files
5252
.groupBy { it.name }
5353
.map { entry ->
54-
// TODO: Select by which one is in the unsaved folder
55-
entry.value.maxByOrNull { it.lastModified() }!!
54+
entry.value.firstOrNull { it.parentFile?.name == "unsaved" }
55+
?: entry.value.first()
5656
}
5757
.joinToString("\n"){
5858
it.readText()

java/gradle/src/test/kotlin/ProcessingPluginTest.kt

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ProcessingPluginTest{
7575
@Test
7676
fun testMultiplePDE(){
7777
val (buildResult, sketchFolder, classLoader) = createTemporaryProcessingSketch("build"){ sketchFolder ->
78-
sketchFolder.resolve("sketch.pde").writeText(""")
78+
sketchFolder.resolve("sketch.pde").writeText("""
7979
void setup(){
8080
size(100, 100);
8181
}
@@ -175,24 +175,29 @@ class ProcessingPluginTest{
175175
}
176176
}
177177

178-
}
178+
@Test
179+
fun testImportingLibrary(){
180+
181+
}
179182

183+
fun isDebuggerAttached(): Boolean {
184+
val runtimeMxBean = ManagementFactory.getRuntimeMXBean()
185+
val inputArguments = runtimeMxBean.inputArguments
186+
return inputArguments.any {
187+
it.contains("-agentlib:jdwp")
188+
}
189+
}
190+
fun openFolderInFinder(folder: File) {
191+
if (!folder.exists() || !folder.isDirectory) {
192+
println("Invalid directory: ${folder.absolutePath}")
193+
return
194+
}
180195

181-
fun isDebuggerAttached(): Boolean {
182-
val runtimeMxBean = ManagementFactory.getRuntimeMXBean()
183-
val inputArguments = runtimeMxBean.inputArguments
184-
return inputArguments.any {
185-
it.contains("-agentlib:jdwp")
196+
val process = ProcessBuilder("open", folder.absolutePath)
197+
.inheritIO()
198+
.start()
199+
process.waitFor()
186200
}
187201
}
188-
fun openFolderInFinder(folder: File) {
189-
if (!folder.exists() || !folder.isDirectory) {
190-
println("Invalid directory: ${folder.absolutePath}")
191-
return
192-
}
193202

194-
val process = ProcessBuilder("open", folder.absolutePath)
195-
.inheritIO()
196-
.start()
197-
process.waitFor()
198-
}
203+

0 commit comments

Comments
 (0)