merge
authorJohn Kern <johnk@symbian.org>
Thu, 04 Feb 2010 08:12:58 -0800
changeset 94 4c2807764d46
parent 93 09a6fe298c93 (current diff)
parent 92 e5c37ce1b003 (diff)
child 95 08b14ea8276f
merge
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Thu Feb 04 08:12:34 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Thu Feb 04 08:12:58 2010 -0800
@@ -28,6 +28,7 @@
 
 import javax.swing.filechooser.FileSystemView;
 
+import org.eclipse.core.resources.ICommand;
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -42,6 +43,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
 import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.BuildPathsBlock;
 import org.eclipse.wst.validation.ValidationFramework;
 import org.symbian.tools.wrttools.Activator;
@@ -74,11 +76,11 @@
 		IProject project = workspace.getRoot().getProject(name);
 		BuildPathsBlock.createProject(project, uri, new SubProgressMonitor(
 				monitor, 10));
-		ValidationFramework.getDefault().addValidationBuilder(project);
-
 		BuildPathsBlock.addJavaNature(project, new SubProgressMonitor(monitor,
 				10));
 
+		ValidationFramework.getDefault().addValidationBuilder(project);
+
 		// TODO: Build path, super type, etc.
 		// BuildPathsBlock.flush(classPathEntries, javaScriptProject, superType,
 		// monitor)
@@ -98,6 +100,18 @@
 				System.arraycopy(natureIds, 0, newNatures, 1, natureIds.length);
 				newNatures[0] = WidgetProjectNature.ID;
 				description.setNatureIds(newNatures);
+				
+				ICommand[] buildSpec = description.getBuildSpec();
+				for (int i = 0; i < buildSpec.length; i++) {
+					ICommand command = buildSpec[i];
+					if (JavaScriptCore.BUILDER_ID.equals(command.getBuilderName())) {
+						buildSpec[i] = buildSpec[buildSpec.length - 1];
+						buildSpec[buildSpec.length - 1] = command;
+						description.setBuildSpec(buildSpec);
+						break;
+					}
+				}
+				
 				project.setDescription(description, new NullProgressMonitor());
 			} catch (CoreException e) {
 				Activator.log(e);