mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
some work on externalizing strings
This commit is contained in:
parent
bd77af6152
commit
228957743b
12 changed files with 34 additions and 33 deletions
|
@ -169,7 +169,7 @@ public class MakeBuilder extends ACBuilder {
|
||||||
// MakeRecon recon = new MakeRecon(buildCommand, buildArguments, env, workingDirectory, makeMonitor, cos);
|
// MakeRecon recon = new MakeRecon(buildCommand, buildArguments, env, workingDirectory, makeMonitor, cos);
|
||||||
// recon.invokeMakeRecon();
|
// recon.invokeMakeRecon();
|
||||||
// cos = recon;
|
// cos = recon;
|
||||||
QualifiedName qName = new QualifiedName(MakeCorePlugin.getUniqueIdentifier(), "progressMonitor");
|
QualifiedName qName = new QualifiedName(MakeCorePlugin.getUniqueIdentifier(), "progressMonitor"); //$NON-NLS-1$
|
||||||
Integer last = (Integer)getProject().getSessionProperty(qName);
|
Integer last = (Integer)getProject().getSessionProperty(qName);
|
||||||
if (last == null) {
|
if (last == null) {
|
||||||
last = new Integer(100);
|
last = new Integer(100);
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.eclipse.core.runtime.Status;
|
||||||
* The main plugin class to be used in the desktop.
|
* The main plugin class to be used in the desktop.
|
||||||
*/
|
*/
|
||||||
public class MakeCorePlugin extends Plugin {
|
public class MakeCorePlugin extends Plugin {
|
||||||
public static final String MAKE_PROJECT_ID = MakeCorePlugin.getUniqueIdentifier() + ".make";
|
public static final String MAKE_PROJECT_ID = MakeCorePlugin.getUniqueIdentifier() + ".make"; //$NON-NLS-1$
|
||||||
private MakeTargetManager fTargetManager;
|
private MakeTargetManager fTargetManager;
|
||||||
public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$
|
public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$
|
||||||
//The shared instance.
|
//The shared instance.
|
||||||
|
|
|
@ -7,7 +7,8 @@ MakeBuidler.Creating_Markers=Generating markers...
|
||||||
|
|
||||||
BuildInfoFactory.Missing_Builder=Missing Builder:
|
BuildInfoFactory.Missing_Builder=Missing Builder:
|
||||||
|
|
||||||
MakeTargetProvider.add_to_workspace_root=Cannot add build targets to workspace root
|
MakeTargetManager.add_to_workspace_root=Cannot add build targets to workspace root
|
||||||
MakeTargetProvider.add_temporary_target=Cannot add temporart Target to manager.
|
MakeTargetManager.add_temporary_target=Cannot add temporart Target to manager.
|
||||||
MakeTargetProvider.target_exists=Target exists
|
MakeTargetManager.target_exists=Target exists
|
||||||
MakeTargetProvider.failed_initializing_targets=Failed initializing build targets
|
MakeTargetManager.failed_initializing_targets=Failed initializing build targets
|
||||||
|
MakeTargetManager.error_writing_file=Error writing target file
|
||||||
|
|
|
@ -23,15 +23,15 @@ public interface ICommand extends IDirective {
|
||||||
|
|
||||||
final public static char HYPHEN = '-';
|
final public static char HYPHEN = '-';
|
||||||
|
|
||||||
final public static String HYPHEN_STRING = "-";
|
final public static String HYPHEN_STRING = "-"; //$NON-NLS-1$
|
||||||
|
|
||||||
final public static char AT = '@';
|
final public static char AT = '@';
|
||||||
|
|
||||||
final public static String AT_STRING = "@";
|
final public static String AT_STRING = "@"; //$NON-NLS-1$
|
||||||
|
|
||||||
final public static char PLUS = '+';
|
final public static char PLUS = '+';
|
||||||
|
|
||||||
final public static String PLUS_STRING = "+";
|
final public static String PLUS_STRING = "+"; //$NON-NLS-1$
|
||||||
|
|
||||||
final public static char TAB = '\t';
|
final public static char TAB = '\t';
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,6 @@ public interface IComment extends IDirective {
|
||||||
|
|
||||||
final public static char POUND = '#';
|
final public static char POUND = '#';
|
||||||
|
|
||||||
final public static String POUND_STRING = "#";
|
final public static String POUND_STRING = "#"; //$NON-NLS-1$
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class BuildInfoFactory {
|
||||||
public String[] getErrorParsers() {
|
public String[] getErrorParsers() {
|
||||||
String parsers = getString(ErrorParserManager.PREF_ERROR_PARSER);
|
String parsers = getString(ErrorParserManager.PREF_ERROR_PARSER);
|
||||||
if (parsers != null && parsers.length() > 0) {
|
if (parsers != null && parsers.length() > 0) {
|
||||||
StringTokenizer tok = new StringTokenizer(parsers, ";");
|
StringTokenizer tok = new StringTokenizer(parsers, ";"); //$NON-NLS-1$
|
||||||
List list = new ArrayList(tok.countTokens());
|
List list = new ArrayList(tok.countTokens());
|
||||||
while (tok.hasMoreElements()) {
|
while (tok.hasMoreElements()) {
|
||||||
list.add(tok.nextToken());
|
list.add(tok.nextToken());
|
||||||
|
@ -239,10 +239,10 @@ public class BuildInfoFactory {
|
||||||
Iterator entries = values.entrySet().iterator();
|
Iterator entries = values.entrySet().iterator();
|
||||||
while (entries.hasNext()) {
|
while (entries.hasNext()) {
|
||||||
Entry entry = (Entry) entries.next();
|
Entry entry = (Entry) entries.next();
|
||||||
str.append(escapeChars((String) entry.getKey(), "=|"));
|
str.append(escapeChars((String) entry.getKey(), "=|")); //$NON-NLS-1$
|
||||||
str.append("=");
|
str.append("="); //$NON-NLS-1$
|
||||||
str.append(escapeChars((String) entry.getValue(), "=|)"));
|
str.append(escapeChars((String) entry.getValue(), "=|)")); //$NON-NLS-1$
|
||||||
str.append("|");
|
str.append("|"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class MakeRecon extends OutputStream {
|
||||||
|
|
||||||
public MakeRecon(IPath buildCommand, String[] buildArguments,
|
public MakeRecon(IPath buildCommand, String[] buildArguments,
|
||||||
String[] env, IPath workingDirectory, IProgressMonitor mon, OutputStream cos) {
|
String[] env, IPath workingDirectory, IProgressMonitor mon, OutputStream cos) {
|
||||||
this(buildCommand, new String[]{"-n"}, buildArguments, env, workingDirectory, mon, cos);
|
this(buildCommand, new String[]{"-n"}, buildArguments, env, workingDirectory, mon, cos); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public MakeRecon(IPath buildCommand, String[] options, String[] buildArguments,
|
public MakeRecon(IPath buildCommand, String[] options, String[] buildArguments,
|
||||||
|
@ -102,7 +102,7 @@ public class MakeRecon extends OutputStream {
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
i = IProgressMonitor.UNKNOWN;
|
i = IProgressMonitor.UNKNOWN;
|
||||||
}
|
}
|
||||||
monitor.beginTask("", i);
|
monitor.beginTask("", i); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -156,7 +156,7 @@ public class MakeRecon extends OutputStream {
|
||||||
private void checkProgress(boolean flush) {
|
private void checkProgress(boolean flush) {
|
||||||
String buffer = currentLine.toString();
|
String buffer = currentLine.toString();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((i = buffer.indexOf("\n")) != -1) {
|
while ((i = buffer.indexOf("\n")) != -1) { //$NON-NLS-1$
|
||||||
String line = buffer.substring(0, i).trim(); // get rid of any trailing \r
|
String line = buffer.substring(0, i).trim(); // get rid of any trailing \r
|
||||||
processLine(line);
|
processLine(line);
|
||||||
buffer = buffer.substring(i + 1); // skip the \n and advance
|
buffer = buffer.substring(i + 1); // skip the \n and advance
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getBuildCommand() {
|
public IPath getBuildCommand() {
|
||||||
return buildCommand != null ? buildCommand: new Path("");
|
return buildCommand != null ? buildCommand: new Path(""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBuildCommand(IPath command) {
|
public void setBuildCommand(IPath command) {
|
||||||
|
@ -85,7 +85,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBuildArguments() {
|
public String getBuildArguments() {
|
||||||
return buildArguments != null ? buildArguments : "";
|
return buildArguments != null ? buildArguments : ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBuildArguments(String arguments) {
|
public void setBuildArguments(String arguments) {
|
||||||
|
|
|
@ -251,7 +251,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
||||||
projectTargets.saveTargets(file);
|
projectTargets.saveTargets(file);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(
|
throw new CoreException(
|
||||||
new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, "Error writing target file", e));
|
new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.error_writing_file"), e)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,13 @@ public class ProjectTargets {
|
||||||
private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$
|
private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ELEMENT = "target"; //$NON-NLS-1$
|
private static final String TARGET_ELEMENT = "target"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ATTR_ID = "targetID"; //$NON-NLS-1$
|
private static final String TARGET_ATTR_ID = "targetID"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ATTR_PATH = "path";
|
private static final String TARGET_ATTR_PATH = "path"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ATTR_NAME = "name";
|
private static final String TARGET_ATTR_NAME = "name"; //$NON-NLS-1$
|
||||||
private static final String TARGET_STOP_ON_ERROR = "stopOnError";
|
private static final String TARGET_STOP_ON_ERROR = "stopOnError"; //$NON-NLS-1$
|
||||||
private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand";
|
private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ARGUMENTS = "buildArguments";
|
private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
|
||||||
private static final String TARGET_COMMAND = "buildCommand";
|
private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
|
||||||
private static final String TARGET = "buidlTarget";
|
private static final String TARGET = "buidlTarget"; //$NON-NLS-1$
|
||||||
|
|
||||||
private HashMap targetMap = new HashMap();
|
private HashMap targetMap = new HashMap();
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public class ProjectTargets {
|
||||||
IContainer container = null;
|
IContainer container = null;
|
||||||
NamedNodeMap attr = node.getAttributes();
|
NamedNodeMap attr = node.getAttributes();
|
||||||
String path = attr.getNamedItem(TARGET_ATTR_PATH).getNodeValue();
|
String path = attr.getNamedItem(TARGET_ATTR_PATH).getNodeValue();
|
||||||
if (path != null && !path.equals("")) {
|
if (path != null && !path.equals("")) { //$NON-NLS-1$
|
||||||
container = project.getFolder(path);
|
container = project.getFolder(path);
|
||||||
} else {
|
} else {
|
||||||
container = project;
|
container = project;
|
||||||
|
@ -236,7 +236,7 @@ public class ProjectTargets {
|
||||||
format.setPreserveSpace(true);
|
format.setPreserveSpace(true);
|
||||||
format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
|
format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$
|
||||||
Serializer serializer =
|
Serializer serializer =
|
||||||
SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(output, "UTF8"), format);
|
SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(output, "UTF8"), format); //$NON-NLS-1$
|
||||||
serializer.asDOMSerializer().serialize(doc);
|
serializer.asDOMSerializer().serialize(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class StreamMonitor extends OutputStream {
|
||||||
console = cos;
|
console = cos;
|
||||||
fTotalWork = totalWork;
|
fTotalWork = totalWork;
|
||||||
halfWay = fTotalWork / 2;
|
halfWay = fTotalWork / 2;
|
||||||
monitor.beginTask("", fTotalWork);
|
monitor.beginTask("", fTotalWork); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
private void progressUpdate() {
|
private void progressUpdate() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class Command extends Directive implements ICommand {
|
||||||
|
|
||||||
final public static char NL = '\n';
|
final public static char NL = '\n';
|
||||||
|
|
||||||
String command = "";
|
String command = ""; //$NON-NLS-1$
|
||||||
char prefix = '\0';
|
char prefix = '\0';
|
||||||
|
|
||||||
public Command(Directive parent, String cmd) {
|
public Command(Directive parent, String cmd) {
|
||||||
|
@ -108,7 +108,7 @@ public class Command extends Directive implements ICommand {
|
||||||
* @see org.eclipse.cdt.make.core.makefile.ICommand#execute(java.lang.String[], java.io.File)
|
* @see org.eclipse.cdt.make.core.makefile.ICommand#execute(java.lang.String[], java.io.File)
|
||||||
*/
|
*/
|
||||||
public Process execute(String shell, String[] envp, File dir) throws IOException {
|
public Process execute(String shell, String[] envp, File dir) throws IOException {
|
||||||
String[] cmdArray = new String[] { shell, "-c", command};
|
String[] cmdArray = new String[] { shell, "-c", command}; //$NON-NLS-1$
|
||||||
return Runtime.getRuntime().exec(cmdArray, envp, dir);
|
return Runtime.getRuntime().exec(cmdArray, envp, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue