Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Re: Make Target View

Hi Andrew,

As a next step, I want to tie regular make targets from the view to a configuration. Any idea is much appreciated.  

The image from your Make Target view looks good :). What I did to tie the Make Target to a configuration was I added the Configuration ID to the scanner configuration builder's command arguments  (in MakeTarget.java:build(...)). Somethine like:

   public void run(IProgressMonitor monitor) throws CoreException {
    if (runAllBuidlers) {
     ICommand[] commands = project.getDescription().getBuildSpec();
     monitor.beginTask("", commands.length); //$NON-NLS-1$
     for (ICommand command: commands) {
      if (command.getBuilderName().equals(builderID)) {
       project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, new SubProgressMonitor(monitor, 1));
      } else {
       // Pass through the configuration ID to the scanner... FIXME, should check for scanner config builder
       Map args = command.getArguments();
       args.put(IMakeTarget.BUILD_CONFIGURATION_ID, getBuildAttribute(IMakeTarget.BUILD_CONFIGURATION_ID, null));
       command.setArguments(args);

       project.build(IncrementalProjectBuilder.FULL_BUILD, command.getBuilderName(),
         command.getArguments(), new SubProgressMonitor(monitor, 1));
      }
     }
     monitor.done();
    } else {
     project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor);
    }
   }

Then in the ScannerConfigBuilder.java I set the configuration based on the value of the attribute.  Others may have an idea of a better way to do this. But the above should work.

James


Back to the top