Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Programatically disabling the CDT builder on a programatically created C project
Programatically disabling the CDT builder on a programatically created C project [message #1746964] Tue, 08 November 2016 06:46
Cristi Andrei is currently offline Cristi AndreiFriend
Messages: 21
Registered: August 2015
Junior Member
I'm creating a C project programmatically using CDT:

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

            String projectName = projectNames[indices[i]];

            IProject newProjectHandle = root.getProject(projectName.replace("Examples_", ""));

            IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
            IProject project = CCorePlugin.getDefault().createCDTProject(description, newProjectHandle, new NullProgressMonitor());

            ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
            ICProjectDescription des = mngr.createProjectDescription(project, false);
            ManagedProject mProj = new ManagedProject(des);


            Configuration cfg = new Configuration(mProj, null, projectName + ".id", projectName);
            cfg.setManagedBuildOn(false);
            IBuilder bld = cfg.getEditableBuilder();

            bld.setManagedBuildOn(false);
            bld.setAutoBuildEnable(false);


            CConfigurationData data = cfg.getConfigurationData();
            des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);


            mngr.setProjectDescription(project, des);


This works exactly as creating a makefile project from the C wizard.

What I want now is to programatically untick the CDT builder from the project properties, or remove the builders from the Project properties.

http://help.eclipse.org/neon/topic/org.eclipse.cdt.doc.user/images/prop_builders.png

Is there any easy way to do this by adding a line or two to my project creation code?

NOTE: Original post on Stack Overflow, http://stackoverflow.com/questions/40460427/programatically-disabling-the-cdt-builder-on-a-programatically-created-c-project, no conclusive answer as of yet.
Previous Topic:warning: control reaches end of non-void function
Next Topic:Open declaration/EnclosingASTNameJob hangs
Goto Forum:
  


Current Time: Fri Apr 26 23:33:49 GMT 2024

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

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

Back to the top