[MWE2] Referring to paths/files inside standalone JAR [message #651492] |
Mon, 31 January 2011 07:21  |
Eclipse User |
|
|
|
Hi
I have an Xtext-based generator project org.xtext.mydsl.generator, that contains amongst others
- src/model/MyModel.mydsl;
- src/mydir/SomeFile.hpp
- src/workflows/myworkflow.mwe2;
The following is a relevant extract of that MWE2 workflow.
Workflow {
component = org.eclipse.xtext.mwe.Reader {
...
path = "src/model"
register = org.xtext.example.mydsl.MyDSLStandaloneSetup {}
load = {
...
}
}
<processing of and code generation using loaded model>
component = org.eclipse.emf.mwe.utils.FileCopy {
sourceFile = "src/mydir/SomeFile.hpp"
targetFile = "src-gen/mydir/SomeFile.hpp"
}
}
This works fine when running the MWE2 workflow inside Eclipse - e.g. it finds the model file and processes it, and it finds the source file to copy and copies it to the target location.
I have also created a "standalone launcher" Java class in the project, which calls Mwe2Launcher.main to launch the MWE2 workflow. That works fine from within Eclipse as well.
I've exported the project into a JAR, using the launcher class as the main class, and can run the standalone launcher class just fine from the terminal (using java -jar myjar.jar <params for standalone launcher class>).
However, when run that way (i.e. using java -jar), the MWE2 workflow interprets the paths in the workflow as paths on the local filesystem - whereas I want to refer to the files as included in the JAR. I know they are in the jar; using jar tf myjar.jar gives amongst others
model/MyModel.mydsl
mydir/SomeFile.hpp
How do I define path and sourceFile in my MWE2 workflow such that they refer to the files inside the JAR? Just using "model/MyModel.mydsl" and "mydir/SomeFile.hpp" obviously does not do the trick.
Any help is appreciated.
Regards,
Loek
|
|
|
|
Re: [MWE2] Referring to paths/files inside standalone JAR [message #661593 is a reply to message #651643] |
Fri, 25 March 2011 10:11  |
Eclipse User |
|
|
|
Hi
Miles - thanks for the suggestion, and apologies for the late thanks...
As a late followup, at least in case anyone else will run into this in the future: I have briefly looked at that bug, which has a latter long and intricate description. Our problem might indeed be related to this bug.
I have decided to take a different route for now, circumventing the issue: I've replaced the FileCopy actions in MWE2 by the use of Xpand templates to simply spit out the non-variable files.
Regards,
Loek
|
|
|
Powered by
FUDForum. Page generated in 0.25100 seconds