Skip to main content

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

My appologies, but GMail sent this email before I was finished. Below
is the entire email.

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. The problem is that the
createCDTProject() function complains about a location overlap with an
existing project:
/home/kka34/runtime-EclipseApplication/TestProject overlaps the
location of another project: 'TestProject'.
I am not sure why I am getting this error, because I have not even
touched the repoLocation variables before using it in this function.
Any ideas on what could be wrong?

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);

                       try
                       {
                               newProject =
CCorePlugin.getDefault().createCDTProject(description,
newProjectHandle, new NullProgressMonitor());
                       }
                       catch(CoreException e)
                       {
                               e.printStackTrace();
                               return null;
                       }
               }


Back to the top