1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Marked those strings that are non-translatable as such and externalized those strings that can be translated. There is still work to be done in this area for this plugin.

This commit is contained in:
Sean Evoy 2004-03-02 16:35:03 +00:00
parent b529cdd23d
commit 8503542b55
13 changed files with 578 additions and 547 deletions

View file

@ -1,3 +1,21 @@
2004-03-02 James Ciesielski
Marked those strings that are non-translatable as such and externalized
those strings that can be translated. There is still work to be done in
this area for this plugin.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderManager.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
2004-03-02 Sean Evoy
Work to support feature C1, "Set Tool Command in Project".
Now it is possible to store an overridden tool command in a tool

View file

@ -14,6 +14,8 @@ package org.eclipse.cdt.managedbuilder.core;
import java.util.List;
public interface IManagedBuildInfo {
public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$
public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$
/**
* Add a new target to the build information for the receiver

View file

@ -34,6 +34,7 @@ import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.Target;
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
import org.eclipse.core.resources.IFile;
@ -55,7 +56,7 @@ import org.w3c.dom.Node;
*/
public class ManagedBuildManager extends AbstractCExtension implements IScannerInfoProvider {
private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo");
private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo"); //$NON-NLS-1$
private static final String ROOT_ELEM_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
private static final String FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
private static final ITarget[] emptyTargets = new ITarget[0];
@ -63,7 +64,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
// This is the version of the manifest and project files that
private static final String buildInfoVersion = "2.0.0";
private static final String buildInfoVersion = "2.0.0"; //$NON-NLS-1$
private static boolean extensionTargetsLoaded = false;
private static Map extensionTargetMap;
private static List extensionTargets;
@ -298,7 +299,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
String xml = null;
try {
Serializer serializer
= SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format);
= SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format); //$NON-NLS-1$
serializer.asDOMSerializer().serialize(doc);
xml = s.toString("UTF8"); //$NON-NLS-1$
IFile rscFile = project.getFile(FILE_NAME);
@ -405,13 +406,13 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
if (resource instanceof IProject) {
// Must be an extension target (why?)
if (owner != null)
throw new BuildException("addTarget: owner not null");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.owner_not_null")); //$NON-NLS-1$
} else {
// Owner must be owned by the project containing this resource
if (owner == null)
throw new BuildException("addTarget: null owner");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.null_owner")); //$NON-NLS-1$
if (!owner.equals(resource.getProject()))
throw new BuildException("addTarget: owner not project");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.owner_not_project")); //$NON-NLS-1$
}
// Passed validation

View file

@ -50,9 +50,9 @@ public class ManagedBuilderCorePlugin extends Plugin {
try {
return resourceBundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
} catch (NullPointerException e) {
return "#" + key + "#";
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -27,7 +27,7 @@ import org.eclipse.core.runtime.Plugin;
public class ManagedCProjectNature implements IProjectNature {
public static final String BUILDER_NAME = "genmakebuilder";
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME;
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
private static final String MNG_NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedBuildNature";
private IProject project;
@ -50,7 +50,7 @@ public class ManagedCProjectNature implements IProjectNature {
// TODO Remove this when the new StandardBuild nature adds the cbuilder
for (int i = 0; i < commands.length; i++) {
ICommand command = commands[i];
if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) {
if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) { //$NON-NLS-1$
// Remove the command
Vector vec = new Vector(Arrays.asList(commands));
vec.removeElementAt(i);
@ -112,7 +112,7 @@ public class ManagedCProjectNature implements IProjectNature {
Plugin plugin = (Plugin)ManagedBuilderCorePlugin.getDefault();
IPluginDescriptor descriptor = plugin.getDescriptor();
if (descriptor.getExtension(BUILDER_NAME) != null) {
return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME;
return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
}
return BUILDER_ID;
}

View file

@ -206,9 +206,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
protected String[] getMakeTargets(boolean fullBuild) {
List args = new ArrayList();
if (fullBuild) {
args.add("clean");
args.add("clean"); //$NON-NLS-1$
}
args.add("all");
args.add("all"); //$NON-NLS-1$
return (String[])args.toArray(new String[args.size()]);
}
@ -337,7 +337,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
ArrayList makeArgs = new ArrayList();
String arg = info.getMakeArguments();
if (arg.length() > 0) {
String[] args = arg.split("\\s");
String[] args = arg.split("\\s"); //$NON-NLS-1$
for (int i = 0; i < args.length; ++i) {
makeArgs.add(args[i]);
}
@ -406,13 +406,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
if (errMsg != null && errMsg.length() > 0) {
String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR);
buf.append(errorDesc);
buf.append(System.getProperty("line.separator", "\n"));
buf.append("(").append(errMsg).append(")");
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-2$
buf.append("(").append(errMsg).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
// Report a successful build
String successMsg = ManagedBuilderCorePlugin.getFormattedString(BUILD_FINISHED, currentProject.getName());
buf.append(successMsg);
buf.append(System.getProperty("line.separator", "\n"));
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-2$
}
// Write message on the console
@ -421,7 +421,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
stdout.close();
stderr.close();
monitor.subTask(ManagedBuilderCorePlugin.getResourceString(MARKERS)); //$NON-NLS-1$
monitor.subTask(ManagedBuilderCorePlugin.getResourceString(MARKERS));
epm.reportProblems();
}
} catch (Exception e) {

View file

@ -321,7 +321,7 @@ public class MakefileGenerator {
// Calculate the new directory relative to the build output
IPath moduleRelativePath = module.getProjectRelativePath();
String relativePath = moduleRelativePath.toString();
relativePath += relativePath.length() == 0 ? "" : SEPARATOR;
relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
// Create the buffer to hold the output for the module and a dep calculator
StringBuffer buffer = new StringBuffer();
@ -381,13 +381,13 @@ public class MakefileGenerator {
*/
private String escapeWhitespaces(String path) {
// Escape the spaces in the path/filename if it has any
String[] segments = path.split("\\s");
String[] segments = path.split("\\s"); //$NON-NLS-1$
if (segments.length > 1) {
StringBuffer escapedPath = new StringBuffer();
for (int index = 0; index < segments.length; ++index) {
escapedPath.append(segments[index]);
if (index + 1 < segments.length) {
escapedPath.append("\\ ");
escapedPath.append("\\ "); //$NON-NLS-1$
}
}
return escapedPath.toString().trim();
@ -432,27 +432,27 @@ public class MakefileGenerator {
StringBuffer buffer = new StringBuffer();
// Add the ROOT macro
buffer.append("ROOT := .." + NEWLINE);
buffer.append("ROOT := .." + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// include makefile.init supplementary makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_INIT + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_INIT + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Get the clean command from the build model
buffer.append("RM := ");
buffer.append("RM := "); //$NON-NLS-1$
buffer.append(info.getCleanCommand() + NEWLINE);
buffer.append(NEWLINE);
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
buffer.append("C_SRCS := " + NEWLINE);
buffer.append("CC_SRCS := " + NEWLINE);
buffer.append("CXX_SRCS := " + NEWLINE);
buffer.append("CAPC_SRCS := " + NEWLINE);
buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE);
buffer.append("C_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CC_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CXX_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CAPC_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE); //$NON-NLS-1$
// Add the libraries this project depends on
buffer.append("LIBS := ");
buffer.append("LIBS := "); //$NON-NLS-1$
String[] libs = info.getLibsForTarget(extension);
for (int i = 0; i < libs.length; i++) {
String string = libs[i];
@ -461,7 +461,7 @@ public class MakefileGenerator {
buffer.append(NEWLINE + NEWLINE);
// Add the extra user-specified objects
buffer.append("USER_OBJS := ");
buffer.append("USER_OBJS := "); //$NON-NLS-1$
String[] userObjs = info.getUserObjectsForTarget(extension);
for (int j = 0; j < userObjs.length; j++) {
String string = userObjs[j];
@ -469,7 +469,7 @@ public class MakefileGenerator {
}
buffer.append(NEWLINE + NEWLINE);
buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE);
buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE); //$NON-NLS-1$
return (buffer.append(NEWLINE));
}
@ -480,7 +480,7 @@ public class MakefileGenerator {
StringBuffer buffer = new StringBuffer();
// Add the comment
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE);
buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE);
buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE); //$NON-NLS-1$
// Get all the module names
ListIterator iter = getSubdirList().listIterator();
@ -488,7 +488,7 @@ public class MakefileGenerator {
IContainer container = (IContainer) iter.next();
// Check the special case where the module is the project root
if (container.getFullPath() == project.getFullPath()) {
buffer.append("." + WHITESPACE + LINEBREAK + NEWLINE);
buffer.append(DOT + WHITESPACE + LINEBREAK + NEWLINE);
} else {
IPath path = container.getProjectRelativePath();
buffer.append(path.toString() + WHITESPACE + LINEBREAK + NEWLINE);
@ -498,11 +498,11 @@ public class MakefileGenerator {
// Now add the makefile instruction to include all the subdirectory makefile fragments
buffer.append(NEWLINE);
buffer.append(COMMENT_SYMBOL +WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Include makefile.defs supplemental makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_DEFS + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_DEFS + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
return buffer;
@ -520,20 +520,20 @@ public class MakefileGenerator {
// Calculate the new directory relative to the build output
IPath moduleRelativePath = module.getProjectRelativePath();
String relativePath = moduleRelativePath.toString();
relativePath += relativePath.length() == 0 ? "" : SEPARATOR;
relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
// String buffers
StringBuffer buffer = new StringBuffer();
StringBuffer cBuffer = new StringBuffer("C_SRCS += " + LINEBREAK + NEWLINE);
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE);
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE);
cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE);
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE);
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cBuffer = new StringBuffer("C_SRCS += " + LINEBREAK + NEWLINE); //$NON-NLS-1$
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE); //$NON-NLS-1$
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE); //$NON-NLS-1$
cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE); //$NON-NLS-1$
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE); //$NON-NLS-1$
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer ruleBuffer = new StringBuffer(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE);
// Put the comment in
@ -546,13 +546,13 @@ public class MakefileGenerator {
if (resource.getType() == IResource.FILE) {
String ext = resource.getFileExtension();
if (info.buildsFileType(ext)) {
if (new String("c").equals(ext)) {
if (new String("c").equals(ext)) { //$NON-NLS-1$
cBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("cc").equalsIgnoreCase(ext)) {
} else if (new String("cc").equalsIgnoreCase(ext)) { //$NON-NLS-1$
ccBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("cxx").equalsIgnoreCase(ext)) {
} else if (new String("cxx").equalsIgnoreCase(ext)) { //$NON-NLS-1$
cxxBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("C").equals(ext)) {
} else if (new String("C").equals(ext)) { //$NON-NLS-1$
capcBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else {
cppBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
@ -565,11 +565,11 @@ public class MakefileGenerator {
}
// Finish the commands in the buffers
buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
return buffer.append(ruleBuffer + NEWLINE);
}
@ -588,7 +588,7 @@ public class MakefileGenerator {
String flags = info.getFlagsForTarget(extension);
String outflag = info.getOutputFlag(extension);
String outputPrefix = info.getOutputPrefix(extension);
String targets = rebuild ? "clean all" : "all";
String targets = rebuild ? "clean all" : "all"; //$NON-NLS-1$ //$NON-NLS-2$
// Get all the projects the build target depends on
IProject[] deps = null;
@ -601,9 +601,9 @@ public class MakefileGenerator {
// Write out the all target first in case someone just runs make
// all: targ_<target_name> [deps]
String defaultTarget = "all:";
String defaultTarget = "all:"; //$NON-NLS-1$
if (deps.length > 0) {
defaultTarget += WHITESPACE + "deps";
defaultTarget += WHITESPACE + "deps"; //$NON-NLS-1$
}
buffer.append(defaultTarget + WHITESPACE + outputPrefix + target);
if (extension.length() > 0) {
@ -619,7 +619,7 @@ public class MakefileGenerator {
*/
List managedProjectOutputs = new ArrayList();
if (deps.length > 0) {
buffer.append("deps:" + NEWLINE);
buffer.append("deps:" + NEWLINE); //$NON-NLS-1$
if (deps != null) {
for (int i = 0; i < deps.length; i++) {
IProject dep = deps[i];
@ -635,7 +635,7 @@ public class MakefileGenerator {
String depExt = depInfo.getBuildArtifactExtension();
String depPrefix = depInfo.getOutputPrefix(depExt);
if (depInfo.isDirty()) {
depTargets = "clean all";
depTargets = "clean all"; //$NON-NLS-1$
}
String dependency = buildDir + SEPARATOR + depPrefix + depTarget;
if (depExt.length() > 0) {
@ -643,7 +643,7 @@ public class MakefileGenerator {
}
managedProjectOutputs.add(dependency);
}
buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE);
buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
}
}
buffer.append(NEWLINE);
@ -658,27 +658,27 @@ public class MakefileGenerator {
if (extension.length() > 0) {
buffer.append(DOT + extension);
}
buffer.append(COLON + WHITESPACE + "$(OBJS)");
buffer.append(COLON + WHITESPACE + "$(OBJS)"); //$NON-NLS-1$
Iterator iter = managedProjectOutputs.listIterator();
while (iter.hasNext()) {
buffer.append(WHITESPACE + (String)iter.next());
}
buffer.append(NEWLINE);
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(USER_OBJS) $(LIBS)");
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(USER_OBJS) $(LIBS)"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(NEWLINE + NEWLINE);
// Always add a clean target
buffer.append("clean:" + NEWLINE);
buffer.append(TAB + "-$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE);
buffer.append("clean:" + NEWLINE); //$NON-NLS-1$
buffer.append(TAB + "-$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE);
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE); //$NON-NLS-1$
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Include makefile.targets supplemental makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_TARGETS + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_TARGETS + NEWLINE); //$NON-NLS-1$
return buffer;
}
@ -717,7 +717,7 @@ public class MakefileGenerator {
* source1/%.o: $(ROOT)/source1/%.cpp
* g++ -g -O2 -c -I/cygdrive/c/eclipse/workspace/Project/headers -o $@ $<
*/
rule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + "$(ROOT)" + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension;
rule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + "$(ROOT)" + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension; //$NON-NLS-1$
}
// Check if the rule is listed as something we already generated in the makefile
@ -731,7 +731,7 @@ public class MakefileGenerator {
buildFlags = info.getFlagsForSource(inputExtension);
outflag = info.getOutputFlag(outputExtension);
outputPrefix = info.getOutputPrefix(outputExtension);
buffer.append(TAB + cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + "$@" + WHITESPACE + "$<" + NEWLINE + NEWLINE);
buffer.append(TAB + cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + "$@" + WHITESPACE + "$<" + NEWLINE + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -74,13 +74,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
String defaultTargetId = null;
List configIds = new ArrayList();
while (child != null) {
if (child.getNodeName().equals("target")) {
if (child.getNodeName().equals(ITarget.TARGET_ELEMENT_NAME)) {
new Target(this, (Element)child);
} else if (child.getNodeName().equals("defaultConfig")) {
} else if (child.getNodeName().equals(DEFAULT_CONFIGURATION)) {
// We may not have read the config in yet, so just cache it
configIds.add(((Element)child).getAttribute("id"));
} else if (child.getNodeName().equals("defaultTarget")) {
defaultTargetId = ((Element)child).getAttribute("id");
configIds.add(((Element)child).getAttribute(IConfiguration.ID));
} else if (child.getNodeName().equals(DEFAULT_TARGET)) {
defaultTargetId = ((Element)child).getAttribute(ITarget.ID);
}
child = child.getNextSibling();
}
@ -280,7 +280,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
String key = new String();
String value = new String();
int index = symbol.indexOf("=");
int index = symbol.indexOf("="); //$NON-NLS-1$
if (index != -1) {
key = symbol.substring(0, index).trim();
value = symbol.substring(index + 1).trim();
@ -392,7 +392,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IPath location = owner.getLocation();
// If the build info is out of date this might be null
if (location == null) {
location = new Path(".");
location = new Path("."); //$NON-NLS-1$
}
IPath root = location.addTrailingSeparator().append(config.getName());
ITool[] tools = config.getTools();
@ -824,21 +824,21 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
public void serialize(Document doc, Element element) {
// Write out each target and their default config
for (int i = 0; i < targets.size(); ++i) {
Element targetElement = doc.createElement("target");
Element targetElement = doc.createElement(ITarget.TARGET_ELEMENT_NAME);
element.appendChild(targetElement);
((Target)targets.get(i)).serialize(doc, targetElement);
IConfiguration config = getDefaultConfiguration((ITarget)targets.get(i));
if (config != null) {
Element configEl = doc.createElement("defaultConfig");
Element configEl = doc.createElement(DEFAULT_CONFIGURATION);
element.appendChild(configEl);
configEl.setAttribute("id", config.getId());
configEl.setAttribute(IConfiguration.ID, config.getId());
}
}
// Persist the default target
if (getDefaultTarget() != null){
Element targEl = doc.createElement("defaultTarget");
Element targEl = doc.createElement(DEFAULT_TARGET);
element.appendChild(targEl);
targEl.setAttribute("id", getDefaultTarget().getId());
targEl.setAttribute(ITarget.ID, getDefaultTarget().getId());
}
}

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.core.runtime.IConfigurationElement;
public class Option extends BuildObject implements IOption {
@ -178,7 +179,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getDefinedSymbols() throws BuildException {
if (valueType != PREPROCESSOR_SYMBOLS) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -202,7 +203,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getIncludePaths() throws BuildException {
if (valueType != INCLUDE_PATH) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -218,7 +219,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getLibraries() throws BuildException {
if (valueType != LIBRARIES) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -234,7 +235,7 @@ public class Option extends BuildObject implements IOption {
*/
public String getSelectedEnum() throws BuildException {
if (valueType != ENUMERATED) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
return defaultEnumName == null ? EMPTY_STRING : defaultEnumName;
}
@ -244,7 +245,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getStringListValue() throws BuildException {
if (valueType != STRING_LIST) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -260,7 +261,7 @@ public class Option extends BuildObject implements IOption {
*/
public String getStringValue() throws BuildException {
if (valueType != STRING) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
return value == null ? EMPTY_STRING : (String)value;
}
@ -277,7 +278,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getUserObjects() throws BuildException {
if (valueType != OBJECTS) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
// This is the right puppy, so return its list value
ArrayList v = (ArrayList)value;
@ -311,7 +312,7 @@ public class Option extends BuildObject implements IOption {
{
if (valueType != IOption.STRING
|| valueType != ENUMERATED)
throw new BuildException("Bad value for type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
if (config == null) {
this.value = value;
@ -333,7 +334,7 @@ public class Option extends BuildObject implements IOption {
|| valueType != PREPROCESSOR_SYMBOLS
|| valueType != LIBRARIES
|| valueType != OBJECTS)
throw new BuildException("Bad value for type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
if (config == null) {
this.value = value;

View file

@ -19,6 +19,7 @@ import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.core.runtime.IConfigurationElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@ -190,7 +191,7 @@ public class OptionReference implements IOption {
while (iter.hasNext()) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next());
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false");
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false"); //$NON-NLS-1$
element.appendChild(valueElement);
}
// Serialize the built-ins that have been overridden
@ -199,7 +200,7 @@ public class OptionReference implements IOption {
while (iter.hasNext()) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next());
valueElement.setAttribute(LIST_ITEM_BUILTIN, "true");
valueElement.setAttribute(LIST_ITEM_BUILTIN, "true"); //$NON-NLS-1$
element.appendChild(valueElement);
}
}
@ -239,7 +240,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -268,7 +269,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -282,7 +283,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -304,7 +305,7 @@ public class OptionReference implements IOption {
Boolean bool = (Boolean) value;
return bool.booleanValue();
} else {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@ -334,7 +335,7 @@ public class OptionReference implements IOption {
// Value will contain the human-readable name of the enum
return (String) value;
} else {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@ -349,7 +350,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -361,7 +362,7 @@ public class OptionReference implements IOption {
else if (getValueType() == STRING)
return (String)value;
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -391,7 +392,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -433,7 +434,7 @@ public class OptionReference implements IOption {
if (getValueType() == BOOLEAN)
this.value = new Boolean(value);
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/**
@ -444,7 +445,7 @@ public class OptionReference implements IOption {
if (getValueType() == STRING || getValueType() == ENUMERATED)
this.value = value;
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/**
@ -463,7 +464,7 @@ public class OptionReference implements IOption {
this.value = new ArrayList(Arrays.asList(value));
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}

View file

@ -26,3 +26,11 @@ ManagedMakeBuilder.comment.module.make.includes = Include the makefiles for each
ManagedMakeBuilder.comment.module.dep.includes = Include automatically-generated dependency list:
ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
# Option exception messages
Option.error.bad_value_type=Bad value for type
# Managed build manager exception messages
ManagedBuildManager.error.owner_not_null=addTarget: owner not null
ManagedBuildManager.error.null_owner=addTarget: null owner
ManagedBuildManager.error.owner_not_project=addTarget: owner not project

View file

@ -83,7 +83,7 @@ public class Target extends BuildObject implements ITarget {
if (id < 0) {
id *= -1;
}
setId(owner.getName() + "." + parent.getId() + "." + id);
setId(owner.getName() + "." + parent.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(parent.getName());
this.artifactName = parent.getArtifactName();
this.binaryParserId = parent.getBinaryParserId();
@ -133,10 +133,10 @@ public class Target extends BuildObject implements ITarget {
}
// isAbstract
isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT)));
isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT))); //$NON-NLS-1$
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$
// Get the clean command
cleanCommand = element.getAttribute(CLEAN_COMMAND);
@ -148,7 +148,7 @@ public class Target extends BuildObject implements ITarget {
String os = element.getAttribute(OS_LIST);
if (os != null) {
targetOSList = new ArrayList();
StringTokenizer tokens = new StringTokenizer(os, ",");
StringTokenizer tokens = new StringTokenizer(os, ","); //$NON-NLS-1$
while (tokens.hasMoreTokens()) {
targetOSList.add(tokens.nextToken().trim());
}
@ -204,11 +204,11 @@ public class Target extends BuildObject implements ITarget {
parent = ManagedBuildManager.getTarget(null, parentId);
// isAbstract
if ("true".equals(element.getAttribute(IS_ABSTRACT)))
if ("true".equals(element.getAttribute(IS_ABSTRACT))) //$NON-NLS-1$
isAbstract = true;
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$
// Get the clean command
cleanCommand = element.getAttribute(CLEAN_COMMAND);
@ -265,12 +265,12 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(NAME, getName());
if (parent != null)
element.setAttribute(PARENT, parent.getId());
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
element.setAttribute(ARTIFACT_NAME, getArtifactName());
if (extension != null) {
element.setAttribute(EXTENSION, extension);
}
element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(IS_TEST, isTest ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
if (makeCommand != null) {
element.setAttribute(MAKE_COMMAND, makeCommand);
@ -312,7 +312,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getMakeArguments();
} else {
// No parent and no user setting
return new String("");
return new String(""); //$NON-NLS-1$
}
}
return makeArguments;
@ -329,7 +329,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getMakeCommand();
} else {
// The user has forgotten to specify a command in the plugin manifets.
return new String("make");
return new String("make"); //$NON-NLS-1$
}
} else {
return makeCommand;
@ -534,10 +534,10 @@ public class Target extends BuildObject implements ITarget {
return parent.getCleanCommand();
} else {
// User forgot to specify it. Guess based on OS.
if (BootLoader.getOS().equals("OS_WIN32")) {
return new String("del");
if (BootLoader.getOS().equals("OS_WIN32")) { //$NON-NLS-1$
return new String("del"); //$NON-NLS-1$
} else {
return new String("rm");
return new String("rm"); //$NON-NLS-1$
}
}
} else {

View file

@ -32,7 +32,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
*/
public class Tool extends BuildObject implements ITool, IOptionCategory {
private static final String DEFAULT_SEPARATOR = ",";
private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$
private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0];
private static final IOption[] EMPTY_OPTIONS = new IOption[0];
@ -337,11 +337,11 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
// Get the nature filter
String nature = element.getAttribute(NATURE);
if (nature == null || "both".equals(nature)) {
if (nature == null || "both".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_BOTH;
} else if ("cnature".equals(nature)) {
} else if ("cnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_C;
} else if ("ccnature".equals(nature)) {
} else if ("ccnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_CC;
} else {
natureFilter = FILTER_BOTH;