Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-core-dev] [cdt-dev] A Builder Proposition (fwd)

Sounds like a reasonable starting place for our first release.

I think there are going to be a lot more requirements put on the table for
that other day.  Cory Bialowus (cbialowus@xxxxxxxxxxxx) and I will take stab
at putting together a list and publishing them for review.  We'll also take
a look to see if there are any changes needed to the existing architecture
to meet these requirements.  We are certainly open for input and ideas.

Cheers,
Doug Schaefer

-----Original Message-----
From: Alain Magloire [mailto:alain@xxxxxxx] 
Sent: Wednesday, September 11, 2002 11:35 PM
To: cdt-core-dev@xxxxxxxxxxx
Subject: [cdt-core-dev] [cdt-dev] A Builder Proposition (fwd)


Requirements:
 We are trying to solve a few requirements leaving the rest for another day.
 - Passing Info from the UI to the builder:
    * setting of arguments
    * setting of Environment
    * working directory where to execute the build process
 - Providing a way for other components to extract information
   from the builder(say: include paths, library paths, ..)
 - allowing different configurations(say: Build in debug mode, for a
particular architecture...)


The flow: a plugin implementing the extension point and the interface
ICBuilderCommand,
will register itself has a BuilderCommand to the CDT BuildModel for project
xx.  It
can also register itsef as info provider by implementing ICBuilderInfo for
project xx.
This is usually done via the wizards when creating a project or via property
pages etc ..
When the user invokes Eclipse IncrementalBuilder, for project xx, it will
call the CDT
builder which in turn will call the register ICBuilderCommand for project
xx.

The idea is to have a builder for the C/C++ Projects on the eclipse side,
this
builder will serve as a proxy and call the "real" Builder providing relevant
information like arguments(calling "make clean", in Directory project/src;

	/**
	 * CBuilder is the CDT generic Eclipse builder it serves
	 * as a proxy calling the real builder since the Eclipse builder
	 * does not pass enough information.
	 */
	public class CBuilder extends IncrementalProjectBuilder {

		IProject[] build(int kind, Map args, IProgressMonitor) {

			// Retrieve the BuildModel from the CDT CorePlugin
			BuildModel model = CCorePlugin.getBuildModel();

			// Get The buildCommand for this project.
			ICBuildCommand command =
model.getBuilderCommand(getProject());

			// Set the information: arguments/CWD/Environment/
etc ..
			command.setArguments( args );  // they ask for the
argument "install"
			command.setWorkindDirectory( cwd ); // in
"project/src"
			command.setEnviron(props);  // setting
"PREFIX=/tmp/installation"

			// Invoke the register builder
			return command.build(this);
		}
	}


public interface ICBuilderCommand extends ICCommand {
	IProject[] build(IncrementatlProjectBuilder eclipseBuilder);
}

public interface ICBuilderInfo {
	IPath[] getIncludePaths();
	IPath[] getSystemIncludePaths();
	IPath[] getLibaryPaths();
	String[] getLibaries();
	...
	void setBuilderConfiguration(ICBuilderConfiguration config);
}

public interfave ICBuilderConfiguration {
	String getName();
}

public interface ICCommand {
	String[] getArguments();
	void setArguments(String[] args);
	IPath getWorkingDirectory();
	void setWorkingDirectory();
	Properties getEnvironment();
	void setEnvironment(Properties env);
}


Lots of details are missing here: the way a plugin registers a Builder for a
specific
project, the persistency, the extension points.


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


Back to the top