diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java deleted file mode 100644 index 08e45b271b..0000000000 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/publisher/ProductFile2.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2015 Sonatype Inc. and others. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Sonatype Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.tycho.p2.publisher; - -import java.util.List; - -import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile; -import org.eclipse.equinox.p2.metadata.IVersionedId; -import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry; -import org.xml.sax.Attributes; - -public class ProductFile2 extends ProductFile { - protected static final String ATTRIBUTE_OS = "os"; - - protected static final String ATTRIBUTE_WS = "ws"; - - protected static final String ATTRIBUTE_ARCH = "arch"; - - public ProductFile2(String location) throws Exception { - super(location); - } - - @Override - protected void processPlugin(Attributes attributes) { - String fragment = attributes.getValue(ATTRIBUTE_FRAGMENT); - String pluginId = attributes.getValue(ATTRIBUTE_ID); - String pluginVersion = attributes.getValue(ATTRIBUTE_VERSION); - boolean isFragment = Boolean.parseBoolean(fragment); - FeatureEntry entry = new FeatureEntry(pluginId, pluginVersion != null ? pluginVersion : GENERIC_VERSION_NUMBER, - true); - entry.setFragment(isFragment); - - String os = attributes.getValue(ATTRIBUTE_OS); - String ws = attributes.getValue(ATTRIBUTE_WS); - String arch = attributes.getValue(ATTRIBUTE_ARCH); - if (os != null || ws != null || arch != null) { - entry.setEnvironment(os, ws, arch, null); - } - - if (isFragment) { - fragments.add(entry); - } else { - plugins.add(entry); - } - } - - @Override - public List getFeatures() { - /* - * Unlike the final IU, the dependency-only IU shall depend on root features so that the - * dependency resolver correctly discovers dependencies to root features from the reactor. - */ - return getFeatures(INCLUDED_FEATURES | ROOT_FEATURES); - } - -} diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2GeneratorImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2GeneratorImpl.java index c1d0d2c6b4..e79b7abbc8 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2GeneratorImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/P2GeneratorImpl.java @@ -81,11 +81,11 @@ import org.eclipse.tycho.p2.publisher.FeatureDependenciesAction; import org.eclipse.tycho.p2.publisher.P2Artifact; import org.eclipse.tycho.p2.publisher.ProductDependenciesAction; -import org.eclipse.tycho.p2.publisher.ProductFile2; import org.eclipse.tycho.p2.publisher.TransientArtifactRepository; import org.eclipse.tycho.p2.publisher.rootfiles.FeatureRootAdvice; import org.eclipse.tycho.p2.repository.ArtifactsIO; import org.eclipse.tycho.p2.repository.MetadataIO; +import org.eclipse.tycho.p2maven.actions.ProductFile2; import org.osgi.framework.BundleException; @Component(role = P2Generator.class)