Bare minimal self-contained kotlin program that ev...
# scripting
d
Bare minimal self-contained kotlin program that evaluates kotlin script using 'current' gradle/kotlin/intellij Thanks to @Egor for patience Note: This is NOT an example of 'best practice' -- I dont know what that is, its an example of "I Finally got the non-223 script host to compile and run" https://github.com/DALDEI/kotlin-script-sample
👍 1
👏 1
d
Thanks for this David; any idea of whether it's likely to run on Android? I went the 223 route, prior to 1.3.50 but was met with 'dexing' failure due to an astronomically high method count - in short; the Scripting Engine was too 'heavy' for Android. Hoping to revisit with an approach like yours; so thanks for the example.
i
@darkmoon_uk - https://youtrack.jetbrains.com/issue/KT-33560 Running scripting on android is untested path. From an initial analysis it seems doable, but seems need some work from our side.
d
Thanks @ilya.chernikov; FYI this was not mere curiosity - we were evaluating this for an Enterprise use case. In this use case, originally all scripting was done via JavaScript. This was very hard for developers to work with and debug so we replaced this engine with a bytecode loader and wrote the 'scripts' in Kotlin compiled offline. This worked great - fast and also debuggable on device - but in turn reduces some flexibility and is disallowed on Google Play Store. We were hoping to use Embedded Compiler for 3rd iteration.
i
I don’t know Google Play Store rules, but I’m not sure that embedding the compiler (which is required for kotlin scripting) will make it any more valid than the solution you have now. But I’ve got your point, we will investigate it further. But to increase the perception of importance for us, please vote for the issue above, and maybe even share your use case there.