1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Bug 269023 URI support added to EPM, add MakeBuilderUtil#getBuildDirectoryURI(...)

This commit is contained in:
James Blackburn 2009-06-02 16:21:03 +00:00
parent 892018205d
commit 9953f12da4
2 changed files with 23 additions and 1 deletions

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.make.core;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@ -148,6 +149,7 @@ public class MakeBuilder extends ACBuilder {
removeAllMarkers(currProject);
IPath workingDirectory = MakeBuilderUtil.getBuildDirectory(currProject, info);
URI workingDirectoryURI = MakeBuilderUtil.getBuildDirectoryURI(currProject, info);
String[] targets = getTargets(kind, info);
if (targets.length != 0 && targets[targets.length - 1].equals(info.getCleanBuildTarget()))
@ -200,7 +202,7 @@ public class MakeBuilder extends ACBuilder {
last = new Integer(100);
}
StreamMonitor streamMon = new StreamMonitor(new SubProgressMonitor(monitor, 100), cos, last.intValue());
ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectory, this, info.getErrorParsers());
ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectoryURI, this, info.getErrorParsers());
epm.setOutputStream(streamMon);
OutputStream stdout = epm.getOutputStream();
OutputStream stderr = epm.getOutputStream();

View file

@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.make.core;
import java.net.URI;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@ -46,4 +48,22 @@ public class MakeBuilderUtil {
}
return buildDirectory;
}
/**
* Return the URI of the build directory for a prject and IMakeBuilderInfo
* @param project
* @param info
* @return URI of the build directory, or the Project's URI if one couldn't be found
* @since 6.0
*/
public static URI getBuildDirectoryURI(IProject project, IMakeBuilderInfo info) {
IPath buildDirectory = info.getBuildLocation();
if (!buildDirectory.isEmpty()) {
IResource res = project.getParent().findMember(buildDirectory);
if (res instanceof IContainer && res.exists()) {
return res.getLocationURI();
}
}
return project.getLocationURI();
}
}