From 8e71e565de6613e4a37aa787e16e7a425ce3c198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Fri, 16 Feb 2024 10:25:23 +0100 Subject: [PATCH] Import SlicingOptions from P2 --- .../eclipse/tycho/p2maven/SlicingOptions.java | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/SlicingOptions.java diff --git a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/SlicingOptions.java b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/SlicingOptions.java new file mode 100644 index 0000000000..3047eaa943 --- /dev/null +++ b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/SlicingOptions.java @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright (c) 2009, 2017 IBM Corporation 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.internal.repository.tools; + +import java.util.Hashtable; +import java.util.Map; + +public class SlicingOptions { + private boolean includeOptionalDependencies = true; + private boolean everythingGreedy = true; + private boolean forceFilterTo = true; + private boolean considerStrictDependencyOnly = false; + private boolean followOnlyFilteredRequirements = false; + private boolean latestVersion = false; + private boolean resolve = false; + + private Map filter = null; + + public boolean includeOptionalDependencies() { + return includeOptionalDependencies; + } + + public void includeOptionalDependencies(boolean optional) { + this.includeOptionalDependencies = optional; + } + + public boolean isEverythingGreedy() { + return everythingGreedy; + } + + public void everythingGreedy(boolean greedy) { + this.everythingGreedy = greedy; + } + + public boolean forceFilterTo() { + return forceFilterTo; + } + + public void forceFilterTo(boolean forcedTo) { + this.forceFilterTo = forcedTo; + } + + public boolean considerStrictDependencyOnly() { + return considerStrictDependencyOnly; + } + + public void considerStrictDependencyOnly(boolean strict) { + this.considerStrictDependencyOnly = strict; + } + + public Map getFilter() { + if (filter == null) + filter = new Hashtable<>(); + return filter; + } + + public void setFilter(Map filter) { + this.filter = filter; + } + + public void followOnlyFilteredRequirements(boolean onlyFiltered) { + this.followOnlyFilteredRequirements = onlyFiltered; + } + + public boolean followOnlyFilteredRequirements() { + return followOnlyFilteredRequirements; + } + + public boolean latestVersionOnly() { + return latestVersion; + } + + public void latestVersionOnly(boolean latest) { + this.latestVersion = latest; + } + + public void installTimeLikeResolution(boolean resolve) { + this.resolve = resolve; + } + + public boolean getInstallTimeLikeResolution() { + return resolve; + } +}