mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Externalizing strings.
This commit is contained in:
parent
f016e5805b
commit
173f521b41
5 changed files with 31 additions and 19 deletions
|
@ -235,7 +235,7 @@ public class BuildInfoFactory {
|
|||
protected Map decodeMap(String value) {
|
||||
Map map = new HashMap();
|
||||
StringBuffer envStr = new StringBuffer(value);
|
||||
String escapeChars = "|\\";
|
||||
String escapeChars = "|\\"; //$NON-NLS-1$
|
||||
char escapeChar = '\\';
|
||||
try {
|
||||
while (envStr.length() > 0) {
|
||||
|
|
|
@ -33,10 +33,10 @@ import org.eclipse.core.runtime.IPath;
|
|||
*/
|
||||
public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
||||
private final static String[] FILE_EXTENSIONS = {
|
||||
".c", ".cc", ".cpp", ".cxx", ".C", ".CC", ".CPP", ".CXX"
|
||||
".c", ".cc", ".cpp", ".cxx", ".C", ".CC", ".CPP", ".CXX" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
|
||||
};
|
||||
private final static String[] COMPILER_INVOCATION = {
|
||||
"gcc", "g++", "cc", "c++"
|
||||
"gcc", "g++", "cc", "c++" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
};
|
||||
private final static List FILE_EXTENSIONS_LIST = Arrays.asList(FILE_EXTENSIONS);
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
|||
return rc;
|
||||
|
||||
// expecting that compiler invocation is the first token in the line
|
||||
String[] split = line.split("\\s+");
|
||||
String[] split = line.split("\\s+"); //$NON-NLS-1$
|
||||
String command = split[0];
|
||||
// verify that it is compiler invocation
|
||||
int cii2 = -1;
|
||||
|
@ -84,7 +84,7 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
|||
break;
|
||||
}
|
||||
if (cii2 == -1) {
|
||||
TraceUtil.outputTrace("Error identifying compiler command", line, TraceUtil.EOL);
|
||||
TraceUtil.outputTrace("Error identifying compiler command", line, TraceUtil.EOL); //$NON-NLS-1$
|
||||
return rc;
|
||||
}
|
||||
// find a file name
|
||||
|
@ -113,20 +113,20 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
|||
// }
|
||||
// if (found) break;
|
||||
if (!found) {
|
||||
TraceUtil.outputTrace("Error identifying file name :1", line, TraceUtil.EOL);
|
||||
TraceUtil.outputTrace("Error identifying file name :1", line, TraceUtil.EOL); //$NON-NLS-1$
|
||||
return rc;
|
||||
}
|
||||
// sanity check
|
||||
if (filePath.indexOf(FILE_EXTENSIONS[extensionsIndex]) == -1) {
|
||||
TraceUtil.outputTrace("Error identifying file name :2", line, TraceUtil.EOL);
|
||||
TraceUtil.outputTrace("Error identifying file name :2", line, TraceUtil.EOL); //$NON-NLS-1$
|
||||
return rc;
|
||||
}
|
||||
if (fUtil != null) {
|
||||
IPath pFilePath = fUtil.getAbsolutePath(filePath);
|
||||
String longFileName = pFilePath.toString();
|
||||
String shortFileName = pFilePath.removeFileExtension().lastSegment();
|
||||
String genericLine = line.replaceAll(filePath, "LONG_NAME");
|
||||
genericLine = genericLine.replaceAll(shortFileName+"\\.", "SHORT_NAME\\.");
|
||||
String genericLine = line.replaceAll(filePath, "LONG_NAME"); //$NON-NLS-1$
|
||||
genericLine = genericLine.replaceAll(shortFileName+"\\.", "SHORT_NAME\\."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
CCommandDSC cmd = fUtil.getNewCCommandDSC(genericLine, extensionsIndex > 0);
|
||||
List cmdList = new ArrayList();
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SCJobsUtil {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return rc ? "true" : "false"; //$NON-NLS-1$ //$$NON-NLS-2$
|
||||
return rc ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
private boolean rc;
|
||||
}
|
||||
|
|
|
@ -35,8 +35,20 @@ public final class SCDOptionsEnum {
|
|||
public static final int MAX = 13;
|
||||
|
||||
private static final String[] SCDOPTION_STRING_VALS = {
|
||||
"cc", "-D", "-U", "-I", "-I-", "-nostdinc", "-nostdinc++", "-include", "-imacros",
|
||||
"-idirafter", "-isystem", "-iprefix", "-iwithprefix", "-iwithprefixbefore"
|
||||
"cc", //$NON-NLS-1$
|
||||
"-D", //$NON-NLS-1$
|
||||
"-U", //$NON-NLS-1$
|
||||
"-I", //$NON-NLS-1$
|
||||
"-I-", //$NON-NLS-1$
|
||||
"-nostdinc", //$NON-NLS-1$
|
||||
"-nostdinc++", //$NON-NLS-1$
|
||||
"-include", //$NON-NLS-1$
|
||||
"-imacros", //$NON-NLS-1$
|
||||
"-idirafter", //$NON-NLS-1$
|
||||
"-isystem", //$NON-NLS-1$
|
||||
"-iprefix", //$NON-NLS-1$
|
||||
"-iwithprefix", //$NON-NLS-1$
|
||||
"-iwithprefixbefore" //$NON-NLS-1$
|
||||
};
|
||||
private static final SCDOptionsEnum SCDOPTIONS[] = {
|
||||
COMMAND, DEFINE, UNDEFINE, INCLUDE, IDASH, NOSTDINC, NOSTDINCPP, INCLUDE_FILE, IMACROS_FILE,
|
||||
|
|
|
@ -103,11 +103,11 @@ public class TraceUtil {
|
|||
public static void metricsTrace(String title, String subtitlePrefix, String subtitlePostfix, Map directoryCommandListMap) {
|
||||
try {
|
||||
logger.writeln();
|
||||
logger.writeln(" *** NEW METRICS TRACE ***");
|
||||
logger.writeln(" *** NEW METRICS TRACE ***"); //$NON-NLS-1$
|
||||
logger.writeln();
|
||||
for (Iterator k = directoryCommandListMap.keySet().iterator(); k.hasNext(); ) {
|
||||
String dir = (String) k.next();
|
||||
logger.writeln(title + dir + ":");
|
||||
logger.writeln(title + dir + ":"); //$NON-NLS-1$
|
||||
List directoryCommandList = (List) directoryCommandListMap.get(dir);
|
||||
if (directoryCommandList == null) {
|
||||
logger.writeln(" --- empty ---" + EOL); //$NON-NLS-1$
|
||||
|
@ -138,12 +138,12 @@ public class TraceUtil {
|
|||
public static void summaryTrace(String title, int workingDirsN, int commandsN, int filesN) {
|
||||
try {
|
||||
logger.writeln();
|
||||
logger.writeln(" *** METRICS SUMMARY ***");
|
||||
logger.writeln(" *** METRICS SUMMARY ***"); //$NON-NLS-1$
|
||||
logger.writeln();
|
||||
logger.writeln(title);
|
||||
logger.writeln(" Number of directories visited: " + Integer.toString(workingDirsN));
|
||||
logger.writeln(" Number of generic commands: " + Integer.toString(commandsN));
|
||||
logger.writeln(" Number of compiled files: " + Integer.toString(filesN));
|
||||
logger.writeln(" Number of directories visited: " + Integer.toString(workingDirsN)); //$NON-NLS-1$
|
||||
logger.writeln(" Number of generic commands: " + Integer.toString(commandsN)); //$NON-NLS-1$
|
||||
logger.writeln(" Number of compiled files: " + Integer.toString(filesN)); //$NON-NLS-1$
|
||||
logger.flushLog();
|
||||
}
|
||||
catch (IOException e) {}
|
||||
|
@ -155,7 +155,7 @@ public class TraceUtil {
|
|||
public static void metricsTrace(String trace) {
|
||||
try {
|
||||
logger.writeln();
|
||||
logger.writeln(" *** NEW METRICS TRACE 2 ***");
|
||||
logger.writeln(" *** NEW METRICS TRACE 2 ***"); //$NON-NLS-1$
|
||||
logger.writeln();
|
||||
logger.writeln(trace);
|
||||
logger.flushLog();
|
||||
|
|
Loading…
Add table
Reference in a new issue