Xtend code generation: include library [message #1804551] |
Thu, 28 March 2019 12:45  |
Eclipse User |
|
|
|
Hello,
I am using Xtend to generate Java code based on a program written in my DSL. Alongside this generated Java code, I would like to include a library (two Java files I have already written, that won't change based on the DSL program). What is the best way to include such a library ?
I know it's possible to simply copy-paste the two Java files into an Xtend template and generate the files from there, but I would rather programatically copy the files.
Thanks in advance.
[Updated on: Thu, 28 March 2019 15:05] by Moderator
|
|
|
|
|
|
|
|
Re: Xtend code generation: include library [message #1804578 is a reply to message #1804551] |
Thu, 28 March 2019 17:53  |
Eclipse User |
|
|
|
Quote:I'll rephrase my question: is it possible to access files in the project where my xtext grammar and xtend generator are, from the project in a new Eclipse runtime, where I write programs in my DSL?
Nothing is impossible, but this approach does not make sense. Put your library into a library project and reference the library like you would do for any other Java library. If your target project is a plugin project, the library should also be a plugin project and use plugin dependencies. If the library is plain Java, build a Jar and use it as a referenced library.
The target project where the code is generated to is "just" a Java project, so think that you need a library in a Java project. That's it.
|
|
|
Powered by
FUDForum. Page generated in 0.03835 seconds