Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Programmatically registration of a Project as a Git project(How to use Egit API to programmatically register a git project)
Programmatically registration of a Project as a Git project [message #1832750] Thu, 24 September 2020 12:14 Go to next message
Joaquin Morcate is currently offline Joaquin MorcateFriend
Messages: 5
Registered: April 2014
Junior Member
I am involved in building "ready-to-use" Eclipse workspaces for the different products of my group.

I have developed a plugin that allows me to create the "Plug-in Projects" from the sources that I have clone from our git-repository server. Basically I do:


 IWorkspace workspace = ResourcesPlugin.getWorkspace();
 IProjectDescription description = workspace.loadProjectDescription(
                            new Path(projectFile.toString()));
 IProject project = workspace.getRoot().getProject(description.getName());
                   
 project.create(description, null);
 project.open(null);
 

The Plug-ins Projects are identified and created in the workspace, so when I start the IDE using that workspace but unfortunately, they
are not identified as Git project. I've look at the files in the workspace but I can't see nothing I could use. I
have also look to EGit code but I can't how to register a project as a Git project,

The idea is to have just a command that will throw me in a running workspace ready to start coding.

I'm not an expert on Eclipse, or on anything else, so I was wondering if somebody could help me
Thank you
Joaquin
Re: Programmatically registration of a Project as a Git project [message #1832757 is a reply to message #1832750] Thu, 24 September 2020 13:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
It sounds like you are replicating what Oomph already provides, i.e., automated provisioning of specialized installations and workspaces.

https://wiki.eclipse.org/Oomph

Here's an example for a very complex setup that's fully automated, ready to start coding:

https://wiki.eclipse.org/Eclipse_Platform_SDK_Provisioning


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Programmatically registration of a Project as a Git project [message #1832764 is a reply to message #1832757] Thu, 24 September 2020 15:40 Go to previous messageGo to next message
Joaquin Morcate is currently offline Joaquin MorcateFriend
Messages: 5
Registered: April 2014
Junior Member
Thanks, Ed for your answer.

I took a look at Oomph but they don't have an "automation" way. You have to launch the installer and select the basic platform, for example, RCP Development, and then your projects. I need to automate this and I believe that is not possible with Oomph for the time being (I could not make any sense on "Configurations"). In fact, in the end, I have a docker-compose file and I want to type "docker-compose up" and the next thing is to see the IDE open with the required plugins.

[Updated on: Thu, 24 September 2020 15:43]

Report message to a moderator

Re: Programmatically registration of a Project as a Git project [message #1832768 is a reply to message #1832764] Thu, 24 September 2020 15:54 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
Oomph can clone git repositories and import projects into a workspace. If that doesn't suit your needs take a look at AbstractGitCloneWizard.importProjects(). That's what EGit uses to import projects from a freshly cloned repository. Or if you already have a clone and it is added to EGit, you could check what the SmartImportWizard does.
Re: Programmatically registration of a Project as a Git project [message #1832771 is a reply to message #1832768] Thu, 24 September 2020 16:14 Go to previous messageGo to next message
Joaquin Morcate is currently offline Joaquin MorcateFriend
Messages: 5
Registered: April 2014
Junior Member
Thanks a lot Thomas.

It looks good to me. I will come back to you if I managed to make any sense of it.

Re: Programmatically registration of a Project as a Git project [message #1832869 is a reply to message #1832764] Mon, 28 September 2020 08:44 Go to previous message
Joaquin Morcate is currently offline Joaquin MorcateFriend
Messages: 5
Registered: April 2014
Junior Member
Hi Ed,
Thanks again for your suggestions. I managed at the end to register my projects with git: You need to find out the .git folder for the project and associateit with the Project instance of our project. But for this I had to call a method that was not in the external interface. I cannot understand why so many projects in Eclipse keep their services hidden behind the GUI. For example, if I don't like the user interface provided by the EGit team I cannot create my own customized views. The code is also full of monitors and tasks that make everything obscure.
Previous Topic:JGit as a read-only FileSystemProvider
Next Topic:pre-commit Hook "echo" message not appearing in popup
Goto Forum:
  


Current Time: Fri Apr 19 09:32:20 GMT 2024

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

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

Back to the top