lburgazzoli
10/19/2018, 4:19 PMGary Tierney
10/19/2018, 4:21 PMNikky
10/19/2018, 4:23 PMNikky
10/19/2018, 4:23 PMilya.chernikov
10/19/2018, 5:12 PM@KotlinScript
annotation on the base class with a configuration object, and then construct a configuration from it.
And then BasicJvmScriptingHost
now have all needed defaults. So the resulting code may look like:
object MyScriptConfiguration : ScriptCompilationConfiguration({
defaultImports("org.apache.camel")
jvm {
dependenciesFromCurrentContext(wholeClasspath = true)
javaHome(File("/opt/data/sfw/lang/java/8"))
}
})
@KotlinScript(compilationConfiguration = MyScriptConfiguration::class)
abstract class MyScript(var name: String) {
fun say(message : String) {
println(name + ":" + message)
}
}
fun main(args: Array<String>) {
val script = """
say("hello kts!")
"""
val config = createJvmCompilationConfigurationFromTemplate<MyScript>()
val evalu = ScriptEvaluationConfiguration {
constructorArgs("injected")
}
val result = BasicJvmScriptingHost().eval(script.toScriptSource(), config, evalu)
for (report in result.reports) {
println(report)
}
}
ilya.chernikov
10/19/2018, 5:15 PMilya.chernikov
10/19/2018, 5:16 PMNikky
10/19/2018, 7:59 PMNikky
10/19/2018, 8:00 PMNikky
10/23/2018, 12:55 PMNikky
10/30/2018, 10:40 AMNikky
10/30/2018, 10:44 AMNikky
11/01/2018, 3:46 PMNikky
11/01/2018, 3:47 PMPaul Woitaschek
11/01/2018, 3:51 PMDALDEI
11/04/2018, 3:25 AMNikky
11/04/2018, 4:46 AMNikky
11/04/2018, 4:47 AMholgerbrandl
11/09/2018, 12:40 PMkscript
.efemoney
11/17/2018, 8:35 AMProject
(and possibly get IDE support)? How would I go about this if possible and what are my options if notNikky
11/17/2018, 10:41 AMNikky
11/17/2018, 10:44 AMlouiscad
11/30/2018, 4:07 PM.kts
files not the same level as gradle.kts
files? It highlights only reserved keywords and strings… Is there a way to make the IDE recognize it all, and also have cmd/ctrl+click go to source from stdlib instead of to compiled code? I'm using Android Studio 3.3 RC1 with IDE plugin 1.3.10Nikky
11/30/2018, 4:28 PM.something.kts
and have a a jar in the classpath that provides the script definitionsNikky
11/30/2018, 4:29 PMNikky
11/30/2018, 6:36 PMNikky
11/30/2018, 6:37 PMNikky
11/30/2018, 6:42 PMNikky
11/30/2018, 6:42 PMMETA-INF/kotlin/script/templates/
in the target jarNikky
11/30/2018, 6:43 PM