mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Fixed NLS and null warnings
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se> Change-Id: I6e40038e99c37a4efc25f64d8d186b00c6f55f8c
This commit is contained in:
parent
718156aa6b
commit
0391d6ccf1
76 changed files with 289 additions and 264 deletions
|
@ -32,8 +32,8 @@ import org.eclipse.core.runtime.Platform;
|
||||||
public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
|
public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
|
||||||
|
|
||||||
private static class VerboseEnvironmentVariable extends EnvironmentVariable implements IBuildEnvironmentVariable {
|
private static class VerboseEnvironmentVariable extends EnvironmentVariable implements IBuildEnvironmentVariable {
|
||||||
private static final String VERBOSE_VAR_NAME = "V";
|
private static final String VERBOSE_VAR_NAME = "V"; //$NON-NLS-1$
|
||||||
private static final String VERBOSE_VAR_VALUE = "1";
|
private static final String VERBOSE_VAR_VALUE = "1"; //$NON-NLS-1$
|
||||||
|
|
||||||
private VerboseEnvironmentVariable(String name, String value, int op, String delimiter) {
|
private VerboseEnvironmentVariable(String name, String value, int op, String delimiter) {
|
||||||
super(name, value, op, delimiter);
|
super(name, value, op, delimiter);
|
||||||
|
|
|
@ -93,6 +93,8 @@ import org.eclipse.remote.core.exception.RemoteConnectionException;
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
|
|
||||||
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
|
public static final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
|
||||||
public static final String MAKEFILE = "Makefile"; //$NON-NLS-1$
|
public static final String MAKEFILE = "Makefile"; //$NON-NLS-1$
|
||||||
public static final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
|
public static final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
|
||||||
|
@ -114,7 +116,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
|
private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
|
||||||
private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
|
private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
|
||||||
private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
|
private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
|
||||||
private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders";
|
private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders"; //$NON-NLS-1$
|
||||||
private static final String TARGET = "buildTarget"; //$NON-NLS-1$
|
private static final String TARGET = "buildTarget"; //$NON-NLS-1$
|
||||||
private static final String DEFAULT_AUTORECONF = "autoreconf"; //$NON-NLS-1$
|
private static final String DEFAULT_AUTORECONF = "autoreconf"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -127,7 +129,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
private IPath buildLocation;
|
private IPath buildLocation;
|
||||||
private String buildDir;
|
private String buildDir;
|
||||||
private String srcDir;
|
private String srcDir;
|
||||||
private String winOSType = "";
|
private String winOSType = EMPTY_STRING;
|
||||||
|
|
||||||
private IConfiguration cfg;
|
private IConfiguration cfg;
|
||||||
private ICConfigurationDescription cdesc;
|
private ICConfigurationDescription cdesc;
|
||||||
|
@ -154,7 +156,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
buildDir = buildDirectory.toString();
|
buildDir = buildDirectory.toString();
|
||||||
srcDir = a.getConfigToolDirectory();
|
srcDir = a.getConfigToolDirectory();
|
||||||
try {
|
try {
|
||||||
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, "", null,
|
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, EMPTY_STRING, null,
|
||||||
IBuildMacroProvider.CONTEXT_CONFIGURATION, c);
|
IBuildMacroProvider.CONTEXT_CONFIGURATION, c);
|
||||||
srcDir = resolved;
|
srcDir = resolved;
|
||||||
} catch (BuildMacroException e) {
|
} catch (BuildMacroException e) {
|
||||||
|
@ -169,7 +171,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
this.cfg = info.getDefaultConfiguration();
|
this.cfg = info.getDefaultConfiguration();
|
||||||
this.builder = cfg.getBuilder();
|
this.builder = cfg.getBuilder();
|
||||||
this.monitor = monitor;
|
this.monitor = monitor;
|
||||||
CUIPlugin.getDefault().getPreferenceStore().getString("dummy");
|
CUIPlugin.getDefault().getPreferenceStore().getString("dummy"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -250,7 +252,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
// Create or get the handle for the build directory
|
// Create or get the handle for the build directory
|
||||||
IPath path = new Path(dirName);
|
IPath path = new Path(dirName);
|
||||||
boolean rc = true;
|
boolean rc = true;
|
||||||
if (dirName.length() == 0 || dirName.equals("."))
|
if (dirName.length() == 0 || dirName.equals(".")) //$NON-NLS-1$
|
||||||
path = getProjectLocation().append(dirName);
|
path = getProjectLocation().append(dirName);
|
||||||
File f = path.toFile();
|
File f = path.toFile();
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
|
@ -297,7 +299,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
Status rc = regenerateMakefiles(icfg, reconfigure);
|
Status rc = regenerateMakefiles(icfg, reconfigure);
|
||||||
if (!rc.isOK()) {
|
if (!rc.isOK()) {
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, "", null);
|
status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, EMPTY_STRING,
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
status.add(rc);
|
status.add(rc);
|
||||||
}
|
}
|
||||||
|
@ -305,14 +308,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
} else {
|
} else {
|
||||||
Status rc = regenerateMakefiles(cfg, reconfigure);
|
Status rc = regenerateMakefiles(cfg, reconfigure);
|
||||||
if (!rc.isOK()) {
|
if (!rc.isOK()) {
|
||||||
if (status == null) {
|
status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, EMPTY_STRING, null);
|
||||||
status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, "", null);
|
|
||||||
}
|
|
||||||
status.add(rc);
|
status.add(rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", null);
|
status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, EMPTY_STRING, null);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +321,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
|
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
|
||||||
MultiStatus status;
|
MultiStatus status;
|
||||||
int rc = IStatus.OK;
|
int rc = IStatus.OK;
|
||||||
String errMsg = "";
|
String errMsg = EMPTY_STRING;
|
||||||
boolean needFullConfigure = false;
|
boolean needFullConfigure = false;
|
||||||
|
|
||||||
// See if the user has cancelled the build
|
// See if the user has cancelled the build
|
||||||
|
@ -645,46 +646,46 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
* @return stripped command
|
* @return stripped command
|
||||||
*/
|
*/
|
||||||
public static String stripEnvVars(String command, List<String> envVars) {
|
public static String stripEnvVars(String command, List<String> envVars) {
|
||||||
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
|
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*"); //$NON-NLS-1$
|
||||||
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
|
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*"); //$NON-NLS-1$
|
||||||
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*");
|
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*"); //$NON-NLS-1$
|
||||||
Pattern p4 = Pattern.compile("\\w+\\s+(\\w+[=]\\\".*?\\\"\\s*)+.*");
|
Pattern p4 = Pattern.compile("\\w+\\s+(\\w+[=]\\\".*?\\\"\\s*)+.*"); //$NON-NLS-1$
|
||||||
Pattern p5 = Pattern.compile("\\w+\\s+(\\w+[=]'.*?'\\s*)+.*");
|
Pattern p5 = Pattern.compile("\\w+\\s+(\\w+[=]'.*?'\\s*)+.*"); //$NON-NLS-1$
|
||||||
Pattern p6 = Pattern.compile("\\w+\\s+(\\w+[=][^\\s]+).*");
|
Pattern p6 = Pattern.compile("\\w+\\s+(\\w+[=][^\\s]+).*"); //$NON-NLS-1$
|
||||||
boolean finished = false;
|
boolean finished = false;
|
||||||
while (!finished) {
|
while (!finished) {
|
||||||
Matcher m1 = p1.matcher(command);
|
Matcher m1 = p1.matcher(command);
|
||||||
if (m1.matches()) {
|
if (m1.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
|
command = command.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m1.group(1).trim();
|
String s = m1.group(1).trim();
|
||||||
envVars.add(s.replaceAll("\\\"", ""));
|
envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m2 = p2.matcher(command);
|
Matcher m2 = p2.matcher(command);
|
||||||
if (m2.matches()) {
|
if (m2.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
|
command = command.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m2.group(1).trim();
|
String s = m2.group(1).trim();
|
||||||
envVars.add(s.replaceAll("'", ""));
|
envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m3 = p3.matcher(command);
|
Matcher m3 = p3.matcher(command);
|
||||||
if (m3.matches()) {
|
if (m3.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=][^\\s]+", "").trim();
|
command = command.replaceFirst("\\w+[=][^\\s]+", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
envVars.add(m3.group(1).trim());
|
envVars.add(m3.group(1).trim());
|
||||||
} else {
|
} else {
|
||||||
Matcher m4 = p4.matcher(command);
|
Matcher m4 = p4.matcher(command);
|
||||||
if (m4.matches()) {
|
if (m4.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
|
command = command.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m4.group(1).trim();
|
String s = m4.group(1).trim();
|
||||||
envVars.add(s.replaceAll("\\\"", ""));
|
envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m5 = p5.matcher(command);
|
Matcher m5 = p5.matcher(command);
|
||||||
if (m5.matches()) {
|
if (m5.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
|
command = command.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m5.group(1).trim();
|
String s = m5.group(1).trim();
|
||||||
envVars.add(s.replaceAll("'", ""));
|
envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m6 = p6.matcher(command);
|
Matcher m6 = p6.matcher(command);
|
||||||
if (m6.matches()) {
|
if (m6.matches()) {
|
||||||
command = command.replaceFirst("\\w+[=][^\\s+]+", "").trim();
|
command = command.replaceFirst("\\w+[=][^\\s+]+", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
envVars.add(m6.group(1).trim());
|
envVars.add(m6.group(1).trim());
|
||||||
} else {
|
} else {
|
||||||
finished = true;
|
finished = true;
|
||||||
|
@ -707,26 +708,26 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
* @return stripped option
|
* @return stripped option
|
||||||
*/
|
*/
|
||||||
public static String stripEnvVarsFromOption(String str, List<String> envVars) {
|
public static String stripEnvVarsFromOption(String str, List<String> envVars) {
|
||||||
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*");
|
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*"); //$NON-NLS-1$
|
||||||
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*");
|
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*"); //$NON-NLS-1$
|
||||||
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*");
|
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*"); //$NON-NLS-1$
|
||||||
boolean finished = false;
|
boolean finished = false;
|
||||||
while (!finished) {
|
while (!finished) {
|
||||||
Matcher m1 = p1.matcher(str);
|
Matcher m1 = p1.matcher(str);
|
||||||
if (m1.matches()) {
|
if (m1.matches()) {
|
||||||
str = str.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
|
str = str.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m1.group(1).trim();
|
String s = m1.group(1).trim();
|
||||||
envVars.add(s.replaceAll("\\\"", ""));
|
envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m2 = p2.matcher(str);
|
Matcher m2 = p2.matcher(str);
|
||||||
if (m2.matches()) {
|
if (m2.matches()) {
|
||||||
str = str.replaceFirst("\\w+[=]'.*?'", "").trim();
|
str = str.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
String s = m2.group(1).trim();
|
String s = m2.group(1).trim();
|
||||||
envVars.add(s.replaceAll("'", ""));
|
envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
Matcher m3 = p3.matcher(str);
|
Matcher m3 = p3.matcher(str);
|
||||||
if (m3.matches()) {
|
if (m3.matches()) {
|
||||||
str = str.replaceFirst("\\w+[=][^\\s]+", "").trim();
|
str = str.replaceFirst("\\w+[=][^\\s]+", EMPTY_STRING).trim(); //$NON-NLS-1$
|
||||||
envVars.add(m3.group(1).trim());
|
envVars.add(m3.group(1).trim());
|
||||||
} else {
|
} else {
|
||||||
finished = true;
|
finished = true;
|
||||||
|
@ -766,7 +767,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
if (configOption != null)
|
if (configOption != null)
|
||||||
command = stripEnvVars(configOption.getValue().trim(), envVars);
|
command = stripEnvVars(configOption.getValue().trim(), envVars);
|
||||||
|
|
||||||
String[] tokens = command.split("\\s");
|
String[] tokens = command.split("\\s"); //$NON-NLS-1$
|
||||||
if (tokens.length > 1) {
|
if (tokens.length > 1) {
|
||||||
command = tokens[0];
|
command = tokens[0];
|
||||||
for (int i = 1; i < tokens.length; ++i)
|
for (int i = 1; i < tokens.length; ++i)
|
||||||
|
@ -798,7 +799,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
if (autogenOption != null)
|
if (autogenOption != null)
|
||||||
command = stripEnvVars(autogenOption.getValue().trim(), envVars);
|
command = stripEnvVars(autogenOption.getValue().trim(), envVars);
|
||||||
|
|
||||||
String[] tokens = command.split("\\s");
|
String[] tokens = command.split("\\s"); //$NON-NLS-1$
|
||||||
if (tokens.length > 1) {
|
if (tokens.length > 1) {
|
||||||
command = tokens[0];
|
command = tokens[0];
|
||||||
for (int i = 1; i < tokens.length; ++i)
|
for (int i = 1; i < tokens.length; ++i)
|
||||||
|
@ -840,8 +841,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
// try to resolve the build macros in any argument
|
// try to resolve the build macros in any argument
|
||||||
try {
|
try {
|
||||||
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
|
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
|
||||||
configTargets[i], "", //$NON-NLS-1$
|
configTargets[i], EMPTY_STRING, " ", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
|
||||||
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
|
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
|
||||||
configTargets[i] = resolved;
|
configTargets[i] = resolved;
|
||||||
} catch (BuildMacroException e) {
|
} catch (BuildMacroException e) {
|
||||||
|
@ -1062,10 +1062,10 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
private String getPathString(IPath path) {
|
private String getPathString(IPath path) {
|
||||||
String s = path.toString();
|
String s = path.toString();
|
||||||
if (getOSName().equals(Platform.OS_WIN32)) {
|
if (getOSName().equals(Platform.OS_WIN32)) {
|
||||||
if (getWinOSType().equals("cygwin")) {
|
if (getWinOSType().equals("cygwin")) { //$NON-NLS-1$
|
||||||
s = s.replaceAll("^([a-zA-Z]):", "/cygdrive/$1");
|
s = s.replaceAll("^([a-zA-Z]):", "/cygdrive/$1"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
} else {
|
} else {
|
||||||
s = s.replaceAll("^([a-zA-Z]):", "/$1");
|
s = s.replaceAll("^([a-zA-Z]):", "/$1"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
|
@ -1073,9 +1073,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
|
|
||||||
// Fix any escape characters in sh -c command arguments
|
// Fix any escape characters in sh -c command arguments
|
||||||
private String fixEscapeChars(String s) {
|
private String fixEscapeChars(String s) {
|
||||||
s = s.replaceAll("\\\\", "\\\\\\\\");
|
s = s.replaceAll("\\\\", "\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
s = s.replaceAll("\\(", "\\\\(");
|
s = s.replaceAll("\\(", "\\\\("); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
s = s.replaceAll("\\)", "\\\\)");
|
s = s.replaceAll("\\)", "\\\\)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1116,16 +1116,15 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
if (command == null)
|
if (command == null)
|
||||||
command = arg;
|
command = arg;
|
||||||
else
|
else
|
||||||
command += " " + arg;
|
command += " " + arg; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
configTargets = new String[] { "-c", command };
|
configTargets = new String[] { "-c", command }; //$NON-NLS-1$
|
||||||
|
|
||||||
for (int i = 0; i < configTargets.length; ++i) {
|
for (int i = 0; i < configTargets.length; ++i) {
|
||||||
// try to resolve the build macros in any argument
|
// try to resolve the build macros in any argument
|
||||||
try {
|
try {
|
||||||
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
|
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
|
||||||
configTargets[i], "", //$NON-NLS-1$
|
configTargets[i], EMPTY_STRING, " ", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
|
||||||
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
|
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
|
||||||
// strip any env-var settings from options
|
// strip any env-var settings from options
|
||||||
// fix for bug #356278
|
// fix for bug #356278
|
||||||
|
@ -1161,12 +1160,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
// Display command-line environment variables that have been stripped by us
|
// Display command-line environment variables that have been stripped by us
|
||||||
// because launch showCommand won't do this.
|
// because launch showCommand won't do this.
|
||||||
if (additionalEnvs != null && additionalEnvs.size() > 0) {
|
if (additionalEnvs != null && additionalEnvs.size() > 0) {
|
||||||
buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.commandline.envvars"));
|
buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.commandline.envvars")); //$NON-NLS-1$
|
||||||
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
buf.append("\t");
|
buf.append("\t"); //$NON-NLS-1$
|
||||||
for (int i = 0; i < additionalEnvs.size(); ++i) {
|
for (int i = 0; i < additionalEnvs.size(); ++i) {
|
||||||
String envvar = additionalEnvs.get(i);
|
String envvar = additionalEnvs.get(i);
|
||||||
buf.append(envvar.replaceFirst("(\\w+=)(.*)", " $1\"$2\""));
|
buf.append(envvar.replaceFirst("(\\w+=)(.*)", " $1\"$2\"")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -1474,7 +1473,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||||
Class<? extends IMakeTargetManager> c = makeTargetManager.getClass();
|
Class<? extends IMakeTargetManager> c = makeTargetManager.getClass();
|
||||||
boolean targetsAdded = false;
|
boolean targetsAdded = false;
|
||||||
try {
|
try {
|
||||||
Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class);
|
Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class); //$NON-NLS-1$
|
||||||
m.invoke(makeTargetManager, project, makeTargetArray);
|
m.invoke(makeTargetManager, project, makeTargetArray);
|
||||||
targetsAdded = true;
|
targetsAdded = true;
|
||||||
} catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException
|
} catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException
|
||||||
|
|
|
@ -37,12 +37,13 @@ public class AutotoolsPropertyConstants {
|
||||||
public static final QualifiedName LIBTOOLIZE_TOOL = new QualifiedName(PREFIX, "LibtoolizePath"); //$NON-NLS-1$
|
public static final QualifiedName LIBTOOLIZE_TOOL = new QualifiedName(PREFIX, "LibtoolizePath"); //$NON-NLS-1$
|
||||||
public static final QualifiedName CLEAN_DELETE = new QualifiedName(PREFIX, "CleanDelete"); //$NON-NLS-1$
|
public static final QualifiedName CLEAN_DELETE = new QualifiedName(PREFIX, "CleanDelete"); //$NON-NLS-1$
|
||||||
public static final QualifiedName CLEAN_MAKE_TARGET = new QualifiedName(PREFIX, "CleanMakeTarget"); //$NON-NLS-1$
|
public static final QualifiedName CLEAN_MAKE_TARGET = new QualifiedName(PREFIX, "CleanMakeTarget"); //$NON-NLS-1$
|
||||||
public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW");
|
public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW"); //$NON-NLS-1$
|
||||||
public static final QualifiedName AUTO_BUILD_NAME = new QualifiedName(PREFIX, "AutoBuildName"); //$NON-NLS-1$
|
public static final QualifiedName AUTO_BUILD_NAME = new QualifiedName(PREFIX, "AutoBuildName"); //$NON-NLS-1$
|
||||||
public static final QualifiedName OPEN_INCLUDE = new QualifiedName(PREFIX, "IncludeResourceMapping"); //$NON-NLS-1$
|
public static final QualifiedName OPEN_INCLUDE = new QualifiedName(PREFIX, "IncludeResourceMapping"); //$NON-NLS-1$
|
||||||
public static final QualifiedName OPEN_INCLUDE_P = new QualifiedName(PREFIX, "PersistentIncludeResourceMapping"); //$NON-NLS-1$
|
public static final QualifiedName OPEN_INCLUDE_P = new QualifiedName(PREFIX, "PersistentIncludeResourceMapping"); //$NON-NLS-1$
|
||||||
public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); // $NON-NLSp-1$
|
public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public static final String[] fACVersions = { "2.13", "2.59", "2.61", "2.67", "2.68" }; //$NON-NLS-1$
|
public static final String[] fACVersions = { "2.13", "2.59", "2.61", "2.67", "2.68" }; //$NON-NLS-1$
|
||||||
public static final String AC_VERSION_2_13 = fACVersions[0];
|
public static final String AC_VERSION_2_13 = fACVersions[0];
|
||||||
public static final String AC_VERSION_2_59 = fACVersions[1];
|
public static final String AC_VERSION_2_59 = fACVersions[1];
|
||||||
|
@ -51,6 +52,7 @@ public class AutotoolsPropertyConstants {
|
||||||
public static final String AC_VERSION_2_68 = fACVersions[4];
|
public static final String AC_VERSION_2_68 = fACVersions[4];
|
||||||
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
|
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public static final String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" }; //$NON-NLS-1$
|
public static final String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" }; //$NON-NLS-1$
|
||||||
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
|
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
|
||||||
if (marker != null) {
|
if (marker != null) {
|
||||||
// Check to see if addProblemMarker exists.
|
// Check to see if addProblemMarker exists.
|
||||||
try {
|
try {
|
||||||
Method method = eoParser.getClass().getMethod("addProblemMarker", ProblemMarkerInfo.class);
|
Method method = eoParser.getClass().getMethod("addProblemMarker", ProblemMarkerInfo.class); //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
method.invoke(eoParser, marker);
|
method.invoke(eoParser, marker);
|
||||||
return true;
|
return true;
|
||||||
|
@ -145,7 +145,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
|
||||||
int lineNumber = getErrorConfigLineNumber(name);
|
int lineNumber = getErrorConfigLineNumber(name);
|
||||||
|
|
||||||
// now open configure file.
|
// now open configure file.
|
||||||
File file = new File(sourcePath + "/configure");
|
File file = new File(sourcePath + "/configure"); //$NON-NLS-1$
|
||||||
// If the log file is not present there is nothing we can do.
|
// If the log file is not present there is nothing we can do.
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
return null;
|
return null;
|
||||||
|
@ -166,13 +166,13 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
|
||||||
Matcher m = errorPattern.matcher(line);
|
Matcher m = errorPattern.matcher(line);
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
String typeString = m.group(1);
|
String typeString = m.group(1);
|
||||||
if (typeString.equals("prog"))
|
if (typeString.equals("prog")) //$NON-NLS-1$
|
||||||
return AutotoolsProblemMarkerInfo.Type.PROG;
|
return AutotoolsProblemMarkerInfo.Type.PROG;
|
||||||
if (typeString.equals("header"))
|
if (typeString.equals("header")) //$NON-NLS-1$
|
||||||
return AutotoolsProblemMarkerInfo.Type.HEADER;
|
return AutotoolsProblemMarkerInfo.Type.HEADER;
|
||||||
if (typeString.equals("file"))
|
if (typeString.equals("file")) //$NON-NLS-1$
|
||||||
return AutotoolsProblemMarkerInfo.Type.FILE;
|
return AutotoolsProblemMarkerInfo.Type.FILE;
|
||||||
if (typeString.equals("lib"))
|
if (typeString.equals("lib")) //$NON-NLS-1$
|
||||||
return AutotoolsProblemMarkerInfo.Type.LIB;
|
return AutotoolsProblemMarkerInfo.Type.LIB;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -194,7 +194,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int getErrorConfigLineNumber(String name) {
|
private int getErrorConfigLineNumber(String name) {
|
||||||
File file = new File(buildDir + "/config.log");
|
File file = new File(buildDir + "/config.log"); //$NON-NLS-1$
|
||||||
// If the log file is not present there is nothing we can do.
|
// If the log file is not present there is nothing we can do.
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
||||||
|
|
||||||
public PkgconfigErrorResolution(String pkgconfigRequirement) {
|
public PkgconfigErrorResolution(String pkgconfigRequirement) {
|
||||||
// Get the pkgconfig package name from the requirement message.
|
// Get the pkgconfig package name from the requirement message.
|
||||||
Pattern p = Pattern.compile("(.*?)[\\s,>,<,=].*");
|
Pattern p = Pattern.compile("(.*?)[\\s,>,<,=].*"); //$NON-NLS-1$
|
||||||
Matcher m = p.matcher(pkgconfigRequirement);
|
Matcher m = p.matcher(pkgconfigRequirement);
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
pkgName = m.group(1);
|
pkgName = m.group(1);
|
||||||
|
@ -98,7 +98,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
||||||
// Use CDT launcher to run rpm to query the package that provides
|
// Use CDT launcher to run rpm to query the package that provides
|
||||||
// the pkgconfig .pc file for the package in question.
|
// the pkgconfig .pc file for the package in question.
|
||||||
ConsoleOutputStream output = new ConsoleOutputStream();
|
ConsoleOutputStream output = new ConsoleOutputStream();
|
||||||
Process proc = launcher.execute(commandPath, commandArgs, null, new Path("."), new NullProgressMonitor());
|
Process proc = launcher.execute(commandPath, commandArgs, null, new Path("."), new NullProgressMonitor()); //$NON-NLS-1$
|
||||||
if (proc != null) {
|
if (proc != null) {
|
||||||
try {
|
try {
|
||||||
// Close the input of the process since we will never write to
|
// Close the input of the process since we will never write to
|
||||||
|
@ -111,7 +111,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
||||||
} else {
|
} else {
|
||||||
String result = output.readBuffer();
|
String result = output.readBuffer();
|
||||||
if (!result.startsWith("error:")) //$NON-NLS-1$
|
if (!result.startsWith("error:")) //$NON-NLS-1$
|
||||||
System.out.println("need to execute update of " + result);
|
System.out.println("need to execute update of " + result); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ public class VersionComparator {
|
||||||
* VersionComparator.compare("1.5.1", "1.5.1") returns 0
|
* VersionComparator.compare("1.5.1", "1.5.1") returns 0
|
||||||
*/
|
*/
|
||||||
public static int compare(String v1, String v2) {
|
public static int compare(String v1, String v2) {
|
||||||
String[] v1digits = v1.split("\\.");
|
String[] v1digits = v1.split("\\."); //$NON-NLS-1$
|
||||||
String[] v2digits = v2.split("\\.");
|
String[] v2digits = v2.split("\\."); //$NON-NLS-1$
|
||||||
|
|
||||||
for (int i = 0; i < v1digits.length && i < v2digits.length; i++) {
|
for (int i = 0; i < v1digits.length && i < v2digits.length; i++) {
|
||||||
int d1 = Integer.valueOf(v1digits[i]);
|
int d1 = Integer.valueOf(v1digits[i]);
|
||||||
|
|
|
@ -64,7 +64,7 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getParameterName() {
|
public String getParameterName() {
|
||||||
return "--" + getName();
|
return "--" + getName(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -133,11 +133,11 @@ public class AutotoolsConfiguration implements IAConfiguration {
|
||||||
IConfigureOption.BIN),
|
IConfigureOption.BIN),
|
||||||
new Option(AutotoolsOptionConstants.FLAG_CFLAGS, "cflags", AutotoolsOptionConstants.FLAG_CFLAGS_FLAGS, //$NON-NLS-1$
|
new Option(AutotoolsOptionConstants.FLAG_CFLAGS, "cflags", AutotoolsOptionConstants.FLAG_CFLAGS_FLAGS, //$NON-NLS-1$
|
||||||
IConfigureOption.FLAG),
|
IConfigureOption.FLAG),
|
||||||
new Option(AutotoolsOptionConstants.OPT_CFLAGS_DEBUG, "cflags_debug", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
|
new Option(AutotoolsOptionConstants.OPT_CFLAGS_DEBUG, "cflags_debug", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
|
||||||
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GPROF, "cflags_gprof", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
|
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GPROF, "cflags_gprof", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
|
||||||
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GCOV, "cflags_gcov", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
|
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GCOV, "cflags_gcov", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
|
||||||
new Option(AutotoolsOptionConstants.OPT_USER, IConfigureOption.MULTIARG),
|
new Option(AutotoolsOptionConstants.OPT_USER, IConfigureOption.MULTIARG),
|
||||||
new Option(AutotoolsOptionConstants.TOOL_AUTOGEN, "autogen", "autogen.sh", IConfigureOption.TOOL), //$NON-NLS-1$
|
new Option(AutotoolsOptionConstants.TOOL_AUTOGEN, "autogen", "autogen.sh", IConfigureOption.TOOL), //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
new Option(AutotoolsOptionConstants.CATEGORY_OPTIONS, IConfigureOption.CATEGORY),
|
new Option(AutotoolsOptionConstants.CATEGORY_OPTIONS, IConfigureOption.CATEGORY),
|
||||||
new Option(AutotoolsOptionConstants.OPT_AUTOGENOPTS, IConfigureOption.MULTIARG), };
|
new Option(AutotoolsOptionConstants.OPT_AUTOGENOPTS, IConfigureOption.MULTIARG), };
|
||||||
|
|
||||||
|
@ -406,12 +406,12 @@ public class AutotoolsConfiguration implements IAConfiguration {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConfigToolDirectory(String configToolDirectory) {
|
public void setConfigToolDirectory(String configToolDirectory) {
|
||||||
setOption("configdir", configToolDirectory);
|
setOption("configdir", configToolDirectory); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getConfigToolDirectory() {
|
public String getConfigToolDirectory() {
|
||||||
IConfigureOption option = configOptions.get("configdir");
|
IConfigureOption option = configOptions.get("configdir"); //$NON-NLS-1$
|
||||||
return option.getValue();
|
return option.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -417,19 +417,19 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
||||||
String childName = children.get(k);
|
String childName = children.get(k);
|
||||||
IConfigureOption childopt = cfg.getOption(childName);
|
IConfigureOption childopt = cfg.getOption(childName);
|
||||||
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
|
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
+ xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-3$
|
+ xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
p.println("</flag>"); //$NON-NLS-1$
|
p.println("</flag>"); //$NON-NLS-1$
|
||||||
} else if (!opt.isCategory() && !opt.isFlagValue())
|
} else if (!opt.isCategory() && !opt.isFlagValue())
|
||||||
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
|
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
+ "\"/>"); //$NON-NLS-3$
|
+ "\"/>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
p.println("</configuration>"); //$NON-NLS-1$
|
p.println("</configuration>"); //$NON-NLS-1$
|
||||||
// Sync name field as this configuration is now
|
// Sync name field as this configuration is now
|
||||||
// officially saved
|
// officially saved
|
||||||
syncNameField(cfgd);
|
syncNameField(cfgd);
|
||||||
}
|
}
|
||||||
p.println("</configurations>");
|
p.println("</configurations>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -503,7 +503,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
||||||
p.println("</configuration>"); //$NON-NLS-1$
|
p.println("</configuration>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.println("</configurations>");
|
p.println("</configurations>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -602,7 +602,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
||||||
|
|
||||||
private String createDummyId() {
|
private String createDummyId() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
String id = "TEMP_" + rand.nextInt();
|
String id = "TEMP_" + rand.nextInt(); //$NON-NLS-1$
|
||||||
if (tmpConfigs.get(id) == null)
|
if (tmpConfigs.get(id) == null)
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler imple
|
||||||
// SortedSet<Integer> nums = new TreeSet<Integer>();
|
// SortedSet<Integer> nums = new TreeSet<Integer>();
|
||||||
IConfiguration configuration = (IConfiguration) buildObject;
|
IConfiguration configuration = (IConfiguration) buildObject;
|
||||||
ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration);
|
ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration);
|
||||||
if (option.getName().equals("Name") && cfgd != null) {
|
if (option.getName().equals("Name") && cfgd != null) { //$NON-NLS-1$
|
||||||
String cfgId = cfgd.getId();
|
String cfgId = cfgd.getId();
|
||||||
if (!value.isEmpty() && !value.equals(cfgId)) {
|
if (!value.isEmpty() && !value.equals(cfgId)) {
|
||||||
// we have a cloned configuration and we know that the
|
// we have a cloned configuration and we know that the
|
||||||
|
@ -95,7 +95,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler imple
|
||||||
|
|
||||||
private String fixName(String cfgName) {
|
private String fixName(String cfgName) {
|
||||||
// Replace whitespace with underscores.
|
// Replace whitespace with underscores.
|
||||||
return cfgName.replaceAll("\\s", "_");
|
return cfgName.replaceAll("\\s", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
// IOptionApplicability methods
|
// IOptionApplicability methods
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class ConfigureMessages {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getConfigureDescription(String name) {
|
public static String getConfigureDescription(String name) {
|
||||||
return getString("Option.configure." + name); //$NON-NLS-11$
|
return getString("Option.configure." + name); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getConfigureTip(String name) {
|
public static String getConfigureTip(String name) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ConfigureOptionCategory implements IConfigureOption {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getParameter() {
|
public String getParameter() {
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,12 +50,12 @@ public class ConfigureOptionCategory implements IConfigureOption {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getToolTip() {
|
public String getToolTip() {
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return "null";
|
return "null"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
|
||||||
StringBuilder parms = new StringBuilder();
|
StringBuilder parms = new StringBuilder();
|
||||||
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
|
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
|
||||||
String[] flagNames = getValue().split("\\|"); //$NON-NLS-1$
|
String[] flagNames = getValue().split("\\|"); //$NON-NLS-1$
|
||||||
String flagSeparator = "";
|
String flagSeparator = ""; //$NON-NLS-1$
|
||||||
for (String flagName : flagNames) {
|
for (String flagName : flagNames) {
|
||||||
parms.append(flagSeparator);
|
parms.append(flagSeparator);
|
||||||
flagSeparator = " "; //$NON-NLS-1$
|
flagSeparator = " "; //$NON-NLS-1$
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class FlagValueConfigureOption extends BinConfigureOption implements IFla
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getParameter() {
|
public String getParameter() {
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class InternalConfigureOption extends AbstractConfigurationOption {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getParameter() {
|
public String getParameter() {
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class StringConfigureOption extends AbstractConfigurationOption {
|
||||||
public String getParameter() {
|
public String getParameter() {
|
||||||
if (isParmSet())
|
if (isParmSet())
|
||||||
return getParameterName() + "=" + getValue(); //$NON-NLS-1$
|
return getParameterName() + "=" + getValue(); //$NON-NLS-1$
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.cdt.internal.autotools.core.VersionComparator;
|
||||||
|
|
||||||
public class AcInitElement extends AutoconfMacroElement {
|
public class AcInitElement extends AutoconfMacroElement {
|
||||||
|
|
||||||
private static final String BAD_VERSION_NUMBER = "AC_INIT_badVersionNumber";
|
private static final String BAD_VERSION_NUMBER = "AC_INIT_badVersionNumber"; //$NON-NLS-1$
|
||||||
|
|
||||||
public AcInitElement(String name) {
|
public AcInitElement(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
@ -56,7 +56,7 @@ public class AcInitElement extends AutoconfMacroElement {
|
||||||
AutoconfElement argument = this.getChildren()[1];
|
AutoconfElement argument = this.getChildren()[1];
|
||||||
// match a digit followed by a dot zero or more times
|
// match a digit followed by a dot zero or more times
|
||||||
// but always end with a digit
|
// but always end with a digit
|
||||||
if (!argument.getName().matches("(\\d*\\.)*((\\d+))")) {
|
if (!argument.getName().matches("(\\d*\\.)*((\\d+))")) { //$NON-NLS-1$
|
||||||
throw new InvalidMacroException(AutoconfEditorMessages.getString(BAD_VERSION_NUMBER), argument);
|
throw new InvalidMacroException(AutoconfEditorMessages.getString(BAD_VERSION_NUMBER), argument);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class AutoconfCodeScanner extends RuleBasedScanner {
|
||||||
rules.add(new AutoconfIdentifierRule(other));
|
rules.add(new AutoconfIdentifierRule(other));
|
||||||
|
|
||||||
// Make sure we don't treat "\#" as comment start.
|
// Make sure we don't treat "\#" as comment start.
|
||||||
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
|
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
|
||||||
|
|
||||||
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
|
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,8 @@ public class AutoconfMacroCodeScanner extends RuleBasedScanner {
|
||||||
List<IRule> rules = new ArrayList<>();
|
List<IRule> rules = new ArrayList<>();
|
||||||
|
|
||||||
// Add rule for single line comments.
|
// Add rule for single line comments.
|
||||||
rules.add(new RestrictedEndOfLineRule("dnl", "[]", comment)); //$NON-NLS-1$
|
rules.add(new RestrictedEndOfLineRule("dnl", "[]", comment)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
rules.add(new RestrictedEndOfLineRule("#", "[]", comment, '\\')); //$NON-NLS-1$
|
rules.add(new RestrictedEndOfLineRule("#", "[]", comment, '\\')); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
// Add special recursive rule for strings which allows variable
|
// Add special recursive rule for strings which allows variable
|
||||||
// references to be internally tokenized.
|
// references to be internally tokenized.
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class AutoconfPartitionScanner extends RuleBasedPartitionScanner {
|
||||||
rules.add(new AutoconfMacroPartitionRule(macro));
|
rules.add(new AutoconfMacroPartitionRule(macro));
|
||||||
|
|
||||||
rules.add(new EndOfLineRule("dnl", comment)); //$NON-NLS-1$
|
rules.add(new EndOfLineRule("dnl", comment)); //$NON-NLS-1$
|
||||||
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
|
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
|
||||||
rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
|
rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
|
||||||
|
|
||||||
// We want to process identifiers that might have macro
|
// We want to process identifiers that might have macro
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class InlineDataRule implements IRule {
|
||||||
/** Buffer used for pattern detection */
|
/** Buffer used for pattern detection */
|
||||||
private StringBuilder fBuffer = new StringBuilder();
|
private StringBuilder fBuffer = new StringBuilder();
|
||||||
|
|
||||||
private String fStartingSequence = "<<";
|
private String fStartingSequence = "<<"; //$NON-NLS-1$
|
||||||
|
|
||||||
public InlineDataRule(IToken inToken) {
|
public InlineDataRule(IToken inToken) {
|
||||||
token = inToken;
|
token = inToken;
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class AutoconfContentProvider implements ITreeContentProvider {
|
||||||
|
|
||||||
private IDocumentProvider documentProvider;
|
private IDocumentProvider documentProvider;
|
||||||
private AutoconfEditor editor;
|
private AutoconfEditor editor;
|
||||||
protected final static String SECTION_POSITIONS = "section_positions";
|
protected final static String SECTION_POSITIONS = "section_positions"; //$NON-NLS-1$
|
||||||
protected IPositionUpdater positionUpdater = new DefaultPositionUpdater(SECTION_POSITIONS);
|
protected IPositionUpdater positionUpdater = new DefaultPositionUpdater(SECTION_POSITIONS);
|
||||||
|
|
||||||
public AutoconfContentProvider(ITextEditor editor) {
|
public AutoconfContentProvider(ITextEditor editor) {
|
||||||
|
|
|
@ -88,21 +88,21 @@ public class AutoconfLabelProvider implements ILabelProvider {
|
||||||
String result;
|
String result;
|
||||||
String name = e.getName();
|
String name = e.getName();
|
||||||
if (name.length() > 31)
|
if (name.length() > 31)
|
||||||
name = name.substring(0, 31) + "...";
|
name = name.substring(0, 31) + "..."; //$NON-NLS-1$
|
||||||
String var = e.getVar();
|
String var = e.getVar();
|
||||||
if (var != null) {
|
if (var != null) {
|
||||||
if (var.length() > 15)
|
if (var.length() > 15)
|
||||||
var = var.substring(0, 15) + "...";
|
var = var.substring(0, 15) + "..."; //$NON-NLS-1$
|
||||||
var = " " + var; //$NON-NLS-1$
|
var = " " + var; //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
var = "";
|
var = ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
result = (name + var).replaceAll("(\r|\n| |\t|\f)+", " ");
|
result = (name + var).replaceAll("(\r|\n| |\t|\f)+", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
return result;
|
return result;
|
||||||
} else if (element instanceof String) {
|
} else if (element instanceof String) {
|
||||||
return (String) element;
|
return (String) element;
|
||||||
}
|
}
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ package org.eclipse.cdt.autotools.ui.editors.parser;
|
||||||
public class AutoconfCaseConditionElement extends AutoconfElement {
|
public class AutoconfCaseConditionElement extends AutoconfElement {
|
||||||
|
|
||||||
public AutoconfCaseConditionElement() {
|
public AutoconfCaseConditionElement() {
|
||||||
super("");
|
super(""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutoconfCaseConditionElement(String name) {
|
public AutoconfCaseConditionElement(String name) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ package org.eclipse.cdt.autotools.ui.editors.parser;
|
||||||
public class AutoconfMacroArgumentElement extends AutoconfElement {
|
public class AutoconfMacroArgumentElement extends AutoconfElement {
|
||||||
|
|
||||||
public AutoconfMacroArgumentElement() {
|
public AutoconfMacroArgumentElement() {
|
||||||
super(""); // //$NON-NLS-N$
|
super(""); // //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutoconfMacroArgumentElement(String name) {
|
public AutoconfMacroArgumentElement(String name) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class AutoconfOutlineErrorHandler {
|
||||||
try {
|
try {
|
||||||
IPath absPath = input.getStorage().getFullPath();
|
IPath absPath = input.getStorage().getFullPath();
|
||||||
IPath rootPath = root.getLocation();
|
IPath rootPath = root.getLocation();
|
||||||
IPath relPath = new Path("");
|
IPath relPath = new Path(""); //$NON-NLS-1$
|
||||||
|
|
||||||
for (int i = 0; i < rootPath.segmentCount(); ++i) {
|
for (int i = 0; i < rootPath.segmentCount(); ++i) {
|
||||||
relPath = relPath.append("../"); //$NON-NLS-1$
|
relPath = relPath.append("../"); //$NON-NLS-1$
|
||||||
|
|
|
@ -56,7 +56,8 @@ public class AutoconfParser {
|
||||||
private AutoconfTokenizer tokenizer;
|
private AutoconfTokenizer tokenizer;
|
||||||
private IAutoconfMacroDetector macroDetector;
|
private IAutoconfMacroDetector macroDetector;
|
||||||
|
|
||||||
private static final String M4_BUILTINS = "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond " //$NON-NLS-1$
|
@SuppressWarnings("nls")
|
||||||
|
private static final String M4_BUILTINS = "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond "
|
||||||
+ "dumpdef traceon traceoff debugmode debugfile dnl changequote changecom changeword " + "m4wrap "
|
+ "dumpdef traceon traceoff debugmode debugfile dnl changequote changecom changeword " + "m4wrap "
|
||||||
+ "include sinclude divert undivert divnum len index regexp substr translit patsubst "
|
+ "include sinclude divert undivert divnum len index regexp substr translit patsubst "
|
||||||
+ "format incr decr eval syscmd esyscmd sysval mkstemp maketemp errprint m4exit "
|
+ "format incr decr eval syscmd esyscmd sysval mkstemp maketemp errprint m4exit "
|
||||||
|
@ -240,9 +241,9 @@ public class AutoconfParser {
|
||||||
} else {
|
} else {
|
||||||
String exp;
|
String exp;
|
||||||
if (block instanceof AutoconfIfElement || block instanceof AutoconfElifElement)
|
if (block instanceof AutoconfIfElement || block instanceof AutoconfElifElement)
|
||||||
exp = "then";
|
exp = "then"; //$NON-NLS-1$
|
||||||
else
|
else
|
||||||
exp = "do";
|
exp = "do"; //$NON-NLS-1$
|
||||||
|
|
||||||
handleError(token, AutoconfEditorMessages.getFormattedString(MISSING_SPECIFIER, exp));
|
handleError(token, AutoconfEditorMessages.getFormattedString(MISSING_SPECIFIER, exp));
|
||||||
|
|
||||||
|
@ -606,6 +607,7 @@ public class AutoconfParser {
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
// 5. Abort on unexpected tokens
|
// 5. Abort on unexpected tokens
|
||||||
|
//$FALL-THROUGH$
|
||||||
case ITokenConstants.SH_DO:
|
case ITokenConstants.SH_DO:
|
||||||
case ITokenConstants.SH_THEN:
|
case ITokenConstants.SH_THEN:
|
||||||
handleError(token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
|
handleError(token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
|
||||||
|
@ -863,11 +865,11 @@ public class AutoconfParser {
|
||||||
|
|
||||||
private void validateMacroParameterCount(AutoconfMacroElement macro, Token token, int count) {
|
private void validateMacroParameterCount(AutoconfMacroElement macro, Token token, int count) {
|
||||||
if (macro.getParameterCount() < count) {
|
if (macro.getParameterCount() < count) {
|
||||||
handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(),
|
handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(), //$NON-NLS-1$
|
||||||
Integer.valueOf(2))); //$NON-NLS-1$
|
Integer.valueOf(2)));
|
||||||
} else if (macro.getParameterCount() > count) {
|
} else if (macro.getParameterCount() > count) {
|
||||||
handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(),
|
handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(), //$NON-NLS-1$
|
||||||
Integer.valueOf(2))); //$NON-NLS-1$
|
Integer.valueOf(2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class AutoconfTokenizer {
|
||||||
this.chars = document.get().toCharArray();
|
this.chars = document.get().toCharArray();
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
|
|
||||||
this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0);
|
this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0); //$NON-NLS-1$
|
||||||
|
|
||||||
this.m4OpenQuote = "`"; //$NON-NLS-1$
|
this.m4OpenQuote = "`"; //$NON-NLS-1$
|
||||||
this.m4CloseQuote = "'"; //$NON-NLS-1$
|
this.m4CloseQuote = "'"; //$NON-NLS-1$
|
||||||
|
@ -179,7 +179,7 @@ public class AutoconfTokenizer {
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_CLOSE_COMMENT,
|
handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_CLOSE_COMMENT,
|
||||||
m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$
|
m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
return makeToken(ITokenConstants.M4_COMMENT);
|
return makeToken(ITokenConstants.M4_COMMENT);
|
||||||
}
|
}
|
||||||
|
@ -270,35 +270,39 @@ public class AutoconfTokenizer {
|
||||||
String text = buffer.toString();
|
String text = buffer.toString();
|
||||||
|
|
||||||
if (!isM4Context) {
|
if (!isM4Context) {
|
||||||
// detect sh tokens
|
if (text != null) {
|
||||||
if ("case".equals(text))
|
// detect sh tokens
|
||||||
return makeToken(ITokenConstants.SH_CASE, text);
|
switch (text) {
|
||||||
if ("in".equals(text))
|
case "case": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_IN, text);
|
return makeToken(ITokenConstants.SH_CASE, text);
|
||||||
if ("esac".equals(text))
|
case "in": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_ESAC, text);
|
return makeToken(ITokenConstants.SH_IN, text);
|
||||||
if ("while".equals(text))
|
case "esac": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_WHILE, text);
|
return makeToken(ITokenConstants.SH_ESAC, text);
|
||||||
if ("select".equals(text))
|
case "while": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_SELECT, text);
|
return makeToken(ITokenConstants.SH_WHILE, text);
|
||||||
if ("until".equals(text))
|
case "select": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_UNTIL, text);
|
return makeToken(ITokenConstants.SH_SELECT, text);
|
||||||
if ("for".equals(text))
|
case "until": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_FOR, text);
|
return makeToken(ITokenConstants.SH_UNTIL, text);
|
||||||
if ("do".equals(text))
|
case "for": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_DO, text);
|
return makeToken(ITokenConstants.SH_FOR, text);
|
||||||
if ("done".equals(text))
|
case "do": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_DONE, text);
|
return makeToken(ITokenConstants.SH_DO, text);
|
||||||
if ("if".equals(text))
|
case "done": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_IF, text);
|
return makeToken(ITokenConstants.SH_DONE, text);
|
||||||
if ("then".equals(text))
|
case "if": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_THEN, text);
|
return makeToken(ITokenConstants.SH_IF, text);
|
||||||
if ("else".equals(text))
|
case "then": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_ELSE, text);
|
return makeToken(ITokenConstants.SH_THEN, text);
|
||||||
if ("elif".equals(text))
|
case "else": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_ELIF, text);
|
return makeToken(ITokenConstants.SH_ELSE, text);
|
||||||
if ("fi".equals(text))
|
case "elif": //$NON-NLS-1$
|
||||||
return makeToken(ITokenConstants.SH_FI, text);
|
return makeToken(ITokenConstants.SH_ELIF, text);
|
||||||
|
case "fi": //$NON-NLS-1$
|
||||||
|
return makeToken(ITokenConstants.SH_FI, text);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// other identifier-looking word
|
// other identifier-looking word
|
||||||
|
@ -360,7 +364,7 @@ public class AutoconfTokenizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != terminal) {
|
if (ch != terminal) {
|
||||||
handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch));
|
handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
return makeToken(type, buffer.toString());
|
return makeToken(type, buffer.toString());
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class Token implements ITokenConstants {
|
||||||
char[] text = document.get().toCharArray();
|
char[] text = document.get().toCharArray();
|
||||||
if (offset == 0)
|
if (offset == 0)
|
||||||
return false;
|
return false;
|
||||||
return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0);
|
return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,7 +359,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
|
||||||
for (String arg : argumentList) {
|
for (String arg : argumentList) {
|
||||||
command1.append(' ').append(arg);
|
command1.append(' ').append(arg);
|
||||||
}
|
}
|
||||||
newArgumentList = new String[] { "-c", command1.toString() };
|
newArgumentList = new String[] { "-c", command1.toString() }; //$NON-NLS-1$
|
||||||
|
|
||||||
OutputStream stdout = consoleOutStream;
|
OutputStream stdout = consoleOutStream;
|
||||||
OutputStream stderr = consoleOutStream;
|
OutputStream stderr = consoleOutStream;
|
||||||
|
|
|
@ -28,6 +28,6 @@ public class AutomakeConfigMacro extends Directive {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name + "\n";
|
return name + "\n"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,14 +27,14 @@ import org.eclipse.jface.text.source.AnnotationModel;
|
||||||
import org.eclipse.ui.IEditorInput;
|
import org.eclipse.ui.IEditorInput;
|
||||||
|
|
||||||
public class AutomakeErrorHandler {
|
public class AutomakeErrorHandler {
|
||||||
public static final String AUTOMAKE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID + ".parsefileerror";
|
public static final String AUTOMAKE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID + ".parsefileerror"; //$NON-NLS-1$
|
||||||
|
|
||||||
private IDocument document;
|
private IDocument document;
|
||||||
private AnnotationModel fAnnotationModel;
|
private AnnotationModel fAnnotationModel;
|
||||||
|
|
||||||
public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info";
|
public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info"; //$NON-NLS-1$
|
||||||
public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning";
|
public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning"; //$NON-NLS-1$
|
||||||
public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error";
|
public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error"; //$NON-NLS-1$
|
||||||
|
|
||||||
// TODO: no quickfixes yet implemented, but maybe in the future
|
// TODO: no quickfixes yet implemented, but maybe in the future
|
||||||
private static class AutomakeAnnotation extends Annotation implements IQuickFixableAnnotation {
|
private static class AutomakeAnnotation extends Annotation implements IQuickFixableAnnotation {
|
||||||
|
|
|
@ -54,13 +54,13 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic variables
|
// Automatic variables
|
||||||
if (hoverText.startsWith("$")) {
|
if (hoverText.startsWith("$")) { //$NON-NLS-1$
|
||||||
IDirective containingDirective = makefile.getDirectiveContainingLine(hoverLine);
|
IDirective containingDirective = makefile.getDirectiveContainingLine(hoverLine);
|
||||||
if (containingDirective instanceof TargetRule) {
|
if (containingDirective instanceof TargetRule) {
|
||||||
target = (TargetRule) containingDirective;
|
target = (TargetRule) containingDirective;
|
||||||
}
|
}
|
||||||
if (target == null)
|
if (target == null)
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
switch (hoverText.charAt(1)) {
|
switch (hoverText.charAt(1)) {
|
||||||
case '@':
|
case '@':
|
||||||
return target.getTarget().toString();
|
return target.getTarget().toString();
|
||||||
|
@ -103,7 +103,7 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,20 +33,17 @@ import org.eclipse.jface.text.rules.WordRule;
|
||||||
|
|
||||||
public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
|
public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
|
||||||
|
|
||||||
private final static String[] keywords = { "define", "endef", "ifdef", "ifndef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
@SuppressWarnings("nls")
|
||||||
"ifeq", "ifneq", "else", "endif", "include", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
private final static String[] keywords = { "define", "endef", "ifdef", "ifndef", "ifeq", "ifneq", "else", "endif",
|
||||||
"-include", "sinclude", "override", "endef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
"include", "-include", "sinclude", "override", "endef", "export", "unexport", "vpath", "if", "@if",
|
||||||
"export", "unexport", "vpath", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
"@endif" };
|
||||||
"if", "@if", "@endif" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
||||||
|
|
||||||
private final static String[] functions = { "subst", "patsubst", "strip", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
@SuppressWarnings("nls")
|
||||||
"findstring", "filter", "sort", "dir", "notdir", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
private final static String[] functions = { "subst", "patsubst", "strip", "findstring", "filter", "sort", "dir",
|
||||||
"suffix", "basename", "addsuffix", "addprefix", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
"notdir", "suffix", "basename", "addsuffix", "addprefix", "join", "word", "words", "wordlist", "firstword",
|
||||||
"join", "word", "words", "wordlist", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
"wildcard", "error", "warning", "shell", "origin", "foreach", "call" };
|
||||||
"firstword", "wildcard", "error", "warning", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
|
||||||
"shell", "origin", "foreach", "call" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
|
||||||
};
|
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
private final static String[] automaticVariables = { "$<", "$*", "$@", "$?", "$%" };
|
private final static String[] automaticVariables = { "$<", "$*", "$@", "$?", "$%" };
|
||||||
|
|
||||||
static final String[] fTokenProperties = new String[] { ColorManager.MAKE_COMMENT_COLOR,
|
static final String[] fTokenProperties = new String[] { ColorManager.MAKE_COMMENT_COLOR,
|
||||||
|
@ -117,7 +114,7 @@ public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
|
||||||
rules.add(new AutoconfIdentifierRule(other));
|
rules.add(new AutoconfIdentifierRule(other));
|
||||||
|
|
||||||
// Make sure we don't treat "\#" as comment start.
|
// Make sure we don't treat "\#" as comment start.
|
||||||
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
|
rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
|
||||||
|
|
||||||
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
|
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
|
||||||
|
|
||||||
|
|
|
@ -189,10 +189,10 @@ public class AutomakefileContentOutlinePage extends ContentOutlinePage {
|
||||||
} else if (element instanceof AutomakeIfElse) {
|
} else if (element instanceof AutomakeIfElse) {
|
||||||
AutomakeIfElse ifelse = (AutomakeIfElse) element;
|
AutomakeIfElse ifelse = (AutomakeIfElse) element;
|
||||||
// FIXME: make this not a string comparison
|
// FIXME: make this not a string comparison
|
||||||
if (ifelse.getType().equals("if")) {
|
if (ifelse.getType().equals("if")) { //$NON-NLS-1$
|
||||||
name = "if " + ifelse.getCondition();
|
name = "if " + ifelse.getCondition(); //$NON-NLS-1$
|
||||||
} else
|
} else
|
||||||
name = "else";
|
name = "else"; //$NON-NLS-1$
|
||||||
} else if (element instanceof AutomakeConfigMacro) {
|
} else if (element instanceof AutomakeConfigMacro) {
|
||||||
AutomakeConfigMacro macro = (AutomakeConfigMacro) element;
|
AutomakeConfigMacro macro = (AutomakeConfigMacro) element;
|
||||||
name = macro.getName();
|
name = macro.getName();
|
||||||
|
|
|
@ -573,7 +573,7 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
|
||||||
* An Autoconf directive of the form @xxx@
|
* An Autoconf directive of the form @xxx@
|
||||||
*/
|
*/
|
||||||
protected AutomakeConfigMacro parseConfigMacro(String line) {
|
protected AutomakeConfigMacro parseConfigMacro(String line) {
|
||||||
String extraChars = "_-";
|
String extraChars = "_-"; //$NON-NLS-1$
|
||||||
char[] ch = line.toCharArray();
|
char[] ch = line.toCharArray();
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while (Character.isLetterOrDigit(ch[i]) || extraChars.indexOf(ch[i]) >= 0) {
|
while (Character.isLetterOrDigit(ch[i]) || extraChars.indexOf(ch[i]) >= 0) {
|
||||||
|
@ -646,7 +646,7 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
|
||||||
}
|
}
|
||||||
directories = dirs.toArray(new String[0]);
|
directories = dirs.toArray(new String[0]);
|
||||||
if (pattern == null) {
|
if (pattern == null) {
|
||||||
pattern = "";
|
pattern = ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return new VPath(this, pattern, directories);
|
return new VPath(this, pattern, directories);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class MakefilePartitionScanner extends RuleBasedPartitionScanner {
|
||||||
rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
|
rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
// Last rule must be supplied with default token!
|
// Last rule must be supplied with default token!
|
||||||
rules.add(new MacroDefinitionRule(tMacro, tOther)); //$NON-NLS-1$
|
rules.add(new MacroDefinitionRule(tMacro, tOther));
|
||||||
|
|
||||||
IPredicateRule[] result = new IPredicateRule[rules.size()];
|
IPredicateRule[] result = new IPredicateRule[rules.size()];
|
||||||
rules.toArray(result);
|
rules.toArray(result);
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class NullMakefile extends AbstractMakefile {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -217,9 +217,9 @@ public abstract class AbstractEditorPreferencePage extends PreferencePage implem
|
||||||
try {
|
try {
|
||||||
int value = Integer.parseInt(number);
|
int value = Integer.parseInt(number);
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
status.setError(MessageFormat.format(errorMessages[1], new Object[] { number })); //$NON-NLS-1$
|
status.setError(MessageFormat.format(errorMessages[1], new Object[] { number }));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
status.setError(MessageFormat.format(errorMessages[1], new Object[] { number })); //$NON-NLS-1$
|
status.setError(MessageFormat.format(errorMessages[1], new Object[] { number }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -52,9 +52,11 @@ import org.eclipse.ui.model.WorkbenchViewerComparator;
|
||||||
*/
|
*/
|
||||||
public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
|
public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
private static String[] fACVersions = { "2.13", "2.59", "2.61", "2.68" };
|
private static String[] fACVersions = { "2.13", "2.59", "2.61", "2.68" };
|
||||||
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
|
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
private static String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" };
|
private static String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" };
|
||||||
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
|
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ public class AutotoolsEditorPreferenceConstants {
|
||||||
|
|
||||||
public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
|
public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String AUTOCONF_VERSION = "autoconf_version";
|
public static final String AUTOCONF_VERSION = "autoconf_version"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String AUTOMAKE_VERSION = "automake_version";
|
public static final String AUTOMAKE_VERSION = "automake_version"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static void initializeDefaultValues(IPreferenceStore store) {
|
public static void initializeDefaultValues(IPreferenceStore store) {
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
|
||||||
composite.setLayout(layout);
|
composite.setLayout(layout);
|
||||||
|
|
||||||
Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
|
Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
|
||||||
g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title"));
|
g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title")); //$NON-NLS-1$
|
||||||
gd = new GridData(
|
gd = new GridData(
|
||||||
GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
|
GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Text;
|
||||||
public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
|
public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
|
||||||
|
|
||||||
private static final int MARGIN = 3;
|
private static final int MARGIN = 3;
|
||||||
private String catName = "";
|
private String catName = ""; //$NON-NLS-1$
|
||||||
private IAConfiguration cfg;
|
private IAConfiguration cfg;
|
||||||
|
|
||||||
// Label class for a preference page.
|
// Label class for a preference page.
|
||||||
|
@ -153,7 +153,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
|
||||||
@Override
|
@Override
|
||||||
protected void configureShell(Shell newShell) {
|
protected void configureShell(Shell newShell) {
|
||||||
super.configureShell(newShell);
|
super.configureShell(newShell);
|
||||||
newShell.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.title"));
|
newShell.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.title")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -171,7 +171,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
|
||||||
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
|
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
|
||||||
|
|
||||||
Label label = new Label(composite, SWT.NONE);
|
Label label = new Label(composite, SWT.NONE);
|
||||||
label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.name_field"));
|
label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.name_field")); //$NON-NLS-1$
|
||||||
fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
||||||
GridData gd = new GridData(GridData.FILL_BOTH);
|
GridData gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.grabExcessHorizontalSpace = true;
|
gd.grabExcessHorizontalSpace = true;
|
||||||
|
@ -188,7 +188,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
label = new Label(composite, SWT.NONE);
|
label = new Label(composite, SWT.NONE);
|
||||||
label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.value_field"));
|
label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.value_field")); //$NON-NLS-1$
|
||||||
fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
||||||
gd = new GridData(GridData.FILL_BOTH);
|
gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.grabExcessHorizontalSpace = true;
|
gd.grabExcessHorizontalSpace = true;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
*/
|
*/
|
||||||
public class AutotoolsConfigurePrefStore implements IPreferenceStore {
|
public class AutotoolsConfigurePrefStore implements IPreferenceStore {
|
||||||
|
|
||||||
public final static String EMPTY_STRING = "";
|
public final static String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
public final static String ALL_OPTIONS_ID = EMPTY_STRING;
|
public final static String ALL_OPTIONS_ID = EMPTY_STRING;
|
||||||
|
|
||||||
private static AutotoolsConfigurePrefStore instance = null;
|
private static AutotoolsConfigurePrefStore instance = null;
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class AutotoolsConfigurePropertyTab extends AbstractAutotoolsCPropertyTab
|
||||||
fTree.addSelectionChangedListener(event -> handleOptionSelection());
|
fTree.addSelectionChangedListener(event -> handleOptionSelection());
|
||||||
fTree.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
|
fTree.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
// Create a temporary default AutotoolsConfiguration to use for label info
|
// Create a temporary default AutotoolsConfiguration to use for label info
|
||||||
IAConfiguration tmp = AutotoolsConfigurationManager.getInstance().createDefaultConfiguration("");
|
IAConfiguration tmp = AutotoolsConfigurationManager.getInstance().createDefaultConfiguration(""); //$NON-NLS-1$
|
||||||
fTree.setLabelProvider(new ToolListLabelProvider(tmp));
|
fTree.setLabelProvider(new ToolListLabelProvider(tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,8 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
|
||||||
acVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
|
acVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
|
||||||
amVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
|
amVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
acVer = "";
|
acVer = ""; //$NON-NLS-1$
|
||||||
amVer = "";
|
amVer = ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
int index = fACVersionCombo.getSelectionIndex();
|
int index = fACVersionCombo.getSelectionIndex();
|
||||||
String acVerSelected = fACVersionCombo.getItem(index);
|
String acVerSelected = fACVersionCombo.getItem(index);
|
||||||
|
@ -179,7 +179,7 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializeACVersion() {
|
void initializeACVersion() {
|
||||||
String version = "";
|
String version = ""; //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
|
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
|
||||||
if (version == null)
|
if (version == null)
|
||||||
|
@ -202,7 +202,7 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializeAMVersion() {
|
void initializeAMVersion() {
|
||||||
String version = "";
|
String version = ""; //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
|
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
|
||||||
if (version == null)
|
if (version == null)
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
public class AutotoolsToolPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
|
public class AutotoolsToolPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
|
||||||
|
|
||||||
private static final int MARGIN = 3;
|
private static final int MARGIN = 3;
|
||||||
private String toolName = "";
|
private String toolName = ""; //$NON-NLS-1$
|
||||||
private IAConfiguration cfg;
|
private IAConfiguration cfg;
|
||||||
|
|
||||||
public AutotoolsToolPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
|
public AutotoolsToolPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class AutotoolsToolsPropertyTab extends AbstractAutotoolsCPropertyTab {
|
||||||
|
|
||||||
/* text window for automake path */
|
/* text window for automake path */
|
||||||
fAutomakePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
|
fAutomakePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
|
||||||
fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); //$NON-NLS-1#
|
fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); //$NON-NLS-1$
|
||||||
gd = new GridData(
|
gd = new GridData(
|
||||||
GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
|
GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
|
||||||
fAutomakePath.setLayoutData(gd);
|
fAutomakePath.setLayoutData(gd);
|
||||||
|
|
|
@ -73,8 +73,8 @@ import org.xml.sax.SAXException;
|
||||||
|
|
||||||
public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
||||||
|
|
||||||
public static final String LOCAL_AUTOCONF_MACROS_DOC_NAME = "macros/acmacros";
|
public static final String LOCAL_AUTOCONF_MACROS_DOC_NAME = "macros/acmacros"; //$NON-NLS-1$
|
||||||
public static final String LOCAL_AUTOMAKE_MACROS_DOC_NAME = "macros/ammacros";
|
public static final String LOCAL_AUTOMAKE_MACROS_DOC_NAME = "macros/ammacros"; //$NON-NLS-1$
|
||||||
public static final String AUTOCONF_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/acmacros"; //$NON-NLS-1$
|
public static final String AUTOCONF_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/acmacros"; //$NON-NLS-1$
|
||||||
public static final String AUTOMAKE_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/ammacros"; //$NON-NLS-1$
|
public static final String AUTOMAKE_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/ammacros"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
||||||
Element elem = document.getElementById(name);
|
Element elem = document.getElementById(name);
|
||||||
if (null != elem) {
|
if (null != elem) {
|
||||||
int prototypeCount = 0;
|
int prototypeCount = 0;
|
||||||
buffer.append("<B>Macro:</B> ").append(name);
|
buffer.append("<B>Macro:</B> ").append(name); //$NON-NLS-1$
|
||||||
NodeList nl = elem.getChildNodes();
|
NodeList nl = elem.getChildNodes();
|
||||||
for (int i = 0; i < nl.getLength(); ++i) {
|
for (int i = 0; i < nl.getLength(); ++i) {
|
||||||
Node n = nl.item(i);
|
Node n = nl.item(i);
|
||||||
|
@ -305,11 +305,11 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
||||||
StringBuilder prototype = new StringBuilder();
|
StringBuilder prototype = new StringBuilder();
|
||||||
++prototypeCount;
|
++prototypeCount;
|
||||||
if (prototypeCount == 1) {
|
if (prototypeCount == 1) {
|
||||||
buffer.append(" (");
|
buffer.append(" ("); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
buffer.append(" <B>or</B> "); //$NON-NLS-2$
|
buffer.append(" <B>or</B> "); //$NON-NLS-1$
|
||||||
buffer.append(name);
|
buffer.append(name);
|
||||||
buffer.append(" (<I>"); //$NON-NLS-2$
|
buffer.append(" (<I>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
NodeList varList = n.getChildNodes();
|
NodeList varList = n.getChildNodes();
|
||||||
for (int j = 0; j < varList.getLength(); ++j) {
|
for (int j = 0; j < varList.getLength(); ++j) {
|
||||||
|
@ -322,14 +322,14 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
||||||
if (prototype.length() == 0)
|
if (prototype.length() == 0)
|
||||||
prototype.append(parm);
|
prototype.append(parm);
|
||||||
else
|
else
|
||||||
prototype.append(", ").append(parm);
|
prototype.append(", ").append(parm); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer.append(prototype).append("</I>)<br>"); //$NON-NLS-1$
|
buffer.append(prototype).append("</I>)<br>"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
if (nodeName.equals("synopsis")) { //$NON-NLS-1$
|
if (nodeName.equals("synopsis")) { //$NON-NLS-1$
|
||||||
Node textNode = n.getLastChild();
|
Node textNode = n.getLastChild();
|
||||||
buffer.append("<br><B>Synopsis:</B> ");
|
buffer.append("<br><B>Synopsis:</B> "); //$NON-NLS-1$
|
||||||
buffer.append(textNode.getNodeValue());
|
buffer.append(textNode.getNodeValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -444,11 +444,11 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
||||||
String parm = parmNode.getNodeValue();
|
String parm = parmNode.getNodeValue();
|
||||||
// Check for first optional parameter which means
|
// Check for first optional parameter which means
|
||||||
// we know the minimum number of parameters needed.
|
// we know the minimum number of parameters needed.
|
||||||
if (minParmCount < 0 && (parm.charAt(0) == '[' || parm.startsWith("...")))
|
if (minParmCount < 0 && (parm.charAt(0) == '[' || parm.startsWith("..."))) //$NON-NLS-1$
|
||||||
minParmCount = parmCount - 1;
|
minParmCount = parmCount - 1;
|
||||||
// Old style documentation sometimes had '[' in
|
// Old style documentation sometimes had '[' in
|
||||||
// prototypes so look for one at end of a parm too.
|
// prototypes so look for one at end of a parm too.
|
||||||
else if (minParmCount < 0 && parm.endsWith("["))
|
else if (minParmCount < 0 && parm.endsWith("[")) //$NON-NLS-1$
|
||||||
minParmCount = parmCount;
|
minParmCount = parmCount;
|
||||||
p.setParmName(prototypeCount, parmCount - 1, parm);
|
p.setParmName(prototypeCount, parmCount - 1, parm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
|
||||||
private Button langcpp;
|
private Button langcpp;
|
||||||
|
|
||||||
protected AutotoolsProjectImportWizardPage() {
|
protected AutotoolsProjectImportWizardPage() {
|
||||||
setTitle(AutotoolsWizardMessages.getResourceString("ImportWizardPage.title"));
|
setTitle(AutotoolsWizardMessages.getResourceString("ImportWizardPage.title")); //$NON-NLS-1$
|
||||||
setDescription(AutotoolsWizardMessages.getResourceString("ImportWizardPage.description"));
|
setDescription(AutotoolsWizardMessages.getResourceString("ImportWizardPage.description")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IProjectType getProjectType() {
|
protected IProjectType getProjectType() {
|
||||||
|
@ -110,10 +110,10 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
|
||||||
AutotoolsUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 7); //$NON-NLS-1$
|
AutotoolsUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 7); //$NON-NLS-1$
|
||||||
IConfiguration defaultCfg = null;
|
IConfiguration defaultCfg = null;
|
||||||
try {
|
try {
|
||||||
monitor.subTask(AutotoolsUIPlugin.getResourceString("adding project nature"));
|
monitor.subTask(AutotoolsUIPlugin.getResourceString("adding project nature")); //$NON-NLS-1$
|
||||||
ManagedCProjectNature.addManagedNature(project, SubMonitor.convert(monitor, 1));
|
ManagedCProjectNature.addManagedNature(project, SubMonitor.convert(monitor, 1));
|
||||||
AutotoolsNewProjectNature.addAutotoolsNature(project, SubMonitor.convert(monitor, 1));
|
AutotoolsNewProjectNature.addAutotoolsNature(project, SubMonitor.convert(monitor, 1));
|
||||||
monitor.subTask(AutotoolsUIPlugin.getResourceString("adding builder"));
|
monitor.subTask(AutotoolsUIPlugin.getResourceString("adding builder")); //$NON-NLS-1$
|
||||||
AutotoolsNewProjectNature.addAutotoolsBuilder(project, SubMonitor.convert(monitor, 1));
|
AutotoolsNewProjectNature.addAutotoolsBuilder(project, SubMonitor.convert(monitor, 1));
|
||||||
project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W,
|
project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W,
|
||||||
AutotoolsPropertyConstants.TRUE);
|
AutotoolsPropertyConstants.TRUE);
|
||||||
|
@ -167,7 +167,7 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the build options
|
// Save the build options
|
||||||
monitor.subTask(AutotoolsUIPlugin.getResourceString("saving project"));
|
monitor.subTask(AutotoolsUIPlugin.getResourceString("saving project")); //$NON-NLS-1$
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
info.setValid(true);
|
info.setValid(true);
|
||||||
ManagedBuildManager.saveBuildInfo(project, true);
|
ManagedBuildManager.saveBuildInfo(project, true);
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ConfigurationLabelProvider extends LabelProvider implements ITableL
|
||||||
else
|
else
|
||||||
return (tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$
|
return (tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -55,9 +55,9 @@ import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
|
||||||
*/
|
*/
|
||||||
public class ConvertToAutotoolsProjectWizardPage extends ConvertProjectWizardPage {
|
public class ConvertToAutotoolsProjectWizardPage extends ConvertProjectWizardPage {
|
||||||
|
|
||||||
private static final String WZ_TITLE = "WizardAutotoolsProjectConversion.title"; //$NON-NLS-1$
|
private static final String PREFIX = "WizardAutotoolsProjectConversion"; //$NON-NLS-1$
|
||||||
private static final String WZ_DESC = "WizardAutotoolsProjectConversion.description"; //$NON-NLS-1$
|
private static final String WZ_TITLE = PREFIX + ".title"; //$NON-NLS-1$
|
||||||
private static final String PREFIX = "WizardAutotoolsProjectConversion";
|
private static final String WZ_DESC = PREFIX + ".description"; //$NON-NLS-1$
|
||||||
protected static final String MSG_ADD_NATURE = PREFIX + ".message.add_nature"; //$NON-NLS-1$
|
protected static final String MSG_ADD_NATURE = PREFIX + ".message.add_nature"; //$NON-NLS-1$
|
||||||
protected static final String MSG_ADD_BUILDER = PREFIX + ".message.add_builder"; //$NON-NLS-1$
|
protected static final String MSG_ADD_BUILDER = PREFIX + ".message.add_builder"; //$NON-NLS-1$
|
||||||
protected static final String MSG_SAVE = PREFIX + ".message.save"; //$NON-NLS-1$
|
protected static final String MSG_SAVE = PREFIX + ".message.save"; //$NON-NLS-1$
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class ReferenceBlock extends AbstractCOptionPage {
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
monitor.beginTask(AutotoolsWizardMessages.getResourceString("ReferenceBlock_task_ReferenceProjects"), 1);
|
monitor.beginTask(AutotoolsWizardMessages.getResourceString("ReferenceBlock_task_ReferenceProjects"), 1); //$NON-NLS-1$
|
||||||
try {
|
try {
|
||||||
IProjectDescription description = project.getDescription();
|
IProjectDescription description = project.getDescription();
|
||||||
description.setReferencedProjects(refProjects);
|
description.setReferencedProjects(refProjects);
|
||||||
|
|
|
@ -77,10 +77,10 @@ public class GCCPathToolChainProvider implements IToolChainProvider {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (tuple[2]) {
|
switch (tuple[2]) {
|
||||||
case "linux":
|
case "linux": //$NON-NLS-1$
|
||||||
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_LINUX);
|
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_LINUX);
|
||||||
break;
|
break;
|
||||||
case "elf":
|
case "elf": //$NON-NLS-1$
|
||||||
gcc.setProperty(IToolChain.ATTR_OS, tuple[1]);
|
gcc.setProperty(IToolChain.ATTR_OS, tuple[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class CMakePropertyPage extends PropertyPage {
|
||||||
if (launcher instanceof ICBuildCommandLauncher) {
|
if (launcher instanceof ICBuildCommandLauncher) {
|
||||||
((ICBuildCommandLauncher) launcher).setBuildConfiguration(cconfig);
|
((ICBuildCommandLauncher) launcher).setBuildConfiguration(cconfig);
|
||||||
}
|
}
|
||||||
IPath buildPath = project.getLocation().append("build")
|
IPath buildPath = project.getLocation().append("build") //$NON-NLS-1$
|
||||||
.append(((CBuildConfiguration) cconfig).getName());
|
.append(((CBuildConfiguration) cconfig).getName());
|
||||||
Process p = launcher.execute(new Path("cmake"), new String[] { "-LAH", "." }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
Process p = launcher.execute(new Path("cmake"), new String[] { "-LAH", "." }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
new String[0], buildPath, new NullProgressMonitor());
|
new String[0], buildPath, new NullProgressMonitor());
|
||||||
|
@ -153,7 +153,7 @@ public class CMakePropertyPage extends PropertyPage {
|
||||||
args.add("-LAH"); //$NON-NLS-1$
|
args.add("-LAH"); //$NON-NLS-1$
|
||||||
for (ICMakePropertyPageControl control : componentList) {
|
for (ICMakePropertyPageControl control : componentList) {
|
||||||
if (control.isValueChanged()) {
|
if (control.isValueChanged()) {
|
||||||
args.add(control.getConfiguredString()); //$NON-NLS-1$ //$NON-NLS-2$
|
args.add(control.getConfiguredString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (args.size() == 2) {
|
if (args.size() == 2) {
|
||||||
|
@ -170,7 +170,7 @@ public class CMakePropertyPage extends PropertyPage {
|
||||||
if (launcher instanceof ICBuildCommandLauncher) {
|
if (launcher instanceof ICBuildCommandLauncher) {
|
||||||
((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
|
((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
|
||||||
}
|
}
|
||||||
args.add(".");
|
args.add("."); //$NON-NLS-1$
|
||||||
Process p = launcher.execute(new Path("cmake"), args.toArray(new String[0]), new String[0], buildDir, //$NON-NLS-1$
|
Process p = launcher.execute(new Path("cmake"), args.toArray(new String[0]), new String[0], buildDir, //$NON-NLS-1$
|
||||||
new NullProgressMonitor());
|
new NullProgressMonitor());
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
@ -259,19 +259,19 @@ public class CMakePropertyPage extends PropertyPage {
|
||||||
String optionString = optionMatcher.group(1).trim();
|
String optionString = optionMatcher.group(1).trim();
|
||||||
String[] options = optionString.split("\\s+"); //$NON-NLS-1$
|
String[] options = optionString.split("\\s+"); //$NON-NLS-1$
|
||||||
for (int i = 0; i < options.length; ++i) {
|
for (int i = 0; i < options.length; ++i) {
|
||||||
options[i] = options[i].replaceAll("\\(.*?\\)", "").trim(); //$NON-NLS-1$
|
options[i] = options[i].replaceAll("\\(.*?\\)", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name, options,
|
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name, options,
|
||||||
initialValue, lastComment);
|
initialValue, lastComment);
|
||||||
controls.add(control);
|
controls.add(control);
|
||||||
} else {
|
} else {
|
||||||
if ("BOOL".equals(type)) {
|
if ("BOOL".equals(type)) { //$NON-NLS-1$
|
||||||
if ("ON".equals(initialValue) || ("OFF".equals(initialValue))) {
|
if ("ON".equals(initialValue) || ("OFF".equals(initialValue))) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
|
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
|
||||||
new String[] { "ON", "OFF" }, //$NON-NLS-1$ //$NON-NLS-2$
|
new String[] { "ON", "OFF" }, //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
initialValue, lastComment);
|
initialValue, lastComment);
|
||||||
controls.add(control);
|
controls.add(control);
|
||||||
} else if ("YES".equals(initialValue) || "NO".equals(initialValue)) {
|
} else if ("YES".equals(initialValue) || "NO".equals(initialValue)) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
|
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
|
||||||
new String[] { "YES", "NO" }, //$NON-NLS-1$ //$NON-NLS-2$
|
new String[] { "YES", "NO" }, //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
initialValue, lastComment);
|
initialValue, lastComment);
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class AutotoolsProjectGenerator extends FMProjectGenerator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.add(CoreModel.newOutputEntry(getProject().getFullPath())); //$NON-NLS-1$
|
entries.add(CoreModel.newOutputEntry(getProject().getFullPath()));
|
||||||
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
|
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
|
||||||
monitor);
|
monitor);
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class CDataProviderTests extends TestCase {
|
public class CDataProviderTests extends TestCase {
|
||||||
/**
|
/**
|
||||||
* @param name
|
* @param name
|
||||||
|
|
|
@ -39,6 +39,7 @@ import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class StandardBuildTests extends TestCase {
|
public class StandardBuildTests extends TestCase {
|
||||||
private static final boolean OFF = false;
|
private static final boolean OFF = false;
|
||||||
private static final boolean ON = true;
|
private static final boolean ON = true;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.osgi.framework.BundleContext;
|
||||||
/**
|
/**
|
||||||
* The main plugin class to be used in the desktop.
|
* The main plugin class to be used in the desktop.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class MakeTestsPlugin extends Plugin {
|
public class MakeTestsPlugin extends Plugin {
|
||||||
//The shared instance.
|
//The shared instance.
|
||||||
private static MakeTestsPlugin plugin;
|
private static MakeTestsPlugin plugin;
|
||||||
|
|
|
@ -39,6 +39,7 @@ import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class MakefileReaderProviderTests extends TestCase {
|
public class MakefileReaderProviderTests extends TestCase {
|
||||||
private String[] inclDirs;
|
private String[] inclDirs;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class StandardBuildTestHelper {
|
public class StandardBuildTestHelper {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Create a new project named <code>name</code> or return the project in
|
* Create a new project named <code>name</code> or return the project in
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class GCCPerFileBOPConsoleParserTests extends BaseBOPConsoleParserTests {
|
public class GCCPerFileBOPConsoleParserTests extends BaseBOPConsoleParserTests {
|
||||||
private final static IMarkerGenerator MARKER_GENERATOR = new IMarkerGenerator() {
|
private final static IMarkerGenerator MARKER_GENERATOR = new IMarkerGenerator() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
*
|
*
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class ScannerConfigDiscoveryTests extends BaseTestCase {
|
public class ScannerConfigDiscoveryTests extends BaseTestCase {
|
||||||
private IProject fCProject = null;
|
private IProject fCProject = null;
|
||||||
private IFile fCFile = null;
|
private IFile fCFile = null;
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
/**
|
/**
|
||||||
* This class tests ScannerConfigProfileManager
|
* This class tests ScannerConfigProfileManager
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("nls")
|
||||||
public class ScannerConfigProfileTests extends BaseTestCase {
|
public class ScannerConfigProfileTests extends BaseTestCase {
|
||||||
private IProject fCProject = null;
|
private IProject fCProject = null;
|
||||||
private IFile fCFile = null;
|
private IFile fCFile = null;
|
||||||
|
|
|
@ -54,10 +54,10 @@ import org.eclipse.core.runtime.Status;
|
||||||
import org.osgi.framework.Version;
|
import org.osgi.framework.Version;
|
||||||
|
|
||||||
public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction {
|
public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction {
|
||||||
private static final String IS_BUILTIN_EMPTY = "IS_BUILTIN_EMPTY";
|
private static final String IS_BUILTIN_EMPTY = "IS_BUILTIN_EMPTY"; //$NON-NLS-1$
|
||||||
private static final String IS_VALUE_EMPTY = "IS_VALUE_EMPTY";
|
private static final String IS_VALUE_EMPTY = "IS_VALUE_EMPTY"; //$NON-NLS-1$
|
||||||
// Static default return values
|
// Static default return values
|
||||||
public static final String EMPTY_STRING = "";
|
public static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
public static final String[] EMPTY_STRING_ARRAY = new String[0];
|
public static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||||
public static final OptionStringValue[] EMPTY_LV_ARRAY = new OptionStringValue[0];
|
public static final OptionStringValue[] EMPTY_LV_ARRAY = new OptionStringValue[0];
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,6 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
mProj = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mProj == null) {
|
if (mProj == null) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
+ IManagedBuilderMakefileGenerator.WHITESPACE + "-n" //$NON-NLS-1$
|
+ IManagedBuilderMakefileGenerator.WHITESPACE + "-n" //$NON-NLS-1$
|
||||||
+ IManagedBuilderMakefileGenerator.WHITESPACE).append(depRule)
|
+ IManagedBuilderMakefileGenerator.WHITESPACE).append(depRule)
|
||||||
.append(IManagedBuilderMakefileGenerator.WHITESPACE + "$(dir $@)" //$NON-NLS-1$
|
.append(IManagedBuilderMakefileGenerator.WHITESPACE + "$(dir $@)" //$NON-NLS-1$
|
||||||
+ IManagedBuilderMakefileGenerator.WHITESPACE + ">"
|
+ IManagedBuilderMakefileGenerator.WHITESPACE + ">" //$NON-NLS-1$
|
||||||
+ IManagedBuilderMakefileGenerator.WHITESPACE)
|
+ IManagedBuilderMakefileGenerator.WHITESPACE)
|
||||||
.append(depRule)
|
.append(depRule)
|
||||||
.append(IManagedBuilderMakefileGenerator.WHITESPACE + IManagedBuilderMakefileGenerator.LOGICAL_AND
|
.append(IManagedBuilderMakefileGenerator.WHITESPACE + IManagedBuilderMakefileGenerator.LOGICAL_AND
|
||||||
|
|
|
@ -250,7 +250,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
GnuUIPlugin.getDefault()
|
GnuUIPlugin.getDefault()
|
||||||
.log(new Status(IStatus.ERROR, GnuUIPlugin.PLUGIN_ID, "Error executing program [" + cmd + "]", e));
|
.log(new Status(IStatus.ERROR, GnuUIPlugin.PLUGIN_ID, "Error executing program [" + cmd + "]", e)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,31 +466,44 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
|
||||||
boolean prj = page.isForProject();
|
boolean prj = page.isForProject();
|
||||||
if (prj || tool != null) {
|
if (prj || tool != null) {
|
||||||
for (ICConfigurationDescription cf : page.getCfgsEditable()) {
|
for (ICConfigurationDescription cf : page.getCfgsEditable()) {
|
||||||
IConfiguration c = null;
|
String s = null;
|
||||||
ITool t = null;
|
|
||||||
if (prj) {
|
if (prj) {
|
||||||
c = getCfg(cf);
|
IConfiguration c = getCfg(cf);
|
||||||
|
switch (field) {
|
||||||
|
case PRECMD:
|
||||||
|
s = c.getPrebuildStep();
|
||||||
|
break;
|
||||||
|
case PREANN:
|
||||||
|
s = c.getPreannouncebuildStep();
|
||||||
|
break;
|
||||||
|
case PSTCMD:
|
||||||
|
s = c.getPostbuildStep();
|
||||||
|
break;
|
||||||
|
case PSTANN:
|
||||||
|
s = c.getPostannouncebuildStep();
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
ITool t = null;
|
||||||
ICResourceDescription r = cf.getResourceDescription(cfgdescr.getPath(), true);
|
ICResourceDescription r = cf.getResourceDescription(cfgdescr.getPath(), true);
|
||||||
if (r != null && r instanceof ICFileDescription)
|
if (r != null && r instanceof ICFileDescription)
|
||||||
t = getRcbsTool((IFileInfo) getResCfg(r));
|
t = getRcbsTool((IFileInfo) getResCfg(r));
|
||||||
if (t == null)
|
if (t == null)
|
||||||
continue; // there's no specific resconfig for this configuration
|
continue; // there's no specific resconfig for this configuration
|
||||||
}
|
switch (field) {
|
||||||
String s = null;
|
case PRECMD:
|
||||||
switch (field) {
|
s = getInputTypes(t);
|
||||||
case PRECMD:
|
break;
|
||||||
s = prj ? c.getPrebuildStep() : getInputTypes(t);
|
case PREANN:
|
||||||
break;
|
s = getOutputNames(t);
|
||||||
case PREANN:
|
break;
|
||||||
s = prj ? c.getPreannouncebuildStep() : getOutputNames(t);
|
case PSTCMD:
|
||||||
break;
|
s = t.getToolCommand();
|
||||||
case PSTCMD:
|
break;
|
||||||
s = prj ? c.getPostbuildStep() : t.getToolCommand();
|
case PSTANN:
|
||||||
break;
|
s = t.getAnnouncement();
|
||||||
case PSTANN:
|
break;
|
||||||
s = prj ? c.getPostannouncebuildStep() : t.getAnnouncement();
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (s != null && s.trim().length() > 0)
|
if (s != null && s.trim().length() > 0)
|
||||||
set.add(s.trim());
|
set.add(s.trim());
|
||||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
|
@ -31,7 +32,6 @@ import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySu
|
||||||
import org.eclipse.cdt.core.model.util.CDTListComparator;
|
import org.eclipse.cdt.core.model.util.CDTListComparator;
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
|
||||||
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
|
||||||
import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
|
import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
|
@ -734,13 +734,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean settingsEqual(IScannerConfigBuilderInfo2 info1, IScannerConfigBuilderInfo2 info2) {
|
private boolean settingsEqual(IScannerConfigBuilderInfo2 info1, IScannerConfigBuilderInfo2 info2) {
|
||||||
if (!CDataUtil.objectsEqual(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
|
if (!Objects.equals(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
|
||||||
return false;
|
return false;
|
||||||
if (!CDataUtil.objectsEqual(info1.getBuildOutputFilePath(), info2.getBuildOutputFilePath()))
|
if (!Objects.equals(info1.getBuildOutputFilePath(), info2.getBuildOutputFilePath()))
|
||||||
return false;
|
return false;
|
||||||
if (!CDataUtil.objectsEqual(info1.getContext(), info2.getContext()))
|
if (!Objects.equals(info1.getContext(), info2.getContext()))
|
||||||
return false;
|
return false;
|
||||||
if (!CDataUtil.objectsEqual(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
|
if (!Objects.equals(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
|
||||||
return false;
|
return false;
|
||||||
if (info1.isAutoDiscoveryEnabled() != info2.isAutoDiscoveryEnabled()
|
if (info1.isAutoDiscoveryEnabled() != info2.isAutoDiscoveryEnabled()
|
||||||
|| info1.isBuildOutputFileActionEnabled() != info2.isBuildOutputFileActionEnabled()
|
|| info1.isBuildOutputFileActionEnabled() != info2.isBuildOutputFileActionEnabled()
|
||||||
|
|
|
@ -159,11 +159,11 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
|
||||||
|
|
||||||
String userArgs = getProperty(IMesonConstants.MESON_ARGUMENTS);
|
String userArgs = getProperty(IMesonConstants.MESON_ARGUMENTS);
|
||||||
if (userArgs != null && !userArgs.isEmpty()) {
|
if (userArgs != null && !userArgs.isEmpty()) {
|
||||||
commandList.addAll(Arrays.asList(userArgs.split(" ")));
|
commandList.addAll(Arrays.asList(userArgs.split(" "))); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
String projOptions = getProperty(IMesonConstants.MESON_PROJECT_OPTIONS);
|
String projOptions = getProperty(IMesonConstants.MESON_PROJECT_OPTIONS);
|
||||||
if (projOptions != null && !projOptions.isEmpty()) {
|
if (projOptions != null && !projOptions.isEmpty()) {
|
||||||
commandList.addAll(Arrays.asList(projOptions.split(" ")));
|
commandList.addAll(Arrays.asList(projOptions.split(" "))); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
commandList.add(getBuildDirectory().toString());
|
commandList.add(getBuildDirectory().toString());
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,7 @@ public class MesonProjectGenerator extends FMProjectGenerator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath(), // $NON-NLS-1$
|
entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath(), new IPath[] {}));
|
||||||
new IPath[] {})); //$NON-NLS-1$
|
|
||||||
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
|
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
|
||||||
monitor);
|
monitor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %Bundle-Name.0
|
Bundle-Name: %Bundle-Name.0
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.meson.ui;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.meson.ui;singleton:=true
|
||||||
Bundle-Version: 1.0.400.qualifier
|
Bundle-Version: 1.0.500.qualifier
|
||||||
Bundle-Vendor: %vendorName
|
Bundle-Vendor: %vendorName
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Bundle-Activator: org.eclipse.cdt.meson.ui.Activator
|
Bundle-Activator: org.eclipse.cdt.meson.ui.Activator
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
public class MesonBuildTab extends CommonBuildTab {
|
public class MesonBuildTab extends CommonBuildTab {
|
||||||
|
|
||||||
private static final String NINJA = "Ninja";
|
private static final String NINJA = "Ninja"; //$NON-NLS-1$
|
||||||
private Button unixGenButton;
|
private Button unixGenButton;
|
||||||
private Button ninjaGenButton;
|
private Button ninjaGenButton;
|
||||||
private Text mesonArgsText;
|
private Text mesonArgsText;
|
||||||
|
@ -135,7 +135,7 @@ public class MesonBuildTab extends CommonBuildTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateGeneratorButtons(String generator) {
|
private void updateGeneratorButtons(String generator) {
|
||||||
if (generator == null || generator.equals(NINJA)) { //$NON-NLS-1$
|
if (generator == null || generator.equals(NINJA)) {
|
||||||
ninjaGenButton.setSelection(true);
|
ninjaGenButton.setSelection(true);
|
||||||
} else {
|
} else {
|
||||||
unixGenButton.setSelection(true);
|
unixGenButton.setSelection(true);
|
||||||
|
@ -149,7 +149,7 @@ public class MesonBuildTab extends CommonBuildTab {
|
||||||
ICBuildConfiguration buildConfig = getBuildConfiguration();
|
ICBuildConfiguration buildConfig = getBuildConfiguration();
|
||||||
|
|
||||||
buildConfig.setProperty(IMesonConstants.MESON_GENERATOR,
|
buildConfig.setProperty(IMesonConstants.MESON_GENERATOR,
|
||||||
ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
|
ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$
|
||||||
|
|
||||||
String mesonArgs = mesonArgsText.getText().trim();
|
String mesonArgs = mesonArgsText.getText().trim();
|
||||||
if (!mesonArgs.isEmpty()) {
|
if (!mesonArgs.isEmpty()) {
|
||||||
|
@ -176,7 +176,7 @@ public class MesonBuildTab extends CommonBuildTab {
|
||||||
@Override
|
@Override
|
||||||
protected void saveProperties(Map<String, String> properties) {
|
protected void saveProperties(Map<String, String> properties) {
|
||||||
super.saveProperties(properties);
|
super.saveProperties(properties);
|
||||||
properties.put(IMesonConstants.MESON_GENERATOR, ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
|
properties.put(IMesonConstants.MESON_GENERATOR, ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$
|
||||||
|
|
||||||
properties.put(IMesonConstants.MESON_ARGUMENTS, mesonArgsText.getText().trim());
|
properties.put(IMesonConstants.MESON_ARGUMENTS, mesonArgsText.getText().trim());
|
||||||
properties.put(IMesonConstants.BUILD_COMMAND, buildCommandText.getText().trim());
|
properties.put(IMesonConstants.BUILD_COMMAND, buildCommandText.getText().trim());
|
||||||
|
@ -190,7 +190,7 @@ public class MesonBuildTab extends CommonBuildTab {
|
||||||
String gen = properties.get(IMesonConstants.MESON_GENERATOR);
|
String gen = properties.get(IMesonConstants.MESON_GENERATOR);
|
||||||
if (gen != null) {
|
if (gen != null) {
|
||||||
switch (gen) {
|
switch (gen) {
|
||||||
case NINJA: //$NON-NLS-1$
|
case NINJA:
|
||||||
ninjaGenButton.setSelection(true);
|
ninjaGenButton.setSelection(true);
|
||||||
unixGenButton.setSelection(false);
|
unixGenButton.setSelection(false);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class SWTImagesFactory {
|
||||||
private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
|
private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
|
||||||
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
|
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
|
||||||
public static final String IMG_MESON = NAME_PREFIX + "meson-logo.png"; //$NON-NLS-1$
|
public static final String IMG_MESON = NAME_PREFIX + "meson-logo.png"; //$NON-NLS-1$
|
||||||
public static final ImageDescriptor DESC_MESON = createManaged("", IMG_MESON);
|
public static final ImageDescriptor DESC_MESON = createManaged("", IMG_MESON); //$NON-NLS-1$
|
||||||
|
|
||||||
private static ImageDescriptor createManaged(String prefix, String name) {
|
private static ImageDescriptor createManaged(String prefix, String name) {
|
||||||
return createManaged(imageRegistry, prefix, name);
|
return createManaged(imageRegistry, prefix, name);
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class RunNinjaCommandHandler extends AbstractMesonCommandHandler {
|
||||||
String[] ninjaArgs = null;
|
String[] ninjaArgs = null;
|
||||||
if (argString != null) {
|
if (argString != null) {
|
||||||
List<String> ninjaArgList = new ArrayList<>();
|
List<String> ninjaArgList = new ArrayList<>();
|
||||||
Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(argString);
|
Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(argString); //$NON-NLS-1$
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
ninjaArgList.add(m.group(1));
|
ninjaArgList.add(m.group(1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue