Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Generate Output files in a different folder than the project
Generate Output files in a different folder than the project [message #1799501] Fri, 07 December 2018 18:33 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member

Can we generate the output files to some other folders (e.g., Desktop)!!! I have tried but it interprets whatever path I give as a relative path to the project folder!

In the Run method in the ui, I ask for a path from the user (browse button), if the path is given then it should be generated in the given folder. The thing is that it needs IContainer to be returned. Obviously the model.getProject().getFolder(outAbspath) will return the container relative within the project but I don't know if there is any way to set the IContainer from an absolute path.

IPath outAbspath = new Path(outUserSelectedPath);
IContainer container = model.getProject().getFolder(outAbspath);
return container;

Any help would be appreciated.
Re: Generate Output files in a different folder than the project [message #1799504 is a reply to message #1799501] Fri, 07 December 2018 19:27 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7647
Registered: July 2009
Senior Member

I presume you are asking about Acceleo, which has some pragmatic treatment of files/URIs so I cannot answer precisely.

Normally with EMF and models you would use something like platform:/resource/... or file:/... and it would work. You would certainly have nothing to do with the IResource classes.

I suggest you look at the way other tools create their output files. resourceSet.getURIConverter().... gives you a useful helper for file access.


Ed Willink
Previous Topic:Unresolved compilation error, expression was null.
Next Topic:[Acceleo] Dependency on a Reusable Base Generator not Working
Goto Forum:

Current Time: Wed Feb 21 23:10:39 GMT 2024

Powered by FUDForum. Page generated in 0.02209 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top