how to open a file in the actual project [message #1162222] |
Wed, 30 October 2013 04:27  |
Eclipse User |
|
|
|
in the XTEND for my generator i want to access files which are under the roof of my current project.
I evaluate resource.URI.trimSegments(2) which will result in "platform:\resource\abf"
but this does not work well with my
new FileReader(resource.URI.trimSegments(2)+"\\!includefiles\\a.sampletext")
How can I get an absolute path to my project directory out of "platform:\resource\abf"?
Or is theresomething which returns the path of the workspace aka "platform:\resource"
|
|
|
|
Re: how to open a file in the actual project [message #1162273 is a reply to message #1162241] |
Wed, 30 October 2013 05:11   |
Eclipse User |
|
|
|
Hi Karsten,
I have not found a hint in the XTEXT or XTEND documentation.
as I am a novice on the XTEND,XTEXT,JAVA,... I have problems to interpret the infos I googled.
Perhaps I have caused some confusion: This "includefile" are not to be included in the generator and evaluated there, its just a term from the customer which denotes some files with simple text to be added to the generated output here and there.
Can you give me a little help how to implement this?
Under my project roof, I have a directory "boilerplatetex" where "a.sampletext" resides.
In my generator, I want to grab the contents of this file, modify it and add it to the output.
Its just some boilerplate text to be included; depending on customers choice, these boilerplatefiles may later reside in a fixed directory on a windows fileserver or under the different projects. I need an option to handle all of these situations.
TIA, Uli
[Updated on: Wed, 30 October 2013 05:31] by Moderator
|
|
|
|
|
Re: how to open a file in the actual project [message #1162472 is a reply to message #1162222] |
Wed, 30 October 2013 07:55  |
Eclipse User |
|
|
|
Maybe I have to explain a little bit more:
I work on my generator.xtend.
Then I launch an eclipse runtime.
There I have a java project
abf
|--src
. |- abc.mydsl
|--textfiles
. |- my.text
And I create another java project XYZ
XYZ
|--src
. |- abc.mydsl
|--textfiles
. |- my.text
The src/abc.mydsl is the one I edit and save.
With the doGenerate, I want to access the textfiles/my.text of the project my DSL file belongs to
[Updated on: Wed, 30 October 2013 07:57] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04866 seconds