mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
fixed builder
This commit is contained in:
parent
f1f4284c8c
commit
b223fdb790
2 changed files with 19 additions and 17 deletions
|
@ -23,3 +23,12 @@
|
||||||
refernce core plugin and nature classes for ID.
|
refernce core plugin and nature classes for ID.
|
||||||
- removed unsed methods in model for adding/removing
|
- removed unsed methods in model for adding/removing
|
||||||
natures.
|
natures.
|
||||||
|
|
||||||
|
2002-10-15 David Inglis
|
||||||
|
* src/../internal/core/CBuilder.java
|
||||||
|
|
||||||
|
Fixed builder to return referenced projects so that eclipse
|
||||||
|
builder will build increamentaly build projects when they change.
|
||||||
|
Handle "clean" target as special so the build state is cleared allowing
|
||||||
|
the next increamental build to come in as a full build.
|
||||||
|
|
|
@ -53,19 +53,16 @@ public class CBuilder extends ACBuilder {
|
||||||
* @see IncrementalProjectBuilder#build
|
* @see IncrementalProjectBuilder#build
|
||||||
*/
|
*/
|
||||||
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
||||||
boolean isFullBuild= (kind == IncrementalProjectBuilder.FULL_BUILD);
|
boolean isClean = invokeMake((kind == IncrementalProjectBuilder.FULL_BUILD), monitor);
|
||||||
if (isFullBuild) {
|
if ( isClean ) {
|
||||||
invokeMake(true, monitor);
|
forgetLastBuiltState();
|
||||||
} else {
|
|
||||||
/* Take the code in the QNX Builder todo project dependencies. */
|
|
||||||
invokeMake(false, monitor);
|
|
||||||
}
|
}
|
||||||
forgetLastBuiltState();
|
return getProject().getReferencedProjects();
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void invokeMake(boolean fullBuild, IProgressMonitor monitor) {
|
private boolean invokeMake(boolean fullBuild, IProgressMonitor monitor) {
|
||||||
|
boolean isClean = false;
|
||||||
IProject currProject= getProject();
|
IProject currProject= getProject();
|
||||||
SubProgressMonitor subMonitor = null;
|
SubProgressMonitor subMonitor = null;
|
||||||
|
|
||||||
|
@ -78,15 +75,9 @@ public class CBuilder extends ACBuilder {
|
||||||
CProjectNature nature= (CProjectNature)currProject.getNature(CProjectNature.C_NATURE_ID);
|
CProjectNature nature= (CProjectNature)currProject.getNature(CProjectNature.C_NATURE_ID);
|
||||||
IPath makepath= nature.getBuildCommand();
|
IPath makepath= nature.getBuildCommand();
|
||||||
if (!makepath.isEmpty()) {
|
if (!makepath.isEmpty()) {
|
||||||
// clear console if requested
|
|
||||||
IConsole console = CCorePlugin.getDefault().getConsole();
|
IConsole console = CCorePlugin.getDefault().getConsole();
|
||||||
console.start(currProject);
|
console.start(currProject);
|
||||||
/*
|
|
||||||
if (BuildInfoFactory.create().isClearBuildConsole()
|
|
||||||
&& MakeUtil.getSessionConsoleMode(currProject)) {
|
|
||||||
console.clear();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
ConsoleOutputStream cos = console.getOutputStream();
|
ConsoleOutputStream cos = console.getOutputStream();
|
||||||
|
|
||||||
// remove all markers for this project
|
// remove all markers for this project
|
||||||
|
@ -94,7 +85,8 @@ public class CBuilder extends ACBuilder {
|
||||||
|
|
||||||
IPath workingDirectory= getWorkingDirectory();
|
IPath workingDirectory= getWorkingDirectory();
|
||||||
String[] userArgs= parseArguments(fullBuild, nature.getIncrBuildArguments());
|
String[] userArgs= parseArguments(fullBuild, nature.getIncrBuildArguments());
|
||||||
|
if ( userArgs.length != 0 && userArgs[userArgs.length-1].equals("clean") )
|
||||||
|
isClean = true;
|
||||||
// Before launching give visual cues via the monitor
|
// Before launching give visual cues via the monitor
|
||||||
subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
|
subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
|
||||||
subMonitor.subTask("Invoking Command: " + makepath.toString());
|
subMonitor.subTask("Invoking Command: " + makepath.toString());
|
||||||
|
@ -156,6 +148,7 @@ public class CBuilder extends ACBuilder {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
monitor.done();
|
monitor.done();
|
||||||
|
return isClean;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] parseArguments(boolean fullBuild, String override_args) {
|
private String[] parseArguments(boolean fullBuild, String override_args) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue