Abe Sol
08/05/2025, 10:47 AMAbe Sol
08/05/2025, 10:47 AMAbe Sol
08/05/2025, 10:48 AMFAILURE: Build failed with an exception.
* Where:
Initialization script '/tmp/WhaaaKt_main__1.gradle' line: 28
* What went wrong:
A problem occurred configuring project ':orx-jvm:orx-gui'.
> Could not create task ':orx-jvm:orx-gui:WhaaaKt.main()'.
> Could not set unknown property 'main' for task ':orx-jvm:orx-gui:WhaaaKt.main()' of type org.gradle.api.tasks.JavaExec.
and the program under orx-jvm/orx-gui/src/demo/kotlin/whaaa.kt
looks like this:
fun main() { println("hi") }
Abe Sol
08/05/2025, 10:49 AM.idea
folder.Abe Sol
08/05/2025, 10:56 AMdef gradleProjectId = 'orx:orx-jvm:orx-gui'
def runAppTaskName = 'WhaaaKt.main()'
def mainClass = 'WhaaaKt'
def javaExePath = '/usr/lib/jvm/java-24-openjdk/bin/java'
def _workingDir = '/home/████/orx'
def sourceSetName = 'demo'
allprojects {
afterEvaluate { project ->
if (project.rootProject.name + project.path == gradleProjectId) {
def overwrite = project.tasks.findByName(runAppTaskName) != null
project.tasks.create(name: runAppTaskName, overwrite: overwrite, type: JavaExec) {
if (javaExePath) executable = javaExePath
if (project.pluginManager.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
project.kotlin.targets.each { target ->
target.compilations.each { compilation ->
if (compilation.defaultSourceSetName == sourceSetName) {
classpath = compilation.output.allOutputs + compilation.runtimeDependencyFiles
}
}
}
} else {
classpath = project.sourceSets[sourceSetName].runtimeClasspath
}
main = mainClass
if(_workingDir) workingDir = _workingDir
standardInput = System.in
}
}
}
}
Abe Sol
08/05/2025, 11:16 AMmain = mainClass
Abe Sol
08/05/2025, 11:28 AM