mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
added meothd to test for target build on a project
added test for setting build info if value has changed or not
This commit is contained in:
parent
99eeb85fa8
commit
6b17a6477b
3 changed files with 11 additions and 8 deletions
|
@ -27,6 +27,7 @@ public interface IMakeTargetManager {
|
||||||
|
|
||||||
String getBuilderID(String targetBuilderID);
|
String getBuilderID(String targetBuilderID);
|
||||||
|
|
||||||
|
boolean hasTargetBuilder(IProject project);
|
||||||
String[] getTargetBuilders(IProject project);
|
String[] getTargetBuilders(IProject project);
|
||||||
|
|
||||||
void addListener(IMakeTargetListener listener);
|
void addListener(IMakeTargetListener listener);
|
||||||
|
|
|
@ -141,7 +141,6 @@ public class BuildInfoFactory {
|
||||||
return getString(BUILD_TARGET_FULL);
|
return getString(BUILD_TARGET_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean getBoolean(String property) {
|
public boolean getBoolean(String property) {
|
||||||
return Boolean.valueOf(getString(property)).booleanValue();
|
return Boolean.valueOf(getString(property)).booleanValue();
|
||||||
}
|
}
|
||||||
|
@ -245,13 +244,16 @@ public class BuildInfoFactory {
|
||||||
ICommand builder;
|
ICommand builder;
|
||||||
builder = MakeProjectNature.getBuildSpec(project, builderID);
|
builder = MakeProjectNature.getBuildSpec(project, builderID);
|
||||||
if (builder == null) {
|
if (builder == null) {
|
||||||
throw new CoreException(
|
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("BuildInfoFactory.Missing_Builder") + builderID, null)); //$NON-NLS-1$
|
||||||
new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("BuildInfoFactory.Missing_Builder") + builderID, null)); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
args = builder.getArguments();
|
args = builder.getArguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putValue(String name, String value) throws CoreException {
|
public void putValue(String name, String value) throws CoreException {
|
||||||
|
String curValue = (String) args.get(name);
|
||||||
|
if (curValue != null && curValue.equals(value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ICommand builder = MakeProjectNature.getBuildSpec(project, builderID);
|
ICommand builder = MakeProjectNature.getBuildSpec(project, builderID);
|
||||||
args.put(name, value);
|
args.put(name, value);
|
||||||
builder.setArguments(args);
|
builder.setArguments(args);
|
||||||
|
@ -259,7 +261,7 @@ public class BuildInfoFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getString(String name) {
|
public String getString(String name) {
|
||||||
String value = (String)args.get(name);
|
String value = (String) args.get(name);
|
||||||
return value == null ? "" : value; //$NON-NLS-1$
|
return value == null ? "" : value; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +284,7 @@ public class BuildInfoFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getString(String name) {
|
public String getString(String name) {
|
||||||
return (String)args.get(name);
|
return (String) args.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBuilderID() {
|
public String getBuilderID() {
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasTargetBuilder(IProject project) {
|
public boolean hasTargetBuilder(IProject project) {
|
||||||
try {
|
try {
|
||||||
if (project.isAccessible()) {
|
if (project.isAccessible()) {
|
||||||
IProjectDescription description = project.getDescription();
|
IProjectDescription description = project.getDescription();
|
||||||
|
|
Loading…
Add table
Reference in a new issue