aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Oehme2013-11-29 04:16:53 (EST)
committerStefan Oehme2013-11-30 07:53:38 (EST)
commitc3c386064fe36d6e3890c0ffc36b246ca5e3c7a3 (patch)
tree62b5e357713c142bcd60f209ea915426f6771ecb
parentcb9052f1bdb2ef6a711a04608899fd5865c11cf2 (diff)
downloadorg.eclipse.xtext-c3c386064fe36d6e3890c0ffc36b246ca5e3c7a3.zip
org.eclipse.xtext-c3c386064fe36d6e3890c0ffc36b246ca5e3c7a3.tar.gz
org.eclipse.xtext-c3c386064fe36d6e3890c0ffc36b246ca5e3c7a3.tar.bz2
[422456] Automatically add Xtext nature when the Xtend compiler pluginrefs/changes/73/19173/1
is found in the pom.xml Signed-off-by: Stefan Oehme <stefan.oehme@itemis.de>
-rw-r--r--plugins/org.eclipse.xtend.m2e/.classpath13
-rw-r--r--plugins/org.eclipse.xtend.m2e/META-INF/MANIFEST.MF19
-rw-r--r--plugins/org.eclipse.xtend.m2e/build.properties16
-rw-r--r--plugins/org.eclipse.xtend.m2e/lifecycle-mapping-metadata.xml36
-rw-r--r--plugins/org.eclipse.xtend.m2e/plugin.xml24
-rw-r--r--plugins/org.eclipse.xtend.m2e/src/org/eclipse/xtend/m2e/XtendProjectConfigurator.java20
6 files changed, 82 insertions, 46 deletions
diff --git a/plugins/org.eclipse.xtend.m2e/.classpath b/plugins/org.eclipse.xtend.m2e/.classpath
index c835067..45f024e 100644
--- a/plugins/org.eclipse.xtend.m2e/.classpath
+++ b/plugins/org.eclipse.xtend.m2e/.classpath
@@ -1,6 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.xtend.m2e/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtend.m2e/META-INF/MANIFEST.MF
index 73351e6..29d132f 100644
--- a/plugins/org.eclipse.xtend.m2e/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtend.m2e/META-INF/MANIFEST.MF
@@ -1,8 +1,11 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.xtend.m2e;singleton:=true
-Bundle-Version: 2.5.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.m2e.core;bundle-version="1.0.0";resolution:=optional
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.xtend.m2e;singleton:=true
+Bundle-Version: 2.5.0.qualifier
+Bundle-Localization: plugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.m2e.core;bundle-version="1.0.0",
+ org.eclipse.core.resources,
+ org.eclipse.equinox.registry,
+ org.eclipse.xtext.ui;bundle-version="2.5.0"
diff --git a/plugins/org.eclipse.xtend.m2e/build.properties b/plugins/org.eclipse.xtend.m2e/build.properties
index fa2d63f..c8b5a11 100644
--- a/plugins/org.eclipse.xtend.m2e/build.properties
+++ b/plugins/org.eclipse.xtend.m2e/build.properties
@@ -1,7 +1,9 @@
-bin.includes = META-INF/,\
- .,\
- lifecycle-mapping-metadata.xml,\
- plugin.xml,\
- plugin.properties,\
- about.html
-src.includes = about.html
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ lifecycle-mapping-metadata.xml,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,
+src.includes = about.html
diff --git a/plugins/org.eclipse.xtend.m2e/lifecycle-mapping-metadata.xml b/plugins/org.eclipse.xtend.m2e/lifecycle-mapping-metadata.xml
index 1845635..c9ee9e4 100644
--- a/plugins/org.eclipse.xtend.m2e/lifecycle-mapping-metadata.xml
+++ b/plugins/org.eclipse.xtend.m2e/lifecycle-mapping-metadata.xml
@@ -1,18 +1,20 @@
-<lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>xtend-maven-plugin</artifactId>
- <versionRange>[2.2.0,)</versionRange>
- <goals>
- <goal>compile</goal>
- <goal>testCompile</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- </pluginExecutions>
+<lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ <versionRange>[2.2.0,)</versionRange>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <configurator>
+ <id>org.eclipse.xtend.m2e.xtendConfigurator</id>
+ </configurator>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
</lifecycleMappingMetadata> \ No newline at end of file
diff --git a/plugins/org.eclipse.xtend.m2e/plugin.xml b/plugins/org.eclipse.xtend.m2e/plugin.xml
index 251ff8d..df08dff 100644
--- a/plugins/org.eclipse.xtend.m2e/plugin.xml
+++ b/plugins/org.eclipse.xtend.m2e/plugin.xml
@@ -1,8 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.m2e.core.lifecycleMappingMetadataSource">
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappingMetadataSource">
+ </extension>
+ <extension
+ point="org.eclipse.m2e.core.projectConfigurators">
+ <configurator
+ class="org.eclipse.xtend.m2e.XtendProjectConfigurator"
+ id="org.eclipse.xtend.m2e.xtendConfigurator"
+ name="Xtend Project Configurator">
+ </configurator>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.xtend.m2e/src/org/eclipse/xtend/m2e/XtendProjectConfigurator.java b/plugins/org.eclipse.xtend.m2e/src/org/eclipse/xtend/m2e/XtendProjectConfigurator.java
new file mode 100644
index 0000000..b31691f
--- /dev/null
+++ b/plugins/org.eclipse.xtend.m2e/src/org/eclipse/xtend/m2e/XtendProjectConfigurator.java
@@ -0,0 +1,20 @@
+package org.eclipse.xtend.m2e;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+import org.eclipse.xtext.ui.XtextProjectHelper;
+
+public class XtendProjectConfigurator extends AbstractProjectConfigurator {
+
+ /**
+ * This is enough configuration for now, as Xtend will add the required
+ * source folders itself the moment it starts compiling.
+ */
+ @Override
+ public void configure(ProjectConfigurationRequest request,
+ IProgressMonitor monitor) throws CoreException {
+ addNature(request.getProject(), XtextProjectHelper.NATURE_ID, monitor);
+ }
+} \ No newline at end of file