mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
support error parser persistence on project
This commit is contained in:
parent
9e734a8588
commit
a45471098a
3 changed files with 59 additions and 25 deletions
|
@ -15,29 +15,38 @@ import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
public interface IMakeBuilderInfo {
|
public interface IMakeBuilderInfo {
|
||||||
IPath getBuildLocation();
|
IPath getBuildLocation();
|
||||||
boolean isStopOnError();
|
|
||||||
boolean isDefaultBuildCmd();
|
|
||||||
IPath getBuildCommand();
|
|
||||||
String getBuildArguments();
|
|
||||||
|
|
||||||
boolean isAutoBuildEnable();
|
|
||||||
String getAutoBuildTarget();
|
|
||||||
boolean isIncrementalBuildEnabled();
|
|
||||||
String getIncrementalBuildTarget();
|
|
||||||
boolean isFullBuildEnabled();
|
|
||||||
String getFullBuildTarget();
|
|
||||||
|
|
||||||
void setBuildLocation(IPath location) throws CoreException;
|
void setBuildLocation(IPath location) throws CoreException;
|
||||||
void setStopOnError(boolean on) throws CoreException;
|
|
||||||
|
boolean isStopOnError();
|
||||||
|
void setStopOnError(boolean on) throws CoreException;
|
||||||
|
|
||||||
|
boolean isDefaultBuildCmd();
|
||||||
void setUseDefaultBuildCmd(boolean on) throws CoreException;
|
void setUseDefaultBuildCmd(boolean on) throws CoreException;
|
||||||
void setBuildCommand(IPath command) throws CoreException;
|
|
||||||
|
IPath getBuildCommand();
|
||||||
|
void setBuildCommand(IPath command) throws CoreException;
|
||||||
|
|
||||||
|
String getBuildArguments();
|
||||||
void setBuildArguments(String args) throws CoreException;
|
void setBuildArguments(String args) throws CoreException;
|
||||||
|
|
||||||
void setAutoBuildEnable(boolean enabled) throws CoreException;
|
boolean isAutoBuildEnable();
|
||||||
void setAutoBuildTarget(String target) throws CoreException;
|
void setAutoBuildEnable(boolean enabled) throws CoreException;
|
||||||
void setIncrementalBuildEnable(boolean enabled) throws CoreException;
|
|
||||||
void setIncrementalBuildTarget(String target) throws CoreException;
|
|
||||||
void setFullBuildEnable(boolean enabled) throws CoreException;
|
|
||||||
void setFullBuildTarget(String target) throws CoreException;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
String getAutoBuildTarget();
|
||||||
|
void setAutoBuildTarget(String target) throws CoreException;
|
||||||
|
|
||||||
|
boolean isIncrementalBuildEnabled();
|
||||||
|
void setIncrementalBuildEnable(boolean enabled) throws CoreException;
|
||||||
|
|
||||||
|
String getIncrementalBuildTarget();
|
||||||
|
void setIncrementalBuildTarget(String target) throws CoreException;
|
||||||
|
|
||||||
|
boolean isFullBuildEnabled();
|
||||||
|
void setFullBuildEnable(boolean enabled) throws CoreException;
|
||||||
|
|
||||||
|
String getFullBuildTarget();
|
||||||
|
void setFullBuildTarget(String target) throws CoreException;
|
||||||
|
|
||||||
|
String[] getErrorParsers();
|
||||||
|
void setErrorParsers(String[] parsers) throws CoreException;
|
||||||
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class MakeBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
env = (String[]) envList.toArray(new String[envList.size()]);
|
env = (String[]) envList.toArray(new String[envList.size()]);
|
||||||
}
|
}
|
||||||
ErrorParserManager epm = new ErrorParserManager(this);
|
ErrorParserManager epm = new ErrorParserManager(getProject(), this, info.getErrorParsers());
|
||||||
epm.setOutputStream(cos);
|
epm.setOutputStream(cos);
|
||||||
OutputStream stdout = epm.getOutputStream();
|
OutputStream stdout = epm.getOutputStream();
|
||||||
OutputStream stderr = epm.getOutputStream();
|
OutputStream stderr = epm.getOutputStream();
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core;
|
package org.eclipse.cdt.make.internal.core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
|
@ -43,6 +46,7 @@ public class BuildInfoFactory {
|
||||||
static final String BUILD_INCREMENTAL_ENABLED = PREFIX + ".enabledIncrementalBuild"; //$NON-NLS-1$
|
static final String BUILD_INCREMENTAL_ENABLED = PREFIX + ".enabledIncrementalBuild"; //$NON-NLS-1$
|
||||||
static final String BUILD_AUTO_ENABLED = PREFIX + ".enableAutoBuild"; //$NON-NLS-1$
|
static final String BUILD_AUTO_ENABLED = PREFIX + ".enableAutoBuild"; //$NON-NLS-1$
|
||||||
static final String BUILD_ARGUMENTS = PREFIX + ".buildArguments"; //$NON-NLS-1$
|
static final String BUILD_ARGUMENTS = PREFIX + ".buildArguments"; //$NON-NLS-1$
|
||||||
|
static final String ERROR_PARSERS = PREFIX + ".buildErrorParsers"; //$NON-NLS-1$
|
||||||
|
|
||||||
private abstract static class Store implements IMakeBuilderInfo {
|
private abstract static class Store implements IMakeBuilderInfo {
|
||||||
|
|
||||||
|
@ -176,6 +180,27 @@ public class BuildInfoFactory {
|
||||||
public void setBuildArguments(String args) throws CoreException {
|
public void setBuildArguments(String args) throws CoreException {
|
||||||
putValue(BUILD_ARGUMENTS, args);
|
putValue(BUILD_ARGUMENTS, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] getErrorParsers() {
|
||||||
|
String parsers = getString(ERROR_PARSERS);
|
||||||
|
if (parsers != null && parsers.length() > 0) {
|
||||||
|
StringTokenizer tok = new StringTokenizer(parsers, ";");
|
||||||
|
List list = new ArrayList(tok.countTokens());
|
||||||
|
while (tok.hasMoreElements()) {
|
||||||
|
list.add(tok.nextToken());
|
||||||
|
}
|
||||||
|
return (String[]) list.toArray(new String[list.size()]);
|
||||||
|
}
|
||||||
|
return new String[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorParsers(String[] parsers) throws CoreException {
|
||||||
|
StringBuffer buf = new StringBuffer();
|
||||||
|
for (int i = 0; i < parsers.length; i++) {
|
||||||
|
buf.append(parsers[i]).append(';');
|
||||||
|
}
|
||||||
|
putValue(ERROR_PARSERS, buf.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Preference extends Store {
|
private static class Preference extends Store {
|
||||||
|
|
Loading…
Add table
Reference in a new issue