[英]Eclipse: How can I execute a launch configuration programmatically?
我的Eclipse項目中有各種啟動配置文件。 有什么方法可以以編程方式執行任意啟動配置嗎?
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType("org.eclipse.cdt.launch.applicationLaunchType");
ILaunchConfiguration[] lcs = manager.getLaunchConfigurations(type);
for (ILaunchConfiguration iLaunchConfiguration : lcs) {
if (iLaunchConfiguration.getName().equals("Test PThread")) {
ILaunchConfigurationWorkingCopy t = iLaunchConfiguration.getWorkingCopy();
ILaunchConfiguration config = t.doSave();
if (config != null) {
// config.launch(ILaunchManager.RUN_MODE, null);
DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.