Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bundles/com.espressif.idf.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Bundle-ClassPath: .,
lib/commons-text-1.10.0.jar,
lib/commons-compress-1.21.jar,
lib/xz-1.9.jar
Import-Package: org.eclipse.embedcdt.core,
Import-Package: org.eclipse.cdt.debug.core.launch,
org.eclipse.embedcdt.core,
org.eclipse.launchbar.ui.target,
org.eclipse.ui.console
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Stream;

import org.eclipse.cdt.build.gcc.core.ClangToolChain;
import org.eclipse.cdt.cmake.core.ICMakeToolChainFile;
Expand Down Expand Up @@ -67,7 +66,6 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.launchbar.core.ILaunchBarManager;
import org.eclipse.launchbar.core.target.ILaunchTarget;
Expand All @@ -85,6 +83,7 @@
import com.espressif.idf.core.util.DfuCommandsUtil;
import com.espressif.idf.core.util.HintsUtil;
import com.espressif.idf.core.util.IDFUtil;
import com.espressif.idf.core.util.LaunchUtil;
import com.espressif.idf.core.util.LspService;
import com.espressif.idf.core.util.ParitionSizeHandler;
import com.espressif.idf.core.util.ProjectDescriptionReader;
Expand Down Expand Up @@ -113,7 +112,6 @@
* To work around that, we run cmake in advance with its dedicated working error parser.
*/
private ICMakeToolChainFile toolChainFile;
private String customBuildDir;
private IProgressMonitor monitor;
public boolean isProgressSet;

Expand All @@ -131,7 +129,7 @@
ICMakeToolChainFile toolChainFile, String launchMode)
{
super(config, name, toolChain, launchMode);
this.toolChainFile = toolChainFile;

Check warning on line 132 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.build.IDFBuildConfiguration(IBuildConfiguration, String, IToolChain, ICMakeToolChainFile, String) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.toolChainFile
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
}

@Override
Expand All @@ -158,43 +156,12 @@

public IPath getBuildContainerPath() throws CoreException
{
if (hasCustomBuild())
org.eclipse.core.runtime.Path path = new org.eclipse.core.runtime.Path(IDFUtil.getBuildDir(getProject()));
if (!path.toFile().exists())
{
org.eclipse.core.runtime.Path path = new org.eclipse.core.runtime.Path(customBuildDir);
if (!path.toFile().exists())
{
path.toFile().mkdirs();
}
return path;
}

return getBuildContainer().getLocation();
}

private boolean hasCustomBuild()
{
String userArgs = getProperty(CMAKE_ARGUMENTS);
// Custom build directory
String[] cmakeArgumentsArr = userArgs.split(" "); //$NON-NLS-1$
customBuildDir = StringUtil.EMPTY;
for (int i = 0; i < cmakeArgumentsArr.length; i++)
{
if (cmakeArgumentsArr[i].equals("-B")) //$NON-NLS-1$
{
customBuildDir = cmakeArgumentsArr[i + 1];
break;
}
}
try
{
IDFUtil.setBuildDir(getProject(), customBuildDir);
}
catch (CoreException e)
{
Logger.log(e);
path.toFile().mkdirs();

Check warning on line 162 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE

Exceptional return value of java.io.File.mkdirs() ignored in com.espressif.idf.core.build.IDFBuildConfiguration.getBuildContainerPath()
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.
}

return !customBuildDir.isBlank();
return path;
}

@Override
Expand Down Expand Up @@ -232,7 +199,8 @@
if (configuration != null
&& configuration.getType().getIdentifier().equals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE))
{
configuration = getBoundConfiguration(configuration);
configuration = new LaunchUtil(DebugPlugin.getDefault().getLaunchManager())
.getBoundConfiguration(configuration);
}
String property = configuration == null ? StringUtil.EMPTY
: configuration.getAttribute(name, StringUtil.EMPTY);
Expand All @@ -247,22 +215,6 @@
return super.getProperty(name);
}

/*
* In case when the active configuration is debugging, we are using bound launch configuration to build the project
*/
private ILaunchConfiguration getBoundConfiguration(ILaunchConfiguration configuration) throws CoreException
{
String bindedLaunchConfigName = configuration.getAttribute(IDFLaunchConstants.ATTR_LAUNCH_CONFIGURATION_NAME,
StringUtil.EMPTY);
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(DebugPlugin.getDefault()
.getLaunchManager().getLaunchConfigurationType(IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE));
ILaunchConfiguration defaultConfiguration = launchConfigurations[0];
return Stream.of(launchConfigurations).filter(config -> config.getName().contentEquals(bindedLaunchConfigName))
.findFirst().orElse(defaultConfiguration);

}

private IBinary[] getBuildOutput(final IBinaryContainer binaries, final IPath outputPath) throws CoreException
{
return Arrays.stream(binaries.getBinaries()).filter(b -> b.isExecutable() && outputPath.isPrefixOf(b.getPath()))
Expand All @@ -279,7 +231,7 @@
new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, Messages.IDFToolChainsMissingErrorMsg));
}
this.toolChainFile = manager.getToolChainFileFor(toolChain);
return toolChainFile;

Check warning on line 234 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP

com.espressif.idf.core.build.IDFBuildConfiguration.getToolChainFile() may expose internal representation by returning IDFBuildConfiguration.toolChainFile
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
}

private boolean isLocal() throws CoreException
Expand All @@ -306,7 +258,7 @@
Logger.log(e);
}

this.monitor = monitor;

Check warning on line 261 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

com.espressif.idf.core.build.IDFBuildConfiguration.build(int, Map, IConsole, IProgressMonitor) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.monitor
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
isProgressSet = false;

IProject project = getProject();
Expand All @@ -327,7 +279,7 @@
Path buildDir = getBuildDirectory();
if (!buildDir.toFile().exists())
{
buildDir.toFile().mkdir();

Check warning on line 282 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE

Exceptional return value of java.io.File.mkdir() ignored in com.espressif.idf.core.build.IDFBuildConfiguration.build(int, Map, IConsole, IProgressMonitor)
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.
}

try
Expand All @@ -348,38 +300,38 @@

private boolean buildPrechecks(IConsole console) throws Exception
{
ProjectDescriptionReader projectDescriptionReader = new ProjectDescriptionReader(getProject());
String projectDescriptionIdfPath = projectDescriptionReader.getIdfPath();
Path pathPdIdfPath = Paths.get(projectDescriptionIdfPath);

if (StringUtil.isEmpty(projectDescriptionIdfPath))
{
return true;
}
IDFEnvironmentVariables idfEnvironmentVariables = new IDFEnvironmentVariables();
String envIdfPath = idfEnvironmentVariables.getEnvValue(IDFEnvironmentVariables.IDF_PATH);
Path pathEnvIdf = Paths.get(envIdfPath);

boolean samePaths = false;
if (Platform.getOS().equals(Platform.OS_WIN32))
{
samePaths = pathEnvIdf.toString().equalsIgnoreCase(pathPdIdfPath.toString());
}
else
{
samePaths = pathEnvIdf.toString().equals(pathPdIdfPath.toString());
}

if (!samePaths)
{
String outputMessage = MessageFormat.format(Messages.IDFBuildConfiguration_PreCheck_DifferentIdfPath,
projectDescriptionIdfPath, envIdfPath);
console.getInfoStream().write(outputMessage);

return false;
}

return true;

Check warning on line 334 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION

Method lists Exception in its throws clause.
Raw output
Method lists Exception in its throws clause.
When declaring a method, the types of exceptions in the throws clause should be the most specific. Therefore, using Exception in the throws clause would force the caller to either use it in its own throws clause, or use it in a try-catch block (when it does not necessarily contain any meaningful information about the thrown exception).

For more information, see the SEI CERT ERR07-J rule [https://wiki.sei.cmu.edu/confluence/display/java/ERR07-J.+Do+not+throw+RuntimeException%2C+Exception%2C+or+Throwable].
}

private void runCmakeBuildCommand(IConsole console, IProgressMonitor monitor, IProject project, Instant start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public final class IDFLaunchConstants
public static final String IDF_TARGET_TYPE = "com.espressif.idf.launch.serial.core.serialFlashTarget"; //$NON-NLS-1$
public static final String OPEN_SERIAL_MONITOR = "OPEN_SERIAL_MONITOR"; //$NON-NLS-1$
public static final String SERIAL_MONITOR_ENCODING = "SERIAL_MONITOR_ENCODING"; //$NON-NLS-1$
public static final String BUILD_FOLDER_PATH = "com.espressif.idf.launch.serial.core.idfBuildFolderPath"; //$NON-NLS-1$
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.stream.Stream;

import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.debug.core.launch.CoreBuildLaunchConfigDelegate;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
Expand All @@ -31,6 +32,7 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.launchbar.core.ILaunchBarManager;
import org.eclipse.launchbar.core.target.ILaunchTarget;
import org.eclipse.swt.widgets.Display;
Expand All @@ -46,6 +48,7 @@
import com.espressif.idf.core.LaunchBarTargetConstants;
import com.espressif.idf.core.ProcessBuilderFactory;
import com.espressif.idf.core.SystemExecutableFinder;
import com.espressif.idf.core.build.IDFLaunchConstants;
import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.toolchain.ESPToolChainManager;

Expand Down Expand Up @@ -425,7 +428,7 @@
File dir = new File(dirStr);
if (dir.isDirectory())
{
for (File file : dir.listFiles())

Check warning on line 431 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java

View workflow job for this annotation

GitHub Actions / spotbugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

Possible null pointer dereference in com.espressif.idf.core.util.IDFUtil.getXtensaToolchainExecutableAddr2LinePath(IProject) due to return value of called method
Raw output
The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.
{
if (file.isDirectory())
{
Expand Down Expand Up @@ -560,6 +563,46 @@
pathToBuildDir);
}

/**
* Updates the build folder for the specified project in the given launch configuration.
*
* This method retrieves the project associated with the given launch configuration, checks if a build folder path
* is specified in the configuration, and sets the build directory for the project. If no build folder path is
* specified, a default value is used. If the specified path is relative, it is converted to an absolute path based
* on the project's location.
*
* @param configuration The launch configuration whose associated project’s build folder is to be updated. This
* parameter cannot be {@code null}.
* @throws CoreException If there is an issue with accessing the project or updating the build folder. This
* exception is logged, but not rethrown.
*/
public static void updateProjectBuildFolder(ILaunchConfigurationWorkingCopy configuration)
{
try
{
IProject project = CoreBuildLaunchConfigDelegate.getProject(configuration);
if (project == null)
{
return;
}
String buildFolder = configuration.getAttribute(IDFLaunchConstants.BUILD_FOLDER_PATH,
IDFUtil.getBuildDir(project));
buildFolder = buildFolder.isBlank() ? IDFConstants.BUILD_FOLDER : buildFolder;

IPath path = new Path(buildFolder);
if (!path.isAbsolute())
{
IPath projectLocation = project.getLocation();
path = projectLocation.append(path);
}
IDFUtil.setBuildDir(project, path.toOSString());
}
catch (CoreException e)
{
Logger.log(e);
}
}

/**
* Project .map file path
*
Expand Down Expand Up @@ -765,7 +808,7 @@
}
return false;
}

public static String resolveEnvVariable(String path)
{
Pattern winEnvPattern = Pattern.compile("%(\\w+)%"); //$NON-NLS-1$
Expand Down Expand Up @@ -801,7 +844,7 @@
return resolvedPath.toString();

}

public static Map<String, String> getSystemEnv()
{
Map<String, String> env = new HashMap<String, String>(System.getenv());
Expand All @@ -810,17 +853,17 @@
env.put(IDFCorePreferenceConstants.IDF_TOOLS_PATH, idfToolsPath);
return env;
}

public static String getIDFToolsPathFromPreferences()
{
String idfToolsPath = Platform.getPreferencesService().getString(IDFCorePlugin.PLUGIN_ID,
IDFCorePreferenceConstants.IDF_TOOLS_PATH, IDFCorePreferenceConstants.IDF_TOOLS_PATH_DEFAULT, null);
return idfToolsPath;
}

public static void closeWelcomePage(IWorkbenchWindow activeww)
{
Display.getDefault().syncExec(()-> {
Display.getDefault().syncExec(() -> {
if (activeww != null)
{
IWorkbenchPage page = activeww.getActivePage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
public IdfCommandExecutor(String target, MessageConsole console)
{
this.target = target;
this.console = console;

Check warning on line 45 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IdfCommandExecutor.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.util.IdfCommandExecutor(String, MessageConsole) may expose internal representation by storing an externally mutable object into IdfCommandExecutor.console
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
}

public IStatus executeReconfigure(IProject project)
Expand All @@ -54,7 +54,6 @@
private IStatus runIdfReconfigureCommand(IProject project)
{
ProcessBuilderFactory processRunner = new ProcessBuilderFactory();
setBuildFolder(project);
List<String> arguments = prepareCmakeArguments(project);
Map<String, String> environment = new HashMap<>(new IDFEnvironmentVariables().getSystemEnvMap());

Expand Down Expand Up @@ -97,32 +96,6 @@
return arguments;
}

private boolean setBuildFolder(IProject project)
{
String userArgs = getProperty(CMAKE_ARGUMENTS);
// Custom build directory
String[] cmakeArgumentsArr = userArgs.split(" "); //$NON-NLS-1$
String customBuildDir = StringUtil.EMPTY;
for (int i = 0; i < cmakeArgumentsArr.length; i++)
{
if (cmakeArgumentsArr[i].equals("-B")) //$NON-NLS-1$
{
customBuildDir = cmakeArgumentsArr[i + 1];
break;
}
}
try
{
IDFUtil.setBuildDir(project, customBuildDir);
}
catch (CoreException e)
{
Logger.log(e);
}

return !customBuildDir.isBlank();
}

public String getProperty(String name)
{
try
Expand Down Expand Up @@ -160,7 +133,7 @@
{
StringBuilder output = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
processRunner.run(arguments, project.getLocation(), environment).getInputStream())))

Check warning on line 136 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IdfCommandExecutor.java

View workflow job for this annotation

GitHub Actions / spotbugs

DM_DEFAULT_ENCODING

Found reliance on default encoding in com.espressif.idf.core.util.IdfCommandExecutor.runProcess(List, Map, ProcessBuilderFactory, IProject, MessageConsoleStream): new java.io.InputStreamReader(InputStream)
Raw output
Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
{
String line;
while ((line = reader.readLine()) != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
*******************************************************************************/
package com.espressif.idf.core.util;

import java.util.stream.Stream;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.launchbar.core.ILaunchDescriptor;

import com.espressif.idf.core.build.IDFLaunchConstants;

public class LaunchUtil
{
private final ILaunchManager launchManager;

public LaunchUtil(ILaunchManager launchManager)
{
this.launchManager = launchManager;

Check warning on line 25 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchUtil.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.util.LaunchUtil(ILaunchManager) may expose internal representation by storing an externally mutable object into LaunchUtil.launchManager
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
}

public ILaunchConfiguration findAppropriateLaunchConfig(ILaunchDescriptor descriptor, String configIndentifier)
Expand All @@ -36,4 +41,19 @@
return null;
}

/*
* In case when the active configuration is debugging, we are using bound launch configuration to build the project
*/
public ILaunchConfiguration getBoundConfiguration(ILaunchConfiguration configuration) throws CoreException
{
String bindedLaunchConfigName = configuration.getAttribute(IDFLaunchConstants.ATTR_LAUNCH_CONFIGURATION_NAME,
StringUtil.EMPTY);
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(DebugPlugin.getDefault()
.getLaunchManager().getLaunchConfigurationType(IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE));
ILaunchConfiguration defaultConfiguration = launchConfigurations[0];
return Stream.of(launchConfigurations).filter(config -> config.getName().contentEquals(bindedLaunchConfigName))
.findFirst().orElse(defaultConfiguration);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@

package com.espressif.idf.debug.gdbjtag.openocd.ui;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;

import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.util.IDFUtil;
import com.espressif.idf.core.util.LaunchUtil;

public class TabGroupLaunchConfiguration extends AbstractLaunchConfigurationTabGroup
{

Expand All @@ -38,12 +45,28 @@ public void createTabs(ILaunchConfigurationDialog dialog, String mode)
// we manually define the tabs here.

TabStartup tabStartup = new TabStartup();

ILaunchConfigurationTab tabs[] = new ILaunchConfigurationTab[] { new TabMain(), new TabDebugger(tabStartup),
tabStartup, new SourceLookupTab(), new CommonTab(), new TabSvdTarget() };

setTabs(tabs);

}

@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration)
{
super.performApply(configuration);
try
{
IDFUtil.updateProjectBuildFolder(new LaunchUtil(DebugPlugin.getDefault().getLaunchManager())
.getBoundConfiguration(configuration).getWorkingCopy());
}
catch (CoreException e)
{
Logger.log(e);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.cdt.cmake.core.internal.CMakeBuildConfiguration;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
Expand Down Expand Up @@ -483,6 +484,13 @@ public boolean isValid(ILaunchConfiguration launchConfig)
{
hasProject = launchConfig.getMappedResources() != null
&& launchConfig.getMappedResources()[0].getProject().exists();
// Manually check for "-B" in cmakeArgs here because CMakeBuildTab2's isValid() method is not being called
String cmakeArgs = launchConfig.getAttribute(CMakeBuildConfiguration.CMAKE_ARGUMENTS, StringUtil.EMPTY);
if (cmakeArgs.contains("-B")) //$NON-NLS-1$
{
setErrorMessage(Messages.CMakeMainTab2_CmakeArgsDeprecatedBArgMessage);
return false;
}
}
catch (CoreException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class Messages extends NLS
public static String NewSerialFlashTargetWizardPage_Title;
public static String CMakeMainTab2_FlashComboLbl;
public static String CMakeMainTab2_Arguments;
public static String CMakeMainTab2_CmakeArgsDeprecatedBArgMessage;
public static String CMakeMainTab2_NoDfuTargetSelectedError;
public static String CMakeMainTab2_Note;
public static String CMakeMainTab2_TargetsComboLbl;
Expand Down
Loading
Loading