Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Sievers2015-05-26 08:36:21 -0400
committerJan Sievers2015-05-26 08:36:36 -0400
commitcd6402d86945c3834ce8699934a20bc62800fc0f (patch)
tree9fea0699d3ac342faec6fb956616c4eac4110338
parent0dc69ffc7be9fcfae3fc73b55b018fd1f5acadfd (diff)
downloadorg.eclipse.tycho-cd6402d86945c3834ce8699934a20bc62800fc0f.tar.gz
org.eclipse.tycho-cd6402d86945c3834ce8699934a20bc62800fc0f.tar.xz
org.eclipse.tycho-cd6402d86945c3834ce8699934a20bc62800fc0f.zip
Bug 461872: add missing IT
... and use constant when referencing packagin type "p2-installable.unit" Change-Id: I5bbe576621d5f5cdbcac2fddd3920a3552eb0a4f Signed-off-by: Jan Sievers <jan.sievers@sap.com>
-rw-r--r--tycho-its/src/test/java/org/eclipse/tycho/test/packaging/AttachedZipTest.java26
-rw-r--r--tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java11
2 files changed, 34 insertions, 3 deletions
diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/packaging/AttachedZipTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/packaging/AttachedZipTest.java
new file mode 100644
index 000000000..e90c2db00
--- /dev/null
+++ b/tycho-its/src/test/java/org/eclipse/tycho/test/packaging/AttachedZipTest.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.test.packaging;
+
+import org.apache.maven.it.Verifier;
+import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
+import org.junit.Test;
+
+public class AttachedZipTest extends AbstractTychoIntegrationTest {
+
+ @Test
+ public void testAttachP2Metadata() throws Exception {
+ Verifier verifier = getVerifier("/packaging.attachedZip", false);
+ verifier.executeGoal("verify");
+ verifier.verifyErrorFreeLog();
+ }
+}
diff --git a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java b/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java
index 47a030ba4..364175646 100644
--- a/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java
+++ b/tycho-p2/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/P2MetadataMojo.java
@@ -44,12 +44,16 @@ import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.eclipse.sisu.equinox.EquinoxServiceFactory;
+import org.eclipse.tycho.ArtifactType;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.osgitools.DefaultReactorProject;
import org.eclipse.tycho.p2.facade.internal.ArtifactFacade;
import org.eclipse.tycho.p2.metadata.IArtifactFacade;
import org.eclipse.tycho.p2.metadata.IP2Artifact;
import org.eclipse.tycho.p2.metadata.P2Generator;
+import org.eclipse.tycho.plugins.p2.BaselineMode;
+import org.eclipse.tycho.plugins.p2.BaselineReplace;
+import org.eclipse.tycho.plugins.p2.BaselineValidator;
@Mojo(name = "p2-metadata")
public class P2MetadataMojo extends AbstractMojo {
@@ -132,9 +136,10 @@ public class P2MetadataMojo extends AbstractMojo {
artifacts.add(projectDefaultArtifact);
for (Artifact attachedArtifact : project.getAttachedArtifacts()) {
- if (attachedArtifact.getFile() != null && (attachedArtifact.getFile().getName().endsWith(".jar")
- || (attachedArtifact.getFile().getName().endsWith(".zip")
- && project.getPackaging().equals("p2-installable-unit")))) {
+ if (attachedArtifact.getFile() != null
+ && (attachedArtifact.getFile().getName().endsWith(".jar") || (attachedArtifact.getFile()
+ .getName().endsWith(".zip") && project.getPackaging().equals(
+ ArtifactType.TYPE_INSTALLABLE_UNIT)))) {
artifacts.add(new ArtifactFacade(attachedArtifact));
}
}

Back to the top