Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XCore + Git] Generated .gitignore files in src-gen
[XCore + Git] Generated .gitignore files in src-gen [message #1079887] Mon, 05 August 2013 07:49 Go to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Hello

I am using XCore and Git. I would like to commit the generated source files by XCore to Git (some co-workers do not have XCore installed into Eclipse but still need to compile).

I have noticed that sometimes .gitignore files are generated to exclude specific java files in src-gen. Is this a "feature" of XCore or should I ask in the Git forum? If it is an XCore feature: How can I turn it off?

Thanks!
Christoph
Re: [XCore + Git] Generated .gitignore files in src-gen [message #1079897 is a reply to message #1079887] Mon, 05 August 2013 07:59 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
I did some further testing to reproduce the problem.

1) Create an Xcore Project in the Workspace
2) Create the model and let XCore generate the files
3) Use "Team -> Share" to move the project into the Git repository

The .gitignore files will be created on step #3. Seems like this has nothing to do with XCore, but rather with EGit. So this thread can be closed.

The workaround is to switch steps #2 und #3: After creating the project, move it to Git first before creating the model.
Re: [XCore + Git] Generated .gitignore files in src-gen [message #1080042 is a reply to message #1079897] Mon, 05 August 2013 11:55 Go to previous messageGo to next message
Michael Vorburger is currently offline Michael VorburgerFriend
Messages: 62
Registered: July 2009
Member
I haven't tested this, but I have a vague memory that there may be some logic (in EGit) which makes "Derrived" (i.e. generated) files be ignored out of the box? If you right-click > Properties, you'll notice that your src-gen/**/*.java have Attributes: [X] Derived. The Project > Properties > Xcore > Compiler has an option [X] Mark generated files as derived (on by default), which may be helpful to deactivate for your use case?
Re: [XCore + Git] Generated .gitignore files in src-gen [message #1080057 is a reply to message #1079887] Mon, 05 August 2013 12:20 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4186
Registered: July 2009
Senior Member
Hi

I think you'll find that the .gitignore comes from Xtend and only
affects files you do not need.

You can choose what derivbed files are Gitable in the Team preferences.

Regards

Ed Willink


On 05/08/2013 08:49, Christoph Keimel wrote:
> Hello
>
> I am using XCore and Git. I would like to commit the generated source
> files by XCore to Git (some co-workers do not have XCore installed
> into Eclipse but still need to compile).
>
> I have noticed that sometimes .gitignore files are generated to
> exclude specific java files in src-gen. Is this a "feature" of XCore
> or should I ask in the Git forum? If it is an XCore feature: How can I
> turn it off?
>
> Thanks!
> Christoph
Re: [XCore + Git] Generated .gitignore files in src-gen [message #1080065 is a reply to message #1080042] Mon, 05 August 2013 12:26 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Michael Vorburger wrote on Mon, 05 August 2013 13:55
I haven't tested this, but I have a vague memory that there may be some logic (in EGit) which makes "Derrived" (i.e. generated) files be ignored out of the box? If you right-click > Properties, you'll notice that your src-gen/**/*.java have Attributes: [X] Derived. The Project > Properties > Xcore > Compiler has an option [X] Mark generated files as derived (on by default), which may be helpful to deactivate for your use case?


Hi Michael

thanks for your input. Unfortunately, this also deactivates other usefull features considering derived files. I. e. Eclipse warns you when you try to edit a derived file directly. I would realy like to keep this warning.
Re: [XCore + Git] Generated .gitignore files in src-gen [message #1080070 is a reply to message #1080057] Mon, 05 August 2013 12:34 Go to previous message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Hi Ed

thanks for your help. Comments inline ...

> I think you'll find that the .gitignore comes from Xtend and only
> affects files you do not need.

The .gitignore effect the generated .java source files. One could argue, that these are not needed since they are generated anyway. On the other hand, others argue that all source files should be versioned, generated or not. Independent of this discussion, if you do not have the generation tool (XCore in this case) installed, that you can not compile the project if the sources are not versioned. So in our case, we need to put the source files into Git.

> You can choose what derivbed files are Gitable in the Team preferences.

Could you please point me to these settings. I have only found "Automatically ignore derived resources by adding them to .gitignore" in "Team < Git < Projects". Deactivation of this setting does not have an effect on the generation of the .gitignore files. Is that the setting you are refering to?

Greetings
Christoph
Previous Topic:Modeling a HashMap
Next Topic:EMF: Force load as a given type
Goto Forum:
  


Current Time: Fri Dec 19 00:04:20 GMT 2014

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

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