Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Prevent XCore to change the .project file.
Prevent XCore to change the .project file. [message #1797332] Tue, 30 October 2018 04:22 Go to next message
Aurélien Mora is currently offline Aurélien MoraFriend
Messages: 38
Registered: July 2014
Member
Hello,

I try to use the XCore generated code in a standalone environment, with Java 9 modules.
So far, I'm not able to mix a java 9 nature with a plugin one in the same project, I ran into too much troubles. I still need the Eclipse plugins to provide some editor for my models.

The best solution I found from now is something like this :

Module project, that contains:
- some Java code
- a folder for generated code
- module-info.java

Model plugin project, contains:
- xcore files
- an eclipse link to the folder located in the module project
- a specific .project in which I declare the link.

Here a sample code of the link in the .project:
	<linkedResources>
		<link>
			<name>src/generated/java</name>
			<type>2</type>
			<locationURI>PARENT-1-PROJECT_LOC/org.sheepy.vulkan/src/generated/java</locationURI>
		</link>
	</linkedResources>


This works pretty good. Bonus point, when I finished to edit my xcores, I can close the model projects to simply work in a J9 module only workspace (because the model code is not in the plugin, but in the module project).

The main issue for now, is that even with the option @GenModel(updateClasspath="false"), the link in the .project could disappear after a clean, or a fresh import of the projects into the workspace.

So my questions :
- Is there a way to prevent EMF/Xcore to change the .project ?
- Maybe you have some idea about a better workflow ?
Re: Prevent XCore to change the .project file. [message #1797337 is a reply to message #1797332] Tue, 30 October 2018 06:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
I don't expect the logic in org.eclipse.emf.codegen.ecore.Generator.EclipseHelper.createEMFProject(IPath, URI, List<IProject>, Monitor, int, List<?>) to remove things from an existing .project file.

I'm not exactly sure what a clean does in terms of deleting folders, but there are Xcore -> Compiler options to control the behavior of "Clean". In terms of a fresh import, it seems to me EMF is not involved there at all, is it?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Multiple references to same instance in a sequence
Next Topic:ViewerRefresh delay break setting selection
Goto Forum:
  


Current Time: Fri Mar 29 05:30:27 GMT 2024

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

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

Back to the top