Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2016-08-09 18:54:14 +0000
committerGerrit Code Review @ Eclipse.org2016-08-10 15:17:41 +0000
commit20c4e5ba88ba4fa3be972642f5f03de546e9b864 (patch)
tree78ca1332198a89fd29ef3545f8adb8b35dddfabc
parent35921b4bbd22c58d3aa3c4317a6132a1c85943f0 (diff)
downloadorg.eclipse.cdt-20c4e5ba88ba4fa3be972642f5f03de546e9b864.tar.gz
org.eclipse.cdt-20c4e5ba88ba4fa3be972642f5f03de546e9b864.tar.xz
org.eclipse.cdt-20c4e5ba88ba4fa3be972642f5f03de546e9b864.zip
Get CMake projects created and building. New C/C++ Project Wizard.
Fixed up CMake new project creation. Hooked up the CMake build config properly. Introducing the New C/C++ Project Wizard that hold all the new project types: Arduino, Qt, CMake. Change-Id: I9f9c8b1f51b136515fe226c15059cdbb99106275
-rw-r--r--build/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF4
-rw-r--r--build/org.eclipse.cdt.cmake.core/plugin.xml33
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java73
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java2
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java64
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeTemplateGenerator.java62
-rw-r--r--build/org.eclipse.cdt.cmake.core/templates/simple/CMakeLists.txt4
-rw-r--r--build/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml8
-rw-r--r--build/org.eclipse.cdt.cmake.ui/META-INF/MANIFEST.MF3
-rw-r--r--build/org.eclipse.cdt.cmake.ui/icons/cmake_logo-main.pngbin0 -> 5140 bytes
-rw-r--r--build/org.eclipse.cdt.cmake.ui/plugin.xml34
-rw-r--r--build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/NewCMakeProjectWizard.java63
-rw-r--r--core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF3
-rw-r--r--core/org.eclipse.cdt.ui/plugin.properties4
-rw-r--r--core/org.eclipse.cdt.ui/plugin.xml21
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/project/NewCDTProjectWizard.java21
-rw-r--r--debug/org.eclipse.cdt.debug.application.product/debug.product5
-rw-r--r--qt/org.eclipse.cdt.qt.ui/icons/qt_logo.pngbin0 -> 4315 bytes
-rw-r--r--qt/org.eclipse.cdt.qt.ui/plugin.xml13
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.ui/plugin.xml9
20 files changed, 237 insertions, 189 deletions
diff --git a/build/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF
index 8aba316323..e7db1577fc 100644
--- a/build/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF
@@ -7,10 +7,10 @@ Bundle-Activator: org.eclipse.cdt.cmake.core.internal.Activator
Bundle-Vendor: Eclipse CDT
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.11.0",
- org.freemarker;bundle-version="2.3.22",
org.eclipse.debug.core;bundle-version="3.10.0",
org.eclipse.launchbar.core;bundle-version="2.0.0",
- org.eclipse.cdt.core;bundle-version="5.12.0"
+ org.eclipse.cdt.core;bundle-version="5.12.0",
+ org.eclipse.tools.templates.freemarker;bundle-version="1.0.0";visibility:=reexport
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.cdt.cmake.core
diff --git a/build/org.eclipse.cdt.cmake.core/plugin.xml b/build/org.eclipse.cdt.cmake.core/plugin.xml
index 7b159d8230..32a9f20cc1 100644
--- a/build/org.eclipse.cdt.cmake.core/plugin.xml
+++ b/build/org.eclipse.cdt.cmake.core/plugin.xml
@@ -9,23 +9,6 @@
class="org.eclipse.cdt.cmake.core.CMakeNature">
</run>
</runtime>
- <builder
- id="org.eclipse.cdt.cmake.core.cmakeBuilder">
- </builder>
- </extension>
- <extension
- id="cmakeBuilder"
- name="CMake Builder"
- point="org.eclipse.core.resources.builders">
- <builder
- callOnEmptyDelta="true"
- hasNature="true"
- isConfigurable="true"
- supportsConfigurations="true">
- <run
- class="org.eclipse.cdt.cmake.core.internal.CMakeBuilder">
- </run>
- </builder>
</extension>
<extension
point="org.eclipse.launchbar.core.launchBarContributions">
@@ -43,14 +26,6 @@
value="org.eclipse.cdt.cmake.core.cmakeNature">
</test>
</enablement>
- <enablement>
- <instanceof
- value="org.eclipse.core.resources.IProject">
- </instanceof>
- <test
- property="org.eclipse.core.resources.projectNature">
- </test>
- </enablement>
</descriptorType>
<configProvider
class="org.eclipse.cdt.cmake.core.internal.CMakeLocalLaunchConfigurationProvider"
@@ -69,11 +44,11 @@
</launchConfigurationType>
</extension>
<extension
- point="org.eclipse.cdt.core.ScannerInfoProvider2">
+ point="org.eclipse.cdt.core.buildConfigProvider">
<provider
- builder="org.eclipse.cdt.cmake.core.cmakeBuilder"
- class="org.eclipse.cdt.cmake.core.internal.CMakeScannerInfoProvider">
+ class="org.eclipse.cdt.cmake.core.internal.CMakeBuildConfigurationProvider"
+ id="org.eclipse.cdt.cmake.core.provider"
+ natureId="org.eclipse.cdt.cmake.core.cmakeNature">
</provider>
</extension>
-
</plugin>
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java
index c0ae251a07..7b348fd28c 100644
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java
@@ -7,59 +7,64 @@
*******************************************************************************/
package org.eclipse.cdt.cmake.core;
-import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
-import org.eclipse.cdt.cmake.core.internal.CMakeTemplateGenerator;
+import org.eclipse.cdt.cmake.core.internal.Activator;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
+import org.eclipse.cdt.core.build.CBuilder;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IPathEntry;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tools.templates.freemarker.FMProjectGenerator;
+import org.eclipse.tools.templates.freemarker.SourceRoot;
+import org.osgi.framework.Bundle;
-public class CMakeProjectGenerator {
+public class CMakeProjectGenerator extends FMProjectGenerator {
- private final IProject project;
-
- public CMakeProjectGenerator(IProject project) {
- this.project = project;
+ public CMakeProjectGenerator(String manifestFile) {
+ super(manifestFile);
}
- public void generate(IProgressMonitor monitor) throws CoreException {
- // Generate the files
- IFolder sourceFolder = project.getFolder("src"); //$NON-NLS-1$
- if (!sourceFolder.exists()) {
- sourceFolder.create(true, true, monitor);
- }
-
- CMakeTemplateGenerator templateGen = new CMakeTemplateGenerator();
- Map<String, Object> fmModel = new HashMap<>();
- fmModel.put("projectName", project.getName()); //$NON-NLS-1$
+ @Override
+ protected void initProjectDescription(IProjectDescription description) {
+ description
+ .setNatureIds(
+ new String[] { CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID, CMakeNature.ID });
+ ICommand command = description.newCommand();
+ CBuilder.setupBuilder(command);
+ description.setBuildSpec(new ICommand[] { command });
+ }
- IFile sourceFile = sourceFolder.getFile("main.cpp"); //$NON-NLS-1$
- templateGen.generateFile(fmModel, "simple/main.cpp", sourceFile, monitor); //$NON-NLS-1$
- sourceFile = project.getFile("CMakeLists.txt"); //$NON-NLS-1$
- templateGen.generateFile(fmModel, "simple/CMakeLists.txt", sourceFile, monitor); //$NON-NLS-1$
+ @Override
+ public Bundle getSourceBundle() {
+ return Activator.getPlugin().getBundle();
+ }
- // Set up the project
- IProjectDescription projDesc = project.getDescription();
- String[] oldIds = projDesc.getNatureIds();
- String[] newIds = new String[oldIds.length + 3];
- System.arraycopy(oldIds, 0, newIds, 0, oldIds.length);
- newIds[newIds.length - 3] = CProjectNature.C_NATURE_ID;
- newIds[newIds.length - 2] = CCProjectNature.CC_NATURE_ID;
- newIds[newIds.length - 1] = CMakeNature.ID;
- projDesc.setNatureIds(newIds);
+ @Override
+ public void generate(Map<String, Object> model, IProgressMonitor monitor) throws CoreException {
+ super.generate(model, monitor);
- project.setDescription(projDesc, monitor);
+ // Create the source folders
+ IProject project = getProject();
+ List<IPathEntry> entries = new ArrayList<>();
+ for (SourceRoot srcRoot : getManifest().getSrcRoots()) {
+ IFolder sourceFolder = project.getFolder(srcRoot.getDir());
+ if (!sourceFolder.exists()) {
+ sourceFolder.create(true, true, monitor);
+ }
- IPathEntry[] entries = new IPathEntry[] { CoreModel.newOutputEntry(sourceFolder.getFullPath()) };
- CoreModel.getDefault().create(project).setRawPathEntries(entries, monitor);
+ entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath()));
+ }
+ CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
+ monitor);
}
}
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
index 0b33e646af..755d19ad6f 100644
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
@@ -52,7 +52,7 @@ public class CMakeBuildConfiguration extends CBuildConfiguration {
if (!Files.exists(buildDir.resolve("Makefile"))) { //$NON-NLS-1$
// TODO assuming cmake is in the path here, probably need a
// preference in case it isn't.
- List<String> command = Arrays.asList("cmake", //$NON-NLS-1$
+ List<String> command = Arrays.asList("/usr/local/bin/cmake", //$NON-NLS-1$
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", new File(project.getLocationURI()).getAbsolutePath()); //$NON-NLS-1$
ProcessBuilder processBuilder = new ProcessBuilder(command).directory(buildDir.toFile());
Process process = processBuilder.start();
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java
new file mode 100644
index 0000000000..51f6d313f2
--- /dev/null
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.cmake.core.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.build.ICBuildConfiguration;
+import org.eclipse.cdt.core.build.ICBuildConfigurationProvider;
+import org.eclipse.cdt.core.build.IToolChain;
+import org.eclipse.cdt.core.build.IToolChainManager;
+import org.eclipse.core.resources.IBuildConfiguration;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+
+public class CMakeBuildConfigurationProvider implements ICBuildConfigurationProvider {
+
+ public static final String ID = "org.eclipse.cdt.cmake.core.provider"; //$NON-NLS-1$
+
+ @Override
+ public String getId() {
+ return ID;
+ }
+
+ @Override
+ public ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) throws CoreException {
+ if (config.getName().equals(IBuildConfiguration.DEFAULT_CONFIG_NAME)) {
+ IToolChain toolChain = null;
+
+ // try the toolchain for the local target
+ Map<String, String> properties = new HashMap<>();
+ properties.put(IToolChain.ATTR_OS, Platform.getOS());
+ properties.put(IToolChain.ATTR_ARCH, Platform.getOSArch());
+ IToolChainManager toolChainManager = Activator.getService(IToolChainManager.class);
+ for (IToolChain tc : toolChainManager.getToolChainsMatching(properties)) {
+ toolChain = tc;
+ break;
+ }
+
+ // local didn't work, try and find one that does
+ if (toolChain == null) {
+ for (IToolChain tc : toolChainManager.getToolChainsMatching(new HashMap<>())) {
+ toolChain = tc;
+ break;
+ }
+ }
+
+ if (toolChain != null) {
+ return new CMakeBuildConfiguration(config, name, toolChain);
+ } else {
+ // No valid combinations
+ return null;
+ }
+ } else {
+ return new CMakeBuildConfiguration(config, name);
+ }
+ }
+
+}
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeTemplateGenerator.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeTemplateGenerator.java
deleted file mode 100644
index f611e5b827..0000000000
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeTemplateGenerator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.cdt.cmake.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-
-public class CMakeTemplateGenerator {
-
- private final Configuration config;
-
- public CMakeTemplateGenerator() throws CoreException {
- config = new Configuration(Configuration.VERSION_2_3_22);
- URL templateDirURL = FileLocator.find(Activator.getPlugin().getBundle(), new Path("/templates"), null); //$NON-NLS-1$
- try {
- config.setDirectoryForTemplateLoading(new File(FileLocator.toFileURL(templateDirURL).toURI()));
- } catch (IOException | URISyntaxException e) {
- throw new CoreException(Activator.errorStatus("Template configuration", e));
- }
- }
-
- public void generateFile(final Object model, String templateFile, final IFile outputFile, IProgressMonitor monitor)
- throws CoreException {
- try {
- final Template template = config.getTemplate(templateFile);
- try (StringWriter writer = new StringWriter()) {
- template.process(model, writer);
- try (ByteArrayInputStream in = new ByteArrayInputStream(
- writer.getBuffer().toString().getBytes(StandardCharsets.UTF_8))) {
- if (outputFile.exists()) {
- outputFile.setContents(in, true, true, monitor);
- } else {
- outputFile.create(in, true, monitor);
- }
- }
- }
- } catch (IOException | TemplateException e) {
- throw new CoreException(Activator.errorStatus("Processing template " + templateFile, e));
- }
- }
-
-}
diff --git a/build/org.eclipse.cdt.cmake.core/templates/simple/CMakeLists.txt b/build/org.eclipse.cdt.cmake.core/templates/simple/CMakeLists.txt
index 7f20194326..010d47aa33 100644
--- a/build/org.eclipse.cdt.cmake.core/templates/simple/CMakeLists.txt
+++ b/build/org.eclipse.cdt.cmake.core/templates/simple/CMakeLists.txt
@@ -1,3 +1,5 @@
cmake_minimum_required (VERSION 2.6)
+
project (${projectName})
-add_executable(${projectName} src/main.cpp)
+
+add_executable(${projectName} src/${projectName}.cpp)
diff --git a/build/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml b/build/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml
new file mode 100644
index 0000000000..fb88868dd9
--- /dev/null
+++ b/build/org.eclipse.cdt.cmake.core/templates/simple/manifest.xml
@@ -0,0 +1,8 @@
+<templateManifest>
+ <srcRoot dir="src"/>
+ <file src="/templates/simple/CMakeLists.txt"
+ dest="/${projectName}/CMakeLists.txt"/>
+ <file src="/templates/simple/main.cpp"
+ dest="/${projectName}/src/${projectName}.cpp"
+ open="true"/>
+</templateManifest> \ No newline at end of file
diff --git a/build/org.eclipse.cdt.cmake.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.cmake.ui/META-INF/MANIFEST.MF
index 180b8de117..a3b64a155f 100644
--- a/build/org.eclipse.cdt.cmake.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.cmake.ui/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.11.0",
org.eclipse.ui,
org.eclipse.ui.ide,
- org.eclipse.cdt.cmake.core
+ org.eclipse.cdt.cmake.core,
+ org.eclipse.tools.templates.ui;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
diff --git a/build/org.eclipse.cdt.cmake.ui/icons/cmake_logo-main.png b/build/org.eclipse.cdt.cmake.ui/icons/cmake_logo-main.png
new file mode 100644
index 0000000000..f31af16c27
--- /dev/null
+++ b/build/org.eclipse.cdt.cmake.ui/icons/cmake_logo-main.png
Binary files differ
diff --git a/build/org.eclipse.cdt.cmake.ui/plugin.xml b/build/org.eclipse.cdt.cmake.ui/plugin.xml
index 264bb85060..3edcc339bc 100644
--- a/build/org.eclipse.cdt.cmake.ui/plugin.xml
+++ b/build/org.eclipse.cdt.cmake.ui/plugin.xml
@@ -2,18 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.ui.newWizards">
- <wizard
- category="org.eclipse.cdt.ui.newCWizards"
- class="org.eclipse.cdt.cmake.ui.internal.NewCMakeProjectWizard"
- finalPerspective="org.eclipse.cdt.ui.CPerspective"
- icon="icons/newcc_app.gif"
- id="org.eclipse.cdt.cmake.ui.newProjectWizard"
- name="CMake Project"
- project="true">
- </wizard>
- </extension>
- <extension
point="org.eclipse.ui.propertyPages">
<page
class="org.eclipse.cdt.cmake.ui.properties.CMakePropertyPage"
@@ -32,5 +20,27 @@
</enabledWhen>
</page>
</extension>
+ <extension
+ point="org.eclipse.tools.templates.ui.templates">
+ <tag
+ id="org.eclipse.cdt.cmake.ui.tag"
+ label="CMake">
+ </tag>
+ <template
+ icon="icons/cmake_logo-main.png"
+ id="org.eclipse.cdt.cmake.ui.emptyProjectTemplate"
+ label="CMake Project"
+ wizard="org.eclipse.cdt.cmake.ui.internal.NewCMakeProjectWizard">
+ <description>
+ A CMake project with a Hello World executable to get started.
+ </description>
+ <tagReference
+ id="org.eclipse.cdt.ui.cdtTag">
+ </tagReference>
+ <tagReference
+ id="org.eclipse.cdt.cmake.ui.tag">
+ </tagReference>
+ </template>
+ </extension>
</plugin>
diff --git a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/NewCMakeProjectWizard.java b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/NewCMakeProjectWizard.java
index 55b167f004..0e4e431da9 100644
--- a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/NewCMakeProjectWizard.java
+++ b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/NewCMakeProjectWizard.java
@@ -1,49 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
package org.eclipse.cdt.cmake.ui.internal;
-import java.lang.reflect.InvocationTargetException;
-
import org.eclipse.cdt.cmake.core.CMakeProjectGenerator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tools.templates.core.IGenerator;
+import org.eclipse.tools.templates.ui.TemplateWizard;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-public class NewCMakeProjectWizard extends BasicNewProjectResourceWizard {
+public class NewCMakeProjectWizard extends TemplateWizard {
- @Override
- public boolean performFinish() {
- if (!super.performFinish()) {
- return false;
- }
+ private WizardNewProjectCreationPage mainPage;
- IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() {
+ @Override
+ public void addPages() {
+ mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$
@Override
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask("Generating project", 1);
- CMakeProjectGenerator generator = new CMakeProjectGenerator(getNewProject());
- generator.generate(monitor);
- monitor.done();
- } catch (CoreException e) {
- Activator.log(e);
- }
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ createWorkingSetGroup((Composite) getControl(), getSelection(),
+ new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$
+ Dialog.applyDialogFont(getControl());
}
- });
+ };
+ mainPage.setTitle("New Arduino Project"); //$NON-NLS-1$
+ mainPage.setDescription("Specify properties of new Arduino project."); //$NON-NLS-1$
+ this.addPage(mainPage);
+ }
- try {
- getContainer().run(false, true, op);
- } catch (InvocationTargetException | InterruptedException e) {
- return false;
+ @Override
+ protected IGenerator getGenerator() {
+ CMakeProjectGenerator generator = new CMakeProjectGenerator("templates/simple/manifest.xml"); //$NON-NLS-1$
+ generator.setProjectName(mainPage.getProjectName());
+ if (!mainPage.useDefaults()) {
+ generator.setLocationURI(mainPage.getLocationURI());
}
- return true;
+ return generator;
}
}
diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
index 262e811d3e..3b80b6d016 100644
--- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
+++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
@@ -122,6 +122,7 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.2.0,7.0.0)",
org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
com.ibm.icu;bundle-version="4.4.2",
- org.eclipse.e4.ui.css.swt.theme
+ org.eclipse.e4.ui.css.swt.theme,
+ org.eclipse.tools.templates.ui;bundle-version="1.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties
index 2d6978947e..c62374ffde 100644
--- a/core/org.eclipse.cdt.ui/plugin.properties
+++ b/core/org.eclipse.cdt.ui/plugin.properties
@@ -534,8 +534,8 @@ Index.menu=Index
C.Cpp.Index.menu=C/C++ &Index
CDTWizard=CDT New Project Wizard
-CDTproject=CDT Project
-CDTproject.desc=Create a new language-neutral project
+CDTproject=C/C++ Project
+CDTproject.desc=Create a new C or C++ project
CPPproject=C++ Project
CPPproject.desc=Create a new C++ project
Cproject=C Project
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index 930033961e..78f6a992e8 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -458,6 +458,20 @@
%Cproject.desc
</description>
</wizard>
+ <wizard
+ canFinishEarly="false"
+ category="org.eclipse.cdt.ui.newCWizards"
+ class="org.eclipse.cdt.internal.ui.wizards.project.NewCDTProjectWizard"
+ finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ hasPages="true"
+ icon="icons/elcl16/newmngc_app.gif"
+ id="org.eclipse.cdt.ui.wizard.project"
+ name="%CDTproject"
+ project="true">
+ <description>
+ %CDTproject.desc
+ </description>
+ </wizard>
</extension>
<!-- Define the document setup participant for the C/C++ and Assembly Editors -->
@@ -4933,5 +4947,12 @@
</themeid>
</stylesheet>
</extension>
+ <extension
+ point="org.eclipse.tools.templates.ui.templates">
+ <tag
+ id="org.eclipse.cdt.ui.cdtTag"
+ label="C/C++">
+ </tag>
+ </extension>
</plugin>
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/project/NewCDTProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/project/NewCDTProjectWizard.java
new file mode 100644
index 0000000000..1e74e5c610
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/project/NewCDTProjectWizard.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.wizards.project;
+
+import org.eclipse.tools.templates.ui.NewWizard;
+
+public class NewCDTProjectWizard extends NewWizard {
+
+ private static final String cdtTag = "org.eclipse.cdt.ui.cdtTag"; //$NON-NLS-1$
+
+ public NewCDTProjectWizard() {
+ super(cdtTag);
+ setTemplateSelectionPageTitle("Templates for New C/C++ Project");
+ }
+
+}
diff --git a/debug/org.eclipse.cdt.debug.application.product/debug.product b/debug/org.eclipse.cdt.debug.application.product/debug.product
index 3d89ba2fe3..40040a378d 100644
--- a/debug/org.eclipse.cdt.debug.application.product/debug.product
+++ b/debug/org.eclipse.cdt.debug.application.product/debug.product
@@ -264,6 +264,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.e4.ui.workbench"/>
<plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
+ <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
<plugin id="org.eclipse.e4.ui.workbench3"/>
<plugin id="org.eclipse.ecf"/>
@@ -312,6 +313,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.equinox.security"/>
+ <plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
<plugin id="org.eclipse.equinox.security.ui"/>
<plugin id="org.eclipse.equinox.simpleconfigurator"/>
<plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
@@ -345,7 +347,10 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.team.core"/>
<plugin id="org.eclipse.team.ui"/>
<plugin id="org.eclipse.text"/>
+ <plugin id="org.eclipse.tools.templates.core"/>
+ <plugin id="org.eclipse.tools.templates.ui"/>
<plugin id="org.eclipse.ui"/>
+ <plugin id="org.eclipse.ui.cocoa" fragment="true"/>
<plugin id="org.eclipse.ui.console"/>
<plugin id="org.eclipse.ui.editors"/>
<plugin id="org.eclipse.ui.forms"/>
diff --git a/qt/org.eclipse.cdt.qt.ui/icons/qt_logo.png b/qt/org.eclipse.cdt.qt.ui/icons/qt_logo.png
new file mode 100644
index 0000000000..528cdef4d6
--- /dev/null
+++ b/qt/org.eclipse.cdt.qt.ui/icons/qt_logo.png
Binary files differ
diff --git a/qt/org.eclipse.cdt.qt.ui/plugin.xml b/qt/org.eclipse.cdt.qt.ui/plugin.xml
index de058a0092..ae4644538d 100644
--- a/qt/org.eclipse.cdt.qt.ui/plugin.xml
+++ b/qt/org.eclipse.cdt.qt.ui/plugin.xml
@@ -131,16 +131,19 @@
label="Qt">
</tag>
<template
- icon="icons/HelloWorld48.png"
+ icon="icons/qt_logo.png"
id="org.eclipse.cdt.qt.ui.template.helloWorld"
- label="C++/QML HelloWorld"
+ label="Qt C++/QML Application"
wizard="org.eclipse.cdt.internal.qt.ui.wizards.HelloWorldWizard">
+ <description>
+ A simple Hello World Qt Application with main function in C++ and the UI in QML.
+ </description>
<tagReference
id="org.eclipse.cdt.qt.ui.tag">
</tagReference>
- <description>
- A simple Hello World App with main function in C++ and the UI in QML.
- </description>
+ <tagReference
+ id="org.eclipse.cdt.ui.cdtTag">
+ </tagReference>
</template>
</extension>
<extension
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.ui/plugin.xml b/toolchains/arduino/org.eclipse.cdt.arduino.ui/plugin.xml
index 29945bb71f..b42d003a32 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.ui/plugin.xml
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.ui/plugin.xml
@@ -142,12 +142,15 @@
id="org.eclipse.cdt.arduino.ui.template.sketch"
label="Arduino C++ Sketch"
wizard="org.eclipse.cdt.arduino.ui.internal.project.NewArduinoCPPSketchWizard">
- <tagReference
- id="org.eclipse.cdt.arduino.ui.tag">
- </tagReference>
<description>
A single C++ file with empty setup() and loop() functions.
</description>
+ <tagReference
+ id="org.eclipse.cdt.arduino.ui.tag">
+ </tagReference>
+ <tagReference
+ id="org.eclipse.cdt.ui.cdtTag">
+ </tagReference>
</template>
</extension>
<extension

Back to the top