Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Why Build All Configurations doesn't work for different builders from CDT Common Builder?

Thank you James, it works. I'll report this bug and your patch.
 
Aytac

--- On Thu, 11/19/09, James Blackburn <jamesblackburn@xxxxxxxxx> wrote:

From: James Blackburn <jamesblackburn@xxxxxxxxx>
Subject: Re: [cdt-dev] Why Build All Configurations doesn't work for different builders from CDT Common Builder?
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Date: Thursday, November 19, 2009, 5:32 PM

I guess the reason is that no one's run into this before...

Does this fix it for you? If so do file a bug...

Cheers,
James
bb

2009/11/19 Aytac Sartekin <sartekin@xxxxxxxxx>
>
> Hi,
>
> I have my own project builder and I extend CDT and add new project types and configurations.
> When I select Build from Project menu, my builder works and project's active configuration is built.
> But when i want to built a different configuration or all configurations from the context menu (Build Configurations->All), only the active configuration is built.
>
> In the ManagedBuildManager class buildConfigurations method:
> Build arguments are created for the selected configurations (
> final Map map = builder != null ?
> BuilderFactory.createBuildArgs(configs, builder)
> : BuilderFactory.createBuildArgs(configs);
> )
>
> But then these arguments are passed to the build function only if the builder is CommonBuilder. So, when Build Configurations->All selected from the context menu for a project that has a different builder, only the active configuration of the project is built.
>
> I need these build arguments for my builder, why builders other than CommonBuilder are not called with these args?
>
> Regards
>
> Aytac
>
> private static void buildConfigurations(final IProject project, IConfiguration[] configs, IBuilder builder, final IProgressMonitor monitor) throws CoreException{
> // final IProject project = configs[0].getOwner().getProject();
> final boolean runAllBuidlers = false;
> final Map map = builder != null ?
> BuilderFactory.createBuildArgs(configs, builder)
> : BuilderFactory.createBuildArgs(configs);
> IWorkspaceRunnable op = new IWorkspaceRunnable() {
> /*
> * (non-Javadoc)
> *
> * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
> */
> public void run(IProgressMonitor monitor) throws CoreException {
> if (runAllBuidlers) {
> ICommand[] commands = project.getDescription().getBuildSpec();
> monitor.beginTask("", commands.length); //$NON-NLS-1$
> for (int i = 0; i < commands.length; i++) {
> if (commands[i].getBuilderName().equals(CommonBuilder.BUILDER_ID)) {
> project.build(IncrementalProjectBuilder.FULL_BUILD, CommonBuilder.BUILDER_ID, map, new SubProgressMonitor(monitor, 1));
> } else {
> project.build(IncrementalProjectBuilder.FULL_BUILD, commands[i].getBuilderName(),
> commands[i].getArguments(), new SubProgressMonitor(monitor, 1));
> }
> }
> monitor.done();
> } else {
> project.build(IncrementalProjectBuilder.FULL_BUILD, CommonBuilder.BUILDER_ID, map, monitor);
> }
> }
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>

-----Inline Attachment Follows-----

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top