Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Putting Xtext projects into Git repositories
Putting Xtext projects into Git repositories [message #1230020] Fri, 10 January 2014 20:21 Go to next message
Mark Elston is currently offline Mark ElstonFriend
Messages: 6
Registered: January 2014
Junior Member
I have recently tried to put an Xtext project into a git repository and didn't have much success. I tried doing this the following way:

1. Select the three generated projects and use Team->Share to put them into a repository.

2. Add all the source folders, the manifest files, and the build.properites and plugin.xml files to the index and commit them. I did not add the src-gen and xtend-gen directories as they are regenerated.

When I tried cloning the repository I got strange build errors and apparently the resulting projects were not set up correctly. I got no generated files even after cleaning the projects and forcing a rebuild.

So, what is the magic invocation necessary to store Xtext projects in a git repository so they can be tracked and shared?

Mark
Re: Putting Xtext projects into Git repositories [message #1230021 is a reply to message #1230020] Fri, 10 January 2014 20:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi,

did you reran the workflow for the language?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Putting Xtext projects into Git repositories [message #1230024 is a reply to message #1230020] Fri, 10 January 2014 20:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6929
Registered: July 2009
Senior Member
Hi

What about .project and .classpath (and .settings)?

Regards

Ed Willink

On 10/01/2014 20:21, Mark Elston wrote:
> I have recently tried to put an Xtext project into a git repository
> and didn't have much success. I tried doing this the following way:
>
> 1. Select the three generated projects and use Team->Share to put
> them into a repository.
> 2. Add all the source folders, the manifest files, and the
> build.properites and plugin.xml files to the index and commit them. I
> did not add the src-gen and xtend-gen directories as they are
> regenerated.
>
> When I tried cloning the repository I got strange build errors and
> apparently the resulting projects were not set up correctly. I got no
> generated files even after cleaning the projects and forcing a rebuild.
>
> So, what is the magic invocation necessary to store Xtext projects in
> a git repository so they can be tracked and shared?
>
> Mark
Re: Putting Xtext projects into Git repositories [message #1230034 is a reply to message #1230024] Fri, 10 January 2014 21:00 Go to previous messageGo to next message
Mark Elston is currently offline Mark ElstonFriend
Messages: 6
Registered: January 2014
Junior Member
Wow, quick replies. Smile

I only thought about adding those files that are visible in the package explorer. I will try it again with the .project and .classpath added from the command line.

And, yes, I did try re-running the workflow and nothing got generated. Hopefully it was from these missing files.

I want to confirm that the above approach does seem reasonable to everyone and that I am not just spinning my wheels here. For example, do I need to include the .metadata directory as well?

Mark
Re: Putting Xtext projects into Git repositories [message #1230035 is a reply to message #1230034] Fri, 10 January 2014 21:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi,

there are guys that check in everything.
others use maven to build.

so there is no "only way to go"


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Putting Xtext projects into Git repositories [message #1230047 is a reply to message #1230035] Fri, 10 January 2014 21:37 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Hi Mark,

It would be helpful to post the "strange build errors" in the question.

From what you are describing, I suspect that in the cloned repo the projects are missing the src-gen and xtend-gen directories alltogether, which prevents the build.
This happens in your scenario is because git does not store directories, only files.
The fix is to create the said dirs manually (new > folder).
Alternatively, you could add src-gen to git, as it saves you from a mwe regeneration when switching branches (assuming you have several.. )

Cheers
Vlad

Re: Putting Xtext projects into Git repositories [message #1230051 is a reply to message #1230047] Fri, 10 January 2014 21:45 Go to previous messageGo to next message
Mark Elston is currently offline Mark ElstonFriend
Messages: 6
Registered: January 2014
Junior Member
Ah, this could have been it as well.

Something we have done in the past on other projects (not using git) was to create an empty text file (usually called 'empty.txt') and placed it in a folder we wanted to use as a place holder. Perhaps this would work as well.

So, the workflow won't automatically recreate the src-gen and xtend-gen folders for me? It does seem to create any subdirectories of these folders when I, for instance, add new xtend files to a new package in src. But the -gen folders already exist, of course, in those cases.

Mark
Re: Putting Xtext projects into Git repositories [message #1230055 is a reply to message #1230051] Fri, 10 January 2014 22:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi if the classpath is broken the Workflow might Not work (depending how you Start it)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Putting Xtext projects into Git repositories [message #1234482 is a reply to message #1230055] Wed, 22 January 2014 04:21 Go to previous message
Xi Lin is currently offline Xi LinFriend
Messages: 21
Registered: January 2014
Junior Member
Hi, i suggest you to do the git work through a terminal or shell so that you can control all the files.

You can start with adding all the files under the directories with a customized .gitignore file.

Here is my .gitignore file for Xtext projects:

.settings
tmp
bin
target
generated
generated-sources
src-gen
xtend-gen
model
*.xml_gen


Actually i'm not sure about the .classpath and .project files too.

Hope this can help you.
Previous Topic:[Solved] Post processing in standalone maven project
Next Topic:2.5.0: Xtext Maven pom problem
Goto Forum:
  


Current Time: Thu Nov 26 10:39:36 GMT 2020

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

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

Back to the top