mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug #190173: patch by Bala Torati.
This commit is contained in:
parent
d4e0d5c793
commit
6375411080
4 changed files with 26 additions and 6 deletions
|
@ -14,7 +14,6 @@ import java.util.List;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.templateengine.TemplateCore;
|
||||
import org.eclipse.cdt.core.templateengine.TemplateEngineHelper;
|
||||
import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
|
||||
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
||||
import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
|
||||
|
@ -66,7 +65,10 @@ public class NewManagedProject extends ProcessRunner {
|
|||
locationPath = Path.fromPortableString(location);
|
||||
}
|
||||
|
||||
List configs = (List) template.getValueStore().get(TemplateEngineHelper.CONFIGURATIONS);
|
||||
List configs = template.getTemplateInfo().getConfigurations();
|
||||
if (configs == null || configs.size() == 0) {
|
||||
throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
pca.setProject(project);
|
||||
pca.setProjectLocation(locationPath);
|
||||
|
@ -82,7 +84,7 @@ public class NewManagedProject extends ProcessRunner {
|
|||
} catch (CoreException e) {
|
||||
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
|
||||
} catch (BuildException e) {
|
||||
throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + e.getMessage(), e); //$NON-NLS-1$
|
||||
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
// throw new ProcessFailureException(Messages.getString("NewManagedProject.5") + projectName); //$NON-NLS-1$
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
|
@ -93,7 +94,8 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
private IWizard wizard;
|
||||
private IWizardPage startingPage;
|
||||
// private EntryDescriptor entryDescriptor = null;
|
||||
private EntryInfo entryInfo;
|
||||
private EntryInfo entryInfo;
|
||||
private CfgHolder[] cfgs = null;
|
||||
|
||||
protected static final class EntryInfo {
|
||||
private SortedMap tcs;
|
||||
|
@ -398,7 +400,6 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||
CfgHolder[] cfgs = null;
|
||||
if (defaults) {
|
||||
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
|
||||
} else {
|
||||
|
@ -464,6 +465,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
|||
if(template == null)
|
||||
return;
|
||||
|
||||
List configs = new ArrayList();
|
||||
for(int i = 0; i < cfgs.length; i++){
|
||||
configs.add(cfgs[i].getConfiguration());
|
||||
}
|
||||
template.getTemplateInfo().setConfigurations(configs);
|
||||
|
||||
IStatus[] statuses = template.executeTemplateProcesses(null, false);
|
||||
if (statuses.length == 1 && statuses[0].getException() instanceof ProcessFailureException) {
|
||||
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.templateengine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
|
@ -28,6 +29,7 @@ public class TemplateInfo {
|
|||
private boolean isCategory;
|
||||
private String icon;
|
||||
private String templateId;
|
||||
private List configs;
|
||||
|
||||
public TemplateInfo(String templateId, String projectTypeId, String filterPattern, String templatePath,
|
||||
String pluginId, Set toolChainIdSet, String usageDescription,
|
||||
|
@ -41,6 +43,7 @@ public class TemplateInfo {
|
|||
this.usageDescription = usageDescription != null ? usageDescription : ""; //$NON-NLS-1$
|
||||
this.pagesProvider = pagesProvider;
|
||||
this.isCategory = isCategory;
|
||||
this.configs = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -104,6 +107,14 @@ public class TemplateInfo {
|
|||
this.toolChainIdSet = toolChainIdSet;
|
||||
}
|
||||
|
||||
public List getConfigurations() {
|
||||
return configs;
|
||||
}
|
||||
|
||||
public void setConfigurations(List configs) {
|
||||
this.configs = configs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the isCategory
|
||||
*/
|
||||
|
|
|
@ -29,7 +29,7 @@ SetMBSStringOptionValue.3=SetMBSStringOptionValue failure: No such file exists:
|
|||
SetMBSStringListOptionValues.0=SetMBSStringListOptionValues failure:
|
||||
SetMBSStringListOptionValues.3=SetMBSStringListOptionValues failure: No such file exists:
|
||||
NewManagedProject.3=New Project failure:
|
||||
NewManagedProject.4=New Project failure:
|
||||
NewManagedProject.4=New Project failure: No Configurations specified for
|
||||
NewManagedProject.5=New Project failure: project already existing in work space:
|
||||
AppendCreate.1=Add File failure: template source not found:
|
||||
AppendCreate.2=Append failure: template source not found:
|
||||
|
|
Loading…
Add table
Reference in a new issue