Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java12
-rw-r--r--tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java33
2 files changed, 41 insertions, 4 deletions
diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
index f2b729a62..1a10ec237 100644
--- a/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
+++ b/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
@@ -53,8 +53,8 @@ import org.osgi.framework.Version;
@Mojo(name = "publish-products", defaultPhase = LifecyclePhase.PACKAGE)
public final class PublishProductMojo extends AbstractPublishMojo {
- // as per http://download.eclipse.org/releases/mars/201506241002/features/org.eclipse.equinox.executable_3.6.200.v20150602-1417.jar
- private static final Version MARS_EXECUTABLE_FEATURE_VERSION = Version.parseVersion("3.6.200.v20150602-1417");
+ // as per http://download.eclipse.org/releases/luna/201502271000/features/org.eclipse.equinox.executable_3.6.102.v20150204-1316.jar
+ private static final Version LUNA_SR2_EXECUTABLE_FEATURE_VERSION = Version.parseVersion("3.6.102.v20150204-1316");
/**
* <p>
@@ -148,14 +148,18 @@ public final class PublishProductMojo extends AbstractPublishMojo {
return;
}
Version featureVersion = Version.parseVersion(executablesFeature.getKey().getVersion());
- if (featureVersion.compareTo(MARS_EXECUTABLE_FEATURE_VERSION) < 0) {
+ if (isLunaOrOlder(featureVersion)) {
throw new MojoExecutionException(
- "Detected pre-Mars launcher feature org.eclipse.equinox.executable version " + featureVersion
+ "Detected Luna or older launcher feature org.eclipse.equinox.executable version " + featureVersion
+ ".\n Native product launchers for MacOSX can only be built against Eclipse Mars or newer."
+ "\nTo fix this, you can either build against Eclipse Mars or newer (recommended) or go back to Tycho <= 0.22.0");
}
}
+ static boolean isLunaOrOlder(Version featureVersion) {
+ return featureVersion.compareTo(LUNA_SR2_EXECUTABLE_FEATURE_VERSION) <= 0;
+ }
+
private boolean macOSConfigured() {
for (TargetEnvironment env : getEnvironments()) {
if (PlatformPropertiesUtils.OS_MACOSX.equals(env.getOs())) {
diff --git a/tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java b/tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java
new file mode 100644
index 000000000..f927979f2
--- /dev/null
+++ b/tycho-p2/tycho-p2-publisher-plugin/src/test/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojoTest.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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
+ *
+ * Contributors:
+ * SAP SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.plugins.p2.publisher;
+
+import static org.eclipse.tycho.plugins.p2.publisher.PublishProductMojo.isLunaOrOlder;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.osgi.framework.Version;
+
+public class PublishProductMojoTest {
+
+ @Test
+ public void testIsLunaOrOlder() throws Exception {
+ Version lunaSR2Version = Version.parseVersion("3.6.102.v20150204-1316");
+ assertTrue(isLunaOrOlder(lunaSR2Version));
+ Version lunaSR0Version = Version.parseVersion("3.6.100.v20140603-1326");
+ assertTrue(isLunaOrOlder(lunaSR0Version));
+ Version marsSR0Version = Version.parseVersion("3.6.200.v20150602-1417");
+ assertFalse(isLunaOrOlder(marsSR0Version));
+ Version marsLiteralQualifierVersion = Version.parseVersion("3.6.200.qualifier");
+ assertFalse(isLunaOrOlder(marsLiteralQualifierVersion));
+ }
+}

Back to the top