Skip to content

Commit

Permalink
Merge pull request #725 from eclipse-passage/572735
Browse files Browse the repository at this point in the history
Bug 572735 - [Passage] PDE templates utilize more info for requirement
  • Loading branch information
ruspl-afed authored Apr 9, 2021
2 parents 68236ef + 65444c5 commit 42e31d2
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Bundle-SymbolicName: org.eclipse.passage.ldc.pde.ui.templates;singleton:=true
Bundle-Version: 0.6.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.passage.ldc.internal.pde.ui.templates;x-internal:=true,
org.eclipse.passage.ldc.internal.pde.ui.templates.e3;x-internal:=true,
org.eclipse.passage.ldc.internal.pde.ui.templates.e4;x-internal:=true,
org.eclipse.passage.ldc.internal.pde.ui.templates.fullfeather;x-internal:=true,
org.eclipse.passage.ldc.internal.pde.ui.templates.i18n;x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.core.resources;bundle-version="0.0.0",
Expand Down
6 changes: 3 additions & 3 deletions bundles/org.eclipse.passage.ldc.pde.ui.templates/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<extension
point="org.eclipse.pde.ui.pluginContent">
<wizard
class="org.eclipse.passage.ldc.internal.pde.ui.templates.LicensedE3ProductContentWizard"
class="org.eclipse.passage.ldc.internal.pde.ui.templates.e3.LicensedE3ProductContentWizard"
icon="platform:/plugin/org.eclipse.passage.lic.jface/$nl$/icons/obj16/passage.png"
id="org.eclipse.passage.ldc.pde.ui.pluginContent.rcp3"
java="true"
Expand All @@ -30,7 +30,7 @@
</description>
</wizard>
<wizard
class="org.eclipse.passage.ldc.internal.pde.ui.templates.LicensedE4ProductContentWizard"
class="org.eclipse.passage.ldc.internal.pde.ui.templates.e4.LicensedE4ProductContentWizard"
icon="platform:/plugin/org.eclipse.passage.lic.jface/$nl$/icons/obj16/passage.png"
id="org.eclipse.passage.ldc.pde.ui.pluginContent.rcp4"
java="true"
Expand All @@ -44,7 +44,7 @@
</description>
</wizard>
<wizard
class="org.eclipse.passage.ldc.internal.pde.ui.templates.LicensedE4FullFeatherProductContentWizard"
class="org.eclipse.passage.ldc.internal.pde.ui.templates.fullfeather.LicensedE4FullFeatherProductContentWizard"
icon="platform:/plugin/org.eclipse.passage.lic.jface/$nl$/icons/obj16/passage.png"
id="org.eclipse.passage.ldc.pde.ui.fullFeatherPassageProduct.rcp4"
java="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -192,4 +192,12 @@ protected List<String> getRCP4Dependencies() {
"org.apache.logging.log4j"); //$NON-NLS-1$
}

protected Requirement createProductRequirement(String product) {
return new DefaultProductRequirement(() -> product, //
() -> getManifestHeader("Bundle-Name"), // //$NON-NLS-1$
() -> getManifestHeader("Bundle-Version"), // //$NON-NLS-1$
() -> getManifestHeader("Bundle-Vendor")// //$NON-NLS-1$
).get();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -22,22 +22,27 @@
@SuppressWarnings("restriction")
final class DefaultProductRequirement implements Supplier<Requirement> {

private final String product;
private final String version;
private final Supplier<String> product;
private final Supplier<String> version;
private final Supplier<String> name;
private final Supplier<String> provider;

DefaultProductRequirement(String product, String version) {
DefaultProductRequirement(Supplier<String> product, Supplier<String> name, Supplier<String> version,
Supplier<String> provider) {
this.product = product;
this.version = version;
this.name = name;
this.provider = provider;
}

@Override
public Requirement get() {
return new BaseRequirement(//
new BaseFeature(//
product, //
version, //
product, //
"Eclipse Passage Template"), //$NON-NLS-1$
product.get(), //
version.get(), //
name.get(), //
provider.get()), //
new RestrictionLevel.Warning(), //
this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;

//FIXME: AF: we need to split this class
public class HelpContexts {

public static final String PREFIX = "org.eclipse.passage.ldc.doc.user"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.e3;

import org.eclipse.pde.ui.templates.ITemplateSection;
import org.eclipse.pde.ui.templates.NewPluginTemplateWizard;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.e3;

import java.util.Arrays;
import java.util.List;
Expand All @@ -19,6 +19,8 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.passage.ldc.internal.pde.ui.templates.BaseLicensedTemplateSection;
import org.eclipse.passage.ldc.internal.pde.ui.templates.HelpContexts;
import org.eclipse.passage.ldc.internal.pde.ui.templates.i18n.PdeUiTemplatesMessages;
import org.eclipse.passage.lic.internal.api.requirements.Requirement;
import org.eclipse.pde.core.plugin.IPluginBase;
Expand Down Expand Up @@ -90,7 +92,7 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException {

@Override
protected List<Requirement> requirements(String product) {
return Arrays.asList(new DefaultProductRequirement(product, getManifestHeader("Bundle-Version")).get()); //$NON-NLS-1$
return Arrays.asList(createProductRequirement(product));
}

private void createPerspectiveExtension() throws CoreException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.e4;

import org.eclipse.pde.ui.templates.ITemplateSection;
import org.eclipse.pde.ui.templates.NewPluginTemplateWizard;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2020 ArSysOp
* Copyright (c) 2019, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.e4;

import java.util.Arrays;
import java.util.List;
Expand All @@ -19,6 +19,8 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.passage.ldc.internal.pde.ui.templates.BaseLicensedTemplateSection;
import org.eclipse.passage.ldc.internal.pde.ui.templates.HelpContexts;
import org.eclipse.passage.ldc.internal.pde.ui.templates.i18n.PdeUiTemplatesMessages;
import org.eclipse.passage.lic.internal.api.requirements.Requirement;
import org.eclipse.pde.core.plugin.IPluginBase;
Expand Down Expand Up @@ -85,7 +87,7 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException {

@Override
protected List<Requirement> requirements(String product) {
return Arrays.asList(new DefaultProductRequirement(product, getManifestHeader("Bundle-Version")).get()); //$NON-NLS-1$
return Arrays.asList(createProductRequirement(product));
}

private void createProductExtension() throws CoreException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.fullfeather;

import org.eclipse.pde.ui.templates.ITemplateSection;
import org.eclipse.pde.ui.templates.NewPluginTemplateWizard;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.ldc.internal.pde.ui.templates;
package org.eclipse.passage.ldc.internal.pde.ui.templates.fullfeather;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -20,7 +20,8 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.passage.ldc.internal.pde.ui.templates.fullfeather.AntimagicShieldFeatureLicRequirement;
import org.eclipse.passage.ldc.internal.pde.ui.templates.BaseLicensedTemplateSection;
import org.eclipse.passage.ldc.internal.pde.ui.templates.HelpContexts;
import org.eclipse.passage.ldc.internal.pde.ui.templates.i18n.PdeUiTemplatesMessages;
import org.eclipse.passage.lic.internal.api.requirements.Requirement;
import org.eclipse.pde.core.plugin.IPluginBase;
Expand Down Expand Up @@ -78,7 +79,7 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException {
@Override
protected List<Requirement> requirements(String product) {
return Arrays.asList(//
new DefaultProductRequirement(product, getManifestHeader("Bundle-Version")).get(), //$NON-NLS-1$
createProductRequirement(product), //
new AntimagicShieldFeatureLicRequirement().get());
}

Expand Down

0 comments on commit 42e31d2

Please sign in to comment.