diff options
author | Sean Evoy | 2004-11-22 21:18:12 +0000 |
---|---|---|
committer | Sean Evoy | 2004-11-22 21:18:12 +0000 |
commit | 0b7a8893786e7b3f5e2f25072adde6506efc897d (patch) | |
tree | 89c276a73cf79bde80b7913fe4dc5face4d1e035 | |
parent | b1f4c6dd7499ba48a071ffa797951c1f9db08b63 (diff) | |
download | org.eclipse.cdt-0b7a8893786e7b3f5e2f25072adde6506efc897d.tar.gz org.eclipse.cdt-0b7a8893786e7b3f5e2f25072adde6506efc897d.tar.xz org.eclipse.cdt-0b7a8893786e7b3f5e2f25072adde6506efc897d.zip |
Commit for Leo TreggiariCDT_2_1_RC3
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.
9 files changed, 79 insertions, 12 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index 5f4bde0faeb..329b4831236 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -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); + } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java index 6e9f58843b6..014f41b2cc4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java @@ -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()); } } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java index 6f8a8624bb7..a5a1ee7d41a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java @@ -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 diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java index e6665df31ce..a86f4998581 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java @@ -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) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties index ac320e2eb7e..0ce1deedc05 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties @@ -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. diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java index 594affaa1b7..31606b691d7 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java @@ -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()); } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java index 9cf870fc046..f8813e5ef41 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java @@ -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()); } } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index cde42e585e6..6a84efb03c5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -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 diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java index 8793cf95899..e689e3a9293 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java @@ -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 |