Join Slack
Powered by
How can I verify if a file contains a valid Kotlin...
# getting-started
i
igor.wojda
04/02/2023, 11:17 PM
How can I verify if a file contains a valid Kotlin code (ideally for given Kotlin version)? 🤔
r
Ruckus
04/02/2023, 11:36 PM
Compile it
👍 3
t
Thomas Hormes
04/03/2023, 6:29 AM
Depending on the platform you're targeting, you might be able to do it like they do in Detekt, using a ScriptingEngine:
https://github.com/detekt/detekt/blob/221d701d1e7c9755619afc00c0a8e82b02229a4f/det[…]c/main/kotlin/io/github/detekt/test/utils/KotlinScriptEngine.kt
a
Adam S
04/03/2023, 9:03 AM
to compile code via a REST API there’s the
kotlin-compiler-server
13
Views
Open in Slack
Previous
Next