Improve support for olive programs inside packages
This commit is contained in:
@@ -20,7 +20,7 @@ fun stackRootClassName(thread: Thread = Thread.currentThread(), sanitize: Boolea
|
||||
}
|
||||
|
||||
fun ApplicationBuilder.oliveProgram(init: OliveProgram.() -> Unit): OliveProgram {
|
||||
val rootClassName = stackRootClassName(sanitize = true)
|
||||
val rootClassName = stackRootClassName(sanitize = true).split(".").last()
|
||||
|
||||
var sourceLocation = "src/main/kotlin/$rootClassName.kt"
|
||||
val candidateFile = File(sourceLocation)
|
||||
|
||||
@@ -4,7 +4,9 @@ import org.openrndr.extra.kotlinparser.ProgramSource
|
||||
|
||||
inline fun <reified T> generateScript(programSource: ProgramSource): String {
|
||||
val script = """
|
||||
|
||||
@file:Suppress("UNUSED_LAMBDA_EXPRESSION")
|
||||
${programSource.packageName?:""}
|
||||
|
||||
import org.openrndr.extra.olive.OliveProgram
|
||||
${programSource.imports}
|
||||
|
||||
Reference in New Issue
Block a user