Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Create a C++ project in workspace programmatically(Create a C++ project in workspace programmatically)
Create a C++ project in workspace programmatically [message #825982] Wed, 21 March 2012 13:57 Go to next message
Ankit Agarwal is currently offline Ankit AgarwalFriend
Messages: 35
Registered: March 2012
Member
Hi my name is Ankit, I am very new to Eclipse CDT. I want to create a new C++ project in workspace programmatically. I am using eclipse 3.7.1..
Somewhere in this forum i read that it can be done using the below code
IProject project = ResourceHelper.createCDTProject("ProjectHelperCreated");

ICProjectDescription projectDescription = CCorePlugin.getDefault().getProjectDescription(project);
ICConfigurationDescription activeConfiguration = projectDescription.getActiveConfiguration();
ICSourceEntry[] newSources = new ICSourceEntry[1];
newSources[0] = new CSourceEntry("ABSOLUTE_PATH", null, 0);
activeConfiguration.setSourceEntries(newSources);
projectDescription.setActiveConfiguration(activeConfiguration);
CoreModel.getDefault().setProjectDescription(project,projectDescription);

But i am unable to resolve the ResourceHelper class. i can nowhere find the plugin required for the above class.
Please help or tell me some other way of creating a new C++ project programmatically
Re: Create a C++ project in workspace programmatically [message #826350 is a reply to message #825982] Thu, 22 March 2012 00:45 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
Take a look at http://wiki.eclipse.org/CDT/Developer/FAQ#How_can_I_programmatically_create_a_new_CDT_project.3F

Andrew
Re: Create a C++ project in workspace programmatically [message #826456 is a reply to message #826350] Thu, 22 March 2012 04:52 Go to previous messageGo to next message
Ankit Agarwal is currently offline Ankit AgarwalFriend
Messages: 35
Registered: March 2012
Member
Hi, i have already read the link. My problem is i am not able to find the mentioned plugin org.eclipse.cdt.core.tests for Eclipse 3.7.1, please specify a location from where i can download the plugin

>Take a look at >
Re: Create a C++ project in workspace programmatically [message #826478 is a reply to message #826456] Thu, 22 March 2012 05:37 Go to previous message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
You can try to install from most recent successful build https://hudson.eclipse.org/hudson/job/cdt-maint/ but I am not sure if CDT Indigo maintenance builds include optional components. It was build assembly during transition to git/maven and not everything could be included.
Well, ResourceHelper methods are pretty much just wrappers for testing purpose. Here you can see the code http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin. You really should clone CDT git repo if you get into plugin development with CDT.

Andrew
Previous Topic:Eclipse project properties
Next Topic:Enabling Pretty Print breaks debugger
Goto Forum:
  


Current Time: Wed Sep 25 09:45:23 GMT 2024

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

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

Back to the top