Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
${eclipse_home} macro can be used in binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Krug committed Jan 4, 2018
1 parent 51c3428 commit f540a51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public Checker(IConsole console, IPreferenceStore projectPreferences,
}

String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
.getString(IPreferenceConstants.P_BINARY_PATH);
.getString(IPreferenceConstants.P_BINARY_PATH)
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));

command = new CppcheckCommand(console, binaryPath, settingsPreferences,
projectPreferences, toolchainSettings.getUserIncludes(), toolchainSettings.getSystemIncludes(), symbols);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public boolean removeChangeListener(IPropertyChangeListener listener) {
private synchronized ProblemProfile getInternalNewProblemProfile(IConsole console, IPreferenceStore store) throws CloneNotSupportedException, XPathExpressionException, IOException, InterruptedException, ParserConfigurationException, SAXException, ProcessExecutionException {
if (profile == null) {
String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
.getString(IPreferenceConstants.P_BINARY_PATH);
.getString(IPreferenceConstants.P_BINARY_PATH)
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
profile = new ProblemProfile(console, binaryPath);
registerChangeListener();
addChangeListener(profile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public static boolean startUpdateCheck() {
// do not start another update check, if one is already running
if (UpdateCheck.needUpdateCheck()) {
String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
.getString(IPreferenceConstants.P_BINARY_PATH);
.getString(IPreferenceConstants.P_BINARY_PATH)
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
new UpdateCheck(true).check(binaryPath);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ protected boolean checkState() {
if (super.checkState()) {
// check if it is valid cppcheck binary
try {
String path = getTextControl().getText();
String path = getTextControl().getText()
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));

VersionCommand versionCommand = new VersionCommand(
Console.getInstance(), path);
Version version = versionCommand
Expand Down

0 comments on commit f540a51

Please sign in to comment.