3

Is there kind of thing allow me to compile Kotlin program in memory, like ECJ (the Eclipse java compiler)?

1 Answer 1

2

Yes. I believe K2JVMCompiler will satisfy your needs.

I don't believe you will find much documentation for it though. The best place to start would probably be in Kotlin's own smoke tests which use the class.

Sign up to request clarification or add additional context in comments.

3 Comments

You can find a sample of using the Kotlin compiler within the Kobalt build system. See this file here: github.com/cbeust/kobalt/blob/master/src/main/kotlin/com/beust/…
Also, note that K2MVCompiler does not support incremental compilation just yet, this is only supported in IDEA (and soon Gradle I hear).
@CedricBeust thanks; I've edited my answer accordingly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.