mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-07 10:33:26 +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.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.templateengine.TemplateCore;
|
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.ProcessArgument;
|
||||||
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
|
||||||
import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
|
import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
|
||||||
|
@ -66,7 +65,10 @@ public class NewManagedProject extends ProcessRunner {
|
||||||
locationPath = Path.fromPortableString(location);
|
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.setProject(project);
|
||||||
pca.setProjectLocation(locationPath);
|
pca.setProjectLocation(locationPath);
|
||||||
|
@ -82,7 +84,7 @@ public class NewManagedProject extends ProcessRunner {
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
|
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
|
||||||
} catch (BuildException e) {
|
} 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 {
|
} else {
|
||||||
// throw new ProcessFailureException(Messages.getString("NewManagedProject.5") + projectName); //$NON-NLS-1$
|
// throw new ProcessFailureException(Messages.getString("NewManagedProject.5") + projectName); //$NON-NLS-1$
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
package org.eclipse.cdt.managedbuilder.ui.wizards;
|
package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
@ -94,6 +95,7 @@ public class MBSWizardHandler extends CWizardHandler {
|
||||||
private IWizardPage startingPage;
|
private IWizardPage startingPage;
|
||||||
// private EntryDescriptor entryDescriptor = null;
|
// private EntryDescriptor entryDescriptor = null;
|
||||||
private EntryInfo entryInfo;
|
private EntryInfo entryInfo;
|
||||||
|
private CfgHolder[] cfgs = null;
|
||||||
|
|
||||||
protected static final class EntryInfo {
|
protected static final class EntryInfo {
|
||||||
private SortedMap tcs;
|
private SortedMap tcs;
|
||||||
|
@ -398,7 +400,6 @@ public class MBSWizardHandler extends CWizardHandler {
|
||||||
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||||
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
|
||||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
|
||||||
CfgHolder[] cfgs = null;
|
|
||||||
if (defaults) {
|
if (defaults) {
|
||||||
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
|
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
|
||||||
} else {
|
} else {
|
||||||
|
@ -464,6 +465,12 @@ public class MBSWizardHandler extends CWizardHandler {
|
||||||
if(template == null)
|
if(template == null)
|
||||||
return;
|
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);
|
IStatus[] statuses = template.executeTemplateProcesses(null, false);
|
||||||
if (statuses.length == 1 && statuses[0].getException() instanceof ProcessFailureException) {
|
if (statuses.length == 1 && statuses[0].getException() instanceof ProcessFailureException) {
|
||||||
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
|
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.templateengine;
|
package org.eclipse.cdt.core.templateengine;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ public class TemplateInfo {
|
||||||
private boolean isCategory;
|
private boolean isCategory;
|
||||||
private String icon;
|
private String icon;
|
||||||
private String templateId;
|
private String templateId;
|
||||||
|
private List configs;
|
||||||
|
|
||||||
public TemplateInfo(String templateId, String projectTypeId, String filterPattern, String templatePath,
|
public TemplateInfo(String templateId, String projectTypeId, String filterPattern, String templatePath,
|
||||||
String pluginId, Set toolChainIdSet, String usageDescription,
|
String pluginId, Set toolChainIdSet, String usageDescription,
|
||||||
|
@ -41,6 +43,7 @@ public class TemplateInfo {
|
||||||
this.usageDescription = usageDescription != null ? usageDescription : ""; //$NON-NLS-1$
|
this.usageDescription = usageDescription != null ? usageDescription : ""; //$NON-NLS-1$
|
||||||
this.pagesProvider = pagesProvider;
|
this.pagesProvider = pagesProvider;
|
||||||
this.isCategory = isCategory;
|
this.isCategory = isCategory;
|
||||||
|
this.configs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,6 +107,14 @@ public class TemplateInfo {
|
||||||
this.toolChainIdSet = toolChainIdSet;
|
this.toolChainIdSet = toolChainIdSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List getConfigurations() {
|
||||||
|
return configs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfigurations(List configs) {
|
||||||
|
this.configs = configs;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the isCategory
|
* @return the isCategory
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -29,7 +29,7 @@ SetMBSStringOptionValue.3=SetMBSStringOptionValue failure: No such file exists:
|
||||||
SetMBSStringListOptionValues.0=SetMBSStringListOptionValues failure:
|
SetMBSStringListOptionValues.0=SetMBSStringListOptionValues failure:
|
||||||
SetMBSStringListOptionValues.3=SetMBSStringListOptionValues failure: No such file exists:
|
SetMBSStringListOptionValues.3=SetMBSStringListOptionValues failure: No such file exists:
|
||||||
NewManagedProject.3=New Project failure:
|
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:
|
NewManagedProject.5=New Project failure: project already existing in work space:
|
||||||
AppendCreate.1=Add File failure: template source not found:
|
AppendCreate.1=Add File failure: template source not found:
|
||||||
AppendCreate.2=Append failure: template source not found:
|
AppendCreate.2=Append failure: template source not found:
|
||||||
|
|
Loading…
Add table
Reference in a new issue