Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] createCDTProject Complains About Path Overlap

Hi,


I am trying to programitically create an new managed make project and
after poking around the CDT New Project Wizards I came up with the
code at the end of the post.
Cheers,
Karol Krizka

//Get the location for the project
FileSystemConfiguration
fsconfig=FileSystemSupportRegistry.getInstance().getDefaultConfiguration();
IPath wsPath=Platform.getLocation();
URI location=fsconfig.getContributor().getURI(wsPath.toOSString()+"/"+repoLocation);

//Create CDT project...
IProject newProject=null;
IProjectType pt=ManagedBuildManager.getExtensionProjectType("cmtplugin.projectType");

IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();

final IProject newProjectHandle = root.getProject(repoLocation);

if (!newProjectHandle.exists()) {
IProjectDescription description =
workspace.newProjectDescription(newProjectHandle.getName());
                        if(location != null)
                                description.setLocationURI(location);
                        System.out.println("Desciprtion: "+description);
                        try
                        {
                                newProject =
CCorePlugin.getDefault().createCDTProject(description,
newProjectHandle, new NullProgressMonitor());
                        }
                        catch(CoreException e)
                        {
                                e.printStackTrace();
                                return null;
                        }
                } else {


Back to the top