mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Commit for Leo Treggiari
The patch contains a fix for Bug 69114. The particular problem was that the manifest file contained an invalid id in an optionCategory owner attribute. The patch contains a change to all appropriate resolveReferences methods to check for unresolved references and write out an error message. For the optionCategory owner attribute, the owner is set to the Tool by default.
This commit is contained in:
parent
b260655021
commit
778d51ed87
9 changed files with 79 additions and 12 deletions
|
@ -97,15 +97,18 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
|
||||
private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo"); //$NON-NLS-1$
|
||||
private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
|
||||
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
||||
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
||||
private static final ITarget[] emptyTargets = new ITarget[0];
|
||||
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildManager"; //$NON-NLS-1$
|
||||
public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".buildDefinitions"; //$NON-NLS-1$
|
||||
public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildInfo"; //$NON-NLS-1$
|
||||
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildManager"; //$NON-NLS-1$
|
||||
public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".buildDefinitions"; //$NON-NLS-1$
|
||||
public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildInfo"; //$NON-NLS-1$
|
||||
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
|
||||
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
|
||||
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
|
||||
private static final String PROJECT_VERSION_ERROR ="ManagedBuildManager.error.project.version.error"; //$NON-NLS-1$
|
||||
private static final String MANIFEST_ERROR_HEADER = "ManagedBuildManager.error.manifest.header"; //$NON-NLS-1$
|
||||
public static final String MANIFEST_ERROR_RESOLVING = "ManagedBuildManager.error.manifest.resolving"; //$NON-NLS-1$
|
||||
private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||
|
||||
// This is the version of the manifest and project files that
|
||||
private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier(2, 1, 0);
|
||||
|
@ -1863,4 +1866,18 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
public static IManagedConfigElement getConfigElement(IBuildObject buildObj) {
|
||||
return (IManagedConfigElement)getConfigElementMap().get(buildObj);
|
||||
}
|
||||
|
||||
public static void OutputResolveError(String attribute, String lookupId, String type, String id) {
|
||||
String[] msgs = new String[4];
|
||||
msgs[0] = attribute;
|
||||
msgs[1] = lookupId;
|
||||
msgs[2] = type;
|
||||
msgs[3] = id;
|
||||
ManagedBuildManager.OutputManifestError(
|
||||
ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_RESOLVING, msgs));
|
||||
}
|
||||
|
||||
public static void OutputManifestError(String message) {
|
||||
System.err.println(ManagedMakeMessages.getResourceString(MANIFEST_ERROR_HEADER) + message + NEWLINE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -523,7 +523,12 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionBuilder(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"builder", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1314,11 +1314,24 @@ public class Option extends BuildObject implements IOption {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionOption(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"option", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
if (categoryId != null) {
|
||||
category = ((Tool)tool).getOptionCategory(categoryId);
|
||||
if (category == null) {
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"category", //$NON-NLS-1$
|
||||
categoryId,
|
||||
"option", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
// Process the value and default value attributes. This is delayed until now
|
||||
// because we may not know the valueType until after we have resolved the superClass above
|
||||
|
|
|
@ -294,10 +294,20 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
|
|||
public void resolveReferences() {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
if (ownerId != null)
|
||||
if (ownerId != null) {
|
||||
owner = tool.getOptionCategory(ownerId);
|
||||
else
|
||||
if (owner == null) {
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"owner", //$NON-NLS-1$
|
||||
ownerId,
|
||||
"optionCategory", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
if (owner == null) {
|
||||
owner = tool;
|
||||
}
|
||||
|
||||
// Hook me in
|
||||
if (owner instanceof Tool)
|
||||
|
|
|
@ -39,6 +39,8 @@ ManagedBuildManager.error.null_owner=addTarget: null owner
|
|||
ManagedBuildManager.error.owner_not_project=addTarget: owner not project
|
||||
ManagedBuildManager.error.manifest_load_failed_title=Managed Build System Version Error
|
||||
ManagedBuildManager.error.manifest.version.error=The version number defined in the plugin manifest file\n{0}\nis greater than the version of the Managed Build System.\nThe definitions in the manifest file will not be loaded.
|
||||
ManagedBuildManager.error.manifest.header=Manifest file error:
|
||||
ManagedBuildManager.error.manifest.resolving=Unable to resolve the {0} identifier {1} in the {2} {3}.
|
||||
ManagedBuildManager.error.open_failed_title=Managed Make Project File Error
|
||||
ManagedBuildManager.error.open_failed=The Managed Make project file could not be read because of the following error.\n\n{0}\n\nManaged Make functionality will not be available for this project.
|
||||
ManagedBuildManager.error.project.version.error=The version number of the project {0} is greater than the Managed Build System version number.
|
||||
|
|
|
@ -298,7 +298,12 @@ public class ProjectType extends BuildObject implements IProjectType {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionProjectType(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"projectType", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -522,7 +522,12 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionTargetPlatform(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"targetPlatform", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1496,7 +1496,12 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionTool(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"tool", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
// Call resolveReferences on our children
|
||||
|
|
|
@ -916,7 +916,12 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionToolChain(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"toolChain", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
// Call resolveReferences on our children
|
||||
|
|
Loading…
Add table
Reference in a new issue