teavm {
js {
addedToWebApp = true
mainClass = "com.github.JSApplication"
moduleType = JSModuleType.NONE
obfuscated = false
optimization = OptimizationLevel.NONE
}
}
task teamvmTemp(type: GenerateJavaScriptTask) {
mainClass = "com.github.Temp"
classpath = sourceSets.main.compileClasspath
moduleType = JSModuleType.NONE
obfuscated = false
optimization = OptimizationLevel.NONE
targetFileName = "temp.js"
outputDir = file("build/teavm")
}
When invoked for teamvmTemp task it fails with error like this:There's no main class: 'com.github.Temp'
Hello. Sure, you didn't specify any dependency to Java compiler task, so teamvmTemp task has no idea that it should run after Java compiler. You need to specify dependency. Or, you can use something like that:
classpath.from sourceSets.main.output classpath.from sourceSets.main.compileClasspathso that task dependency will be added automatically
Where is the 'GenerateJavaScriptTask' coming from?