From 094d2cb0bad63ac224b11e83ac8e4337b47c8bd3 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Fri, 25 May 2007 16:12:08 +0000 Subject: [PATCH] 1. Patch from Bala Torati (Symbian) to the [Bug 184390] [Template Engine] Hellow World templates should allow specifying the project source location 2. enabling additional MBS tests --- .../managedbuilder/tests/suite/AllManagedBuildTests.java | 2 +- .../projecttemplates/HelloWorldCAnsiProject/template.xml | 6 +++--- .../projecttemplates/HelloWorldCCProject/template.xml | 1 - .../process/processes/CreateSourceFolder.java | 6 ++++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/AllManagedBuildTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/AllManagedBuildTests.java index cc03a47266c..21f21c4f0ac 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/AllManagedBuildTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/tests/suite/AllManagedBuildTests.java @@ -56,7 +56,7 @@ public class AllManagedBuildTests { // suite.addTest(ManagedBuildCoreTests20.suite()); // suite.addTest(ManagedBuildCoreTests.suite()); // suite.addTest(ManagedProjectUpdateTests.suite()); -// suite.addTest(ManagedCommandLineGeneratorTest.suite()); + suite.addTest(ManagedCommandLineGeneratorTest.suite()); // suite.addTest(ResourceBuildCoreTests.suite()); suite.addTest(ManagedProject21MakefileTests.suite()); suite.addTest(ManagedProject30MakefileTests.suite()); diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml index 9f7244f3243..66a545fea2e 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCAnsiProject/template.xml @@ -35,7 +35,7 @@ type="input" default="%HelloWorld.sourceDir.default" pattern="[a-zA-Z0-9]+" - mandatory="true" + mandatory="false" persist="true"/> @@ -47,7 +47,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCCProject/template.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCCProject/template.xml index 65888acfaf6..07a0ad67417 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCCProject/template.xml +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/templates/projecttemplates/HelloWorldCCProject/template.xml @@ -34,7 +34,6 @@ type="input" default="%HelloWorld.sourceDir.default" pattern="[a-zA-Z0-9]+" - mandatory="true" persist="true"/> diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java index e992661eb19..f1fecc5824c 100644 --- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java +++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/processes/CreateSourceFolder.java @@ -48,6 +48,12 @@ public class CreateSourceFolder extends ProcessRunner { } protected void createSourceFolder(String projectName, String targetPath, IProgressMonitor monitor) throws ProcessFailureException { + //If the targetPath is an empty string, there will be no source folder to create. + // Also this is not an error. So just return gracefully. + if (targetPath == null || targetPath.equals("")) { + return; + } + IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); if (!projectHandle.exists()) {