and it seems like I can just do: ``` mkdir -p 'MET...
# scripting
g
and it seems like I can just do:
Copy code
mkdir -p 'META-INF/kotlin/script/templates' && touch META-INF/kotlin/script/templates/my.package.ScriptTemplateClass
i
Yes, you figured that out correctly, this is the discovery trigger for IDEA and the cli compiler. You’ll need to turn it on explicitly in the gradle for now though.
g
really happy with this so far, excellent work @ilya.chernikov!
i
Are you using the discovery only or the new scripting API as well?
g
Discovery only at the moment. We're building our scripts ahead of time and loading them as class files. I've still to look at what the
ScriptEnvironment
and
ScriptEvaluator
changes mean for the scripting infrastructure. Basically, we use scripts to build plugins that we load at runtime: https://github.com/apollo-rsps/apollo/blob/kotlin-experiments/game/plugin/shops/src/shop.plugin.kts#L14-L50
i
Yep, this is one of the intended purposes. You don’t need an evaluator in this case. But you may benefit at least from default imports, which is now easy to specify in the script compilation configuration. The examples of such usages will follow soon.
g
@ilya.chernikov we actually were after that! I had no idea it was now supported.
seems like some further investigation of the script compiler configuration is needed on my side 🙂
i
Or just wait a bit until I’ll prepare few more examples and updated KEEP. 🙂
g
and let you have all the fun? That's not fair!
😂 1
There's plenty I can play around with for now in the latest 1.2.40 EAP so we'll try to give all the feedback we can. I'll look at the evaluation stuff tonight I think
i
Good, but just to make clear, this stuff will be part of the 1.2.50, it is not available in the 1.2.40.
g
ah, correct, I was looking at the wrong diff (changes since 1.2.40, not changes between 1.2.40 and 1.2.30)