You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2016/11/18 13:20:37 UTC
svn commit: r1770377 - in /sling/trunk/tooling/ide: eclipse-m2e-ui/
eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/
target-definition/
Author: kwin
Date: Fri Nov 18 13:20:37 2016
New Revision: 1770377
URL: http://svn.apache.org/viewvc?rev=1770377&view=rev
Log:
SLING-6268 make project configurators work also when m2e-tycho is installed
only provide quickfixes for incremental build if m2e-tycho is not installed
Modified:
sling/trunk/tooling/ide/eclipse-m2e-ui/lifecycle-mapping-metadata.xml
sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/MavenBundlePluginProjectConfigurator.java
sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition-dev.target
sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target
Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/lifecycle-mapping-metadata.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/lifecycle-mapping-metadata.xml?rev=1770377&r1=1770376&r2=1770377&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/lifecycle-mapping-metadata.xml (original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/lifecycle-mapping-metadata.xml Fri Nov 18 13:20:37 2016
@@ -21,23 +21,6 @@
</goals>
</pluginExecutionFilter>
<action>
- <!-- bind primary configurator also to m-b-p goals, otherwise secondaryTo attribute does not work, if the primary configurator
- is only bound to another plugin execution) -->
- <configurator>
- <id>org.eclipse.m2e.jdt.javaConfigurator</id>
- </configurator>
- </action>
- </pluginExecution>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <versionRange>[1.0.0,)</versionRange>
- <goals>
- <goal>bundle</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
<configurator>
<id>org.apache.sling.ide.eclipse.m2e.bundlePluginProjectConfigurator</id>
</configurator>
Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml?rev=1770377&r1=1770376&r2=1770377&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml (original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/plugin.xml Fri Nov 18 13:20:37 2016
@@ -53,13 +53,13 @@
class="org.apache.sling.ide.eclipse.m2e.internal.MavenBundlePluginProjectConfigurator"
id="org.apache.sling.ide.eclipse.m2e.bundlePluginProjectConfigurator"
name="Sling Bundle Configurator (for maven-bundle-plugin)"
- secondaryTo="org.eclipse.m2e.jdt.javaConfigurator">
+ runsBefore="maven-bundle-plugin">
</configurator>
<configurator
class="org.apache.sling.ide.eclipse.m2e.internal.BndMavenPluginProjectConfigurator"
id="org.apache.sling.ide.eclipse.m2e.bndPluginProjectConfigurator"
name="Sling Bundle Configurator (for bnd-maven-plugin)"
- secondaryTo="org.eclipse.m2e.jdt.javaConfigurator">
+ runsAfter="org.eclipse.m2e.jdt.javaConfigurator?">
</configurator>
<configurator
id="org.apache.sling.ide.eclipse.m2e.configurator"
Modified: sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/MavenBundlePluginProjectConfigurator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/MavenBundlePluginProjectConfigurator.java?rev=1770377&r1=1770376&r2=1770377&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/MavenBundlePluginProjectConfigurator.java (original)
+++ sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/m2e/internal/MavenBundlePluginProjectConfigurator.java Fri Nov 18 13:20:37 2016
@@ -22,6 +22,8 @@ import org.apache.maven.model.PluginExec
import org.apache.maven.project.MavenProject;
import org.apache.sling.ide.log.Logger;
import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory;
+
public class MavenBundlePluginProjectConfigurator extends AbstractBundleProjectConfigurator {
@@ -30,6 +32,12 @@ public class MavenBundlePluginProjectCon
*/
private static final String MAVEN_BUNDLE_PLUGIN_KEY ="org.apache.felix:maven-bundle-plugin";
+ /**
+ * The configurator id used in <a href="https://github.com/tesla/m2eclipse-tycho/blob/master/org.sonatype.tycho.m2e/lifecycle-mapping-metadata.xml">m2e-tycho</a>.
+ * @see <a href="https://github.com/tesla/m2eclipse-tycho">m2eclipse-tycho Github</a>
+ */
+ private static final String M2E_TYCHO_EXTENSION_PROJECT_CONFIGURATOR_ID = "maven-bundle-plugin";
+
public MavenBundlePluginProjectConfigurator() {
super(false); // this configurator is only bound to goal "bundle" which is not supposed to be executed in
// incremental builds
@@ -42,6 +50,12 @@ public class MavenBundlePluginProjectCon
logger.warn("maven-bundle-plugin not configured!");
return false;
} else {
+ // check if m2elipse-tycho is already installed (which supports incremental builds for "bundle" packagings
+ if (LifecycleMappingFactory.createProjectConfigurator(M2E_TYCHO_EXTENSION_PROJECT_CONFIGURATOR_ID) != null) {
+ logger.trace("Project configurator with id '" + M2E_TYCHO_EXTENSION_PROJECT_CONFIGURATOR_ID + "' found -> m2e-tycho installed.");
+ return true;
+ }
+
String version = bundlePlugin.getVersion();
if (version == null) {
logger.warn("Could not retrieve used version of maven-bundle-plugin!");
@@ -63,15 +77,14 @@ public class MavenBundlePluginProjectCon
if (supportIncrementalBuildConfiguration == null || !Boolean.parseBoolean(supportIncrementalBuildConfiguration.getValue())) {
logger.warn("Although using maven-bundle-plugin in a version >= 3.2.0, the incremental build support was not enabled.");
} else if (exportScrConfiguration == null || !Boolean.parseBoolean(exportScrConfiguration.getValue())) {
- logger.warn("Although using maven-bundle-plugin in a version >= 3.2.0, component descriptors are not exported (exportScr=false) .");
+ logger.warn("Although using maven-bundle-plugin in a version >= 3.2.0 with incremental build support enabled, component descriptors are not exported (exportScr=false) .");
} else {
logger.trace("Using maven-bundle-plugin in a version >= 3.2.0 with the incremental build support correctly enabled.");
return true;
}
}
} else {
- logger.warn("maven-bundle-plugin in a version < 3.2.0 does not support incremental builds.");
- return false;
+ logger.warn("maven-bundle-plugin in a version < 3.2.0 does not natively support incremental builds.");
}
}
return false;
Modified: sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition-dev.target
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition-dev.target?rev=1770377&r1=1770376&r2=1770377&view=diff
==============================================================================
--- sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition-dev.target (original)
+++ sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition-dev.target Fri Nov 18 13:20:37 2016
@@ -18,10 +18,8 @@
<?pde version="3.8"?><target name="Sling IDE Tools (dev)" sequenceNumber="47">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.swtbot.feature.group" version="2.3.0.201506081302"/>
-<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.3.0.201506081302"/>
-<unit id="org.eclipse.swtbot.eclipse.test.junit.feature.group" version="2.3.0.201506081302"/>
-<repository location="http://download.eclipse.org/technology/swtbot/releases/2.3.0/"/>
+<unit id="org.eclipse.m2e.feature.feature.group" version="1.6.0.20150526-2032"/>
+<repository location="http://download.eclipse.org/technology/m2e/releases/1.6"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.apache.commons.collections" version="3.2.0.v2013030210310"/>
@@ -35,7 +33,12 @@
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.m2e.feature.feature.group" version="1.5.1.20150109-1820"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.3.0.201506081302"/>
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.3.0.201506081302"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit.feature.group" version="2.3.0.201506081302"/>
+<repository location="http://download.eclipse.org/technology/swtbot/releases/2.3.0/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.401.v201410241731"/>
<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.4.101.v201410241731"/>
<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.6.3.v201501292352"/>
Modified: sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target?rev=1770377&r1=1770376&r2=1770377&view=diff
==============================================================================
--- sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target (original)
+++ sling/trunk/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target Fri Nov 18 13:20:37 2016
@@ -18,7 +18,6 @@
<?pde version="3.8"?><target name="Sling IDE Tools" sequenceNumber="46">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.m2e.feature.feature.group" version="1.5.1.20150109-1820"/>
<unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.401.v201410241731"/>
<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.4.101.v201410241731"/>
<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.6.3.v201501292352"/>
@@ -46,5 +45,9 @@
<unit id="org.apache.commons.lang" version="2.6.0.v201205030909"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository/"/>
</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.m2e.feature.feature.group" version="1.6.0.20150526-2032"/>
+<repository location="http://download.eclipse.org/technology/m2e/releases/1.6"/>
+</location>
</locations>
</target>