Reputation: 5974
In Java, it's possible to compile and load classes at runtime from source code contained in strings (e.g. using javax.tools.JavaCompiler, EclipseCompiler, or Janino). This process can be entirely in-memory, without writing any temporary files.
The Xtend language works by transforming Xtend source code into Java source code and then compiling that. (Correct me if I'm wrong.) Is it possible to transform a string containing Xtend source code into a string containing Java source code, so that I can then use my favorite dynamic compiler? I'd like to turn Xtend sources into loadable classes at runtime*. If it is possible, what functions/classes do you need to call to do it?
*Runtime = no Eclipse-IDE, no JDK (JRE only), using just the Xtend dependencies.
Upvotes: 1
Views: 238
Reputation: 11868
Xtend has a Maven Plugin. It leverages XtendBatchCompiler. It should be possible to call it from pure Java, ANT etc.
Upvotes: 1