From 0f45720f3d0437001dd104e9fa8a5f43e43ee5a1 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Mon, 18 Aug 2003 17:34:23 +0000 Subject: [PATCH] patch from sean see changelog --- core/org.eclipse.cdt.core/ChangeLog | 15 + .../core/build/managed/ManagedBuildInfo.java | 19 +- .../cdt/internal/core/build/managed/Tool.java | 5 +- .../core/CCorePluginResources.properties | 8 +- .../cdt/internal/core/MakefileGenerator.java | 14 +- core/org.eclipse.cdt.ui/ChangeLog | 11 + .../build/wizards/ManagedProjectWizard.java | 4 +- core/org.eclipse.cdt.ui/plugin.properties | 12 +- core/org.eclipse.cdt.ui/plugin.xml | 950 ++++++++++++++++-- 9 files changed, 931 insertions(+), 107 deletions(-) diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index 1c6ac944376..49c1773fa81 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,18 @@ +2003-08-13 Sean Evoy + Changed text generated into makefile comments from the rather abstract + term 'module' to the more meaningful 'subdirectory'. + * src/org/eclipse/cdt/internal/core/CCorePluginResources.properties + + Added place-holder macro for LIBS and changed the source file look-up code to + ignore source it finds in generated directories during a build, even if it has a tool + that says it builds for it. + * src/org/eclipse/cdt/internal/core/MakefileGenerator.java + + Changed class to deal with build targets that do not specify an extension + (like POSIX executables). + * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java + * build/org/eclipse/cdt/internal/core/build/managed/Tool.java + 2003-08-13 Sean Evoy The major change in the increment of work is the new discovery mechanism that clients will use to find the IScannerInfoProvider for a project. diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java index b2c6090d122..2b4addc6bcd 100644 --- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java +++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java @@ -186,12 +186,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @see org.eclipse.cdt.core.build.managed.IResourceBuildInfo#getToolFlags(java.lang.String) */ public String getFlagsForTarget(String extension) { + // Treat null extensions as an empty string + String ext = extension == null ? new String() : extension; + // Get all the tools for the current config IConfiguration config = getDefaultConfiguration(getDefaultTarget()); ITool[] tools = config.getTools(); for (int index = 0; index < tools.length; index++) { ITool tool = tools[index]; - if (tool.producesFileType(extension)) { + if (tool.producesFileType(ext)) { String flags = new String(); try { flags = tool.getToolFlags(); @@ -306,13 +309,16 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputFlag() */ public String getOutputFlag(String outputExt) { + // Treat null extension as an empty string + String ext = outputExt == null ? new String() : outputExt; + // Get all the tools for the current config String flags = new String(); IConfiguration config = getDefaultConfiguration(getDefaultTarget()); ITool[] tools = config.getTools(); for (int index = 0; index < tools.length; index++) { ITool tool = tools[index]; - if (tool.producesFileType(outputExt)) { + if (tool.producesFileType(ext)) { flags = tool.getOutputFlag(); } } @@ -323,13 +329,16 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputPrefix(java.lang.String) */ public String getOutputPrefix(String outputExtension) { + // Treat null extensions as empty string + String ext = outputExtension == null ? new String() : outputExtension; + // Get all the tools for the current config String flags = new String(); IConfiguration config = getDefaultConfiguration(getDefaultTarget()); ITool[] tools = config.getTools(); for (int index = 0; index < tools.length; index++) { ITool tool = tools[index]; - if (tool.producesFileType(outputExtension)) { + if (tool.producesFileType(ext)) { flags = tool.getOutputPrefix(); } } @@ -373,12 +382,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { * @see org.eclipse.cdt.core.build.managed.IResourceBuildInfo#getToolInvocation(java.lang.String) */ public String getToolForTarget(String extension) { + // Treat a null argument as an empty string + String ext = extension == null ? new String() : extension; // Get all the tools for the current config IConfiguration config = getDefaultConfiguration(getDefaultTarget()); ITool[] tools = config.getTools(); for (int index = 0; index < tools.length; index++) { ITool tool = tools[index]; - if (tool.producesFileType(extension)) { + if (tool.producesFileType(ext)) { return tool.getToolCommand(); } } diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java index 488e1fb8d95..3ed5bf404c9 100644 --- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java +++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java @@ -127,6 +127,9 @@ public class Tool extends BuildObject implements ITool, IOptionCategory { * @see org.eclipse.cdt.core.build.managed.ITool#handlesFileType(java.lang.String) */ public boolean buildsFileType(String extension) { + if (extension == null) { + return false; + } return getInputExtensions().contains(extension); } @@ -350,7 +353,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory { * @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String) */ public boolean producesFileType(String outputExtension) { - return outputExtension.equals(this.outputExtension); + return this.outputExtension.equals(outputExtension); } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties index 89a5370785c..f5654696747 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties @@ -13,9 +13,9 @@ MakeBuilder.message.incremental = Updating makefiles for project {0} MakeBuilder.message.make = Calling {0} for project {1} MakeBuilder.message.error = Build error MakeBuilder.message.finished = Build complete for project {0} -MakeBuilder.comment.module.list = # Every module must be described here -MakeBuilder.comment.source.list = # Each module must contribute its source files here -MakeBuilder.comment.build.rule = # Each module must supply rules for building sources it contributes -MakeBuilder.comment.module.make.includes = # Include the makefiles for each source module +MakeBuilder.comment.module.list = # Every subdirectory with source files must be described here +MakeBuilder.comment.source.list = # Each subdirectory must contribute its source files here +MakeBuilder.comment.build.rule = # Each subdirectory must supply rules for building sources it contributes +MakeBuilder.comment.module.make.includes = # Include the makefiles for each source subdirectory MakeBuilder.comment.module.dep.includes = # Include automatically-generated dependency list: MakeBuilder.comment.autodeps = # Automatically-generated dependency list: diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/MakefileGenerator.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/MakefileGenerator.java index b0f3c820e58..7a855792bd4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/MakefileGenerator.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/MakefileGenerator.java @@ -196,12 +196,14 @@ public class MakefileGenerator { // Get the clean command from the build model buffer.append("RM := "); - buffer.append(info.getCleanCommand() + NEWLINE); + buffer.append(info.getCleanCommand() + NEWLINE + NEWLINE); buffer.append(CCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); buffer.append("C_SRCS := " + NEWLINE); - buffer.append("CC_SRCS := " + NEWLINE); + buffer.append("CC_SRCS := " + NEWLINE + NEWLINE); + // Add the libraries this project dependes on + buffer.append("LIBS := "); buffer.append(NEWLINE + NEWLINE); return buffer; } @@ -401,6 +403,14 @@ public class MakefileGenerator { public void appendModule(IResource resource) { // The build model knows how to build this file IContainer container = resource.getParent(); + + // But is this a generated directory ... + IPath root = new Path(info.getConfigurationName()); + IPath path = container.getProjectRelativePath(); + if (root.isPrefixOf(path)) { + return; + } + if (!getModuleList().contains(container)) { getModuleList().add(container); } diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index 4af289c98ca..fe5ee1c052d 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,3 +1,14 @@ +2003-08-14 Sean Evoy + Added initial toolchain description for Solaris and Linux targets using Gnu tools. + * plugin.xml + + Moved tool and option category names into the properties for eventual I18N + * plugin.properties + + For build targets without an extension, the new project wizard was appending a 'dot' to the + name. It no loonger does this. + * build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java + 2003-08-13 Sean Evoy A simple change to add transparency information to the build property page GIFs. They were not being drawn properly on Solaris/Motif and would probably diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java index 170e709ec69..f543524abcc 100644 --- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java +++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java @@ -94,7 +94,9 @@ public abstract class ManagedProjectWizard extends CProjectWizard { ITarget newTarget = ManagedBuildManager.createTarget(project, parent); if (newTarget != null) { // TODO add name entry field to project - newTarget.setBuildArtifact(project.getName() + "." + parent.getDefaultExtension()); + String artifactName = project.getName(); + artifactName += parent.getDefaultExtension().length() == 0 ? "" : "." + parent.getDefaultExtension(); + newTarget.setBuildArtifact(artifactName); IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations(); for (int i = 0; i < selectedConfigs.length; i++) { IConfiguration config = selectedConfigs[i]; diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties index e98d67e8a7c..94035d098d4 100644 --- a/core/org.eclipse.cdt.ui/plugin.properties +++ b/core/org.eclipse.cdt.ui/plugin.properties @@ -88,11 +88,21 @@ CFolderActionSet.description=C Folder Action Set DeleteTaskAction.label=Delete C/C++ Markers # Build Model Names +ConfigName.Rel=Release +ConfigName.Dbg=Debug ToolName.preprocessor = Preprocessor ToolName.compiler = Compiler ToolName.archiver = Archiver ToolName.linker = Linker -ToolName.command = Command Line +OptionCategory.Preproc = Preprocessor +OptionCategory.Dirs = Directories +OptionCategory.General = General +OptionCategory.CLSum = Command Line Summary +OptionCategory.Optimize=Optimization +OptionCategory.Debug=Debugging +OptionCategory.Warn=Warnings +OptionCategory.Misc=Miscelaneous +OptionCategory.Libs=Libraries # C/C++ Search CSearchPage.label= C/C++ Search diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml index 7565d32dbd6..54608d06f91 100644 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ b/core/org.eclipse.cdt.ui/plugin.xml @@ -268,8 +268,8 @@ id="org.eclipse.cdt.ui.ceditor" point="org.eclipse.ui.editors">