forked from eclipse-tycho/tycho
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix eclipse-tycho#203 : assemble-maven-repository should include PGP …
…signatures in the P2 site Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
- Loading branch information
Showing
4 changed files
with
383 additions
and
88 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
....p2.tools.impl/src/main/java/org/eclipse/tycho/p2/tools/publisher/PGPSignatureAdvice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Christoph Läubrich 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: | ||
* Christoph Läubrich - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.p2.tools.publisher; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.equinox.p2.metadata.IInstallableUnit; | ||
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription; | ||
import org.eclipse.equinox.p2.metadata.Version; | ||
import org.eclipse.equinox.p2.publisher.AbstractAdvice; | ||
import org.eclipse.equinox.p2.publisher.actions.IPropertyAdvice; | ||
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; | ||
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor; | ||
|
||
@SuppressWarnings("restriction") | ||
public class PGPSignatureAdvice extends AbstractAdvice implements IPropertyAdvice { | ||
private final String id; | ||
private final Version version; | ||
private final String signature; | ||
|
||
public PGPSignatureAdvice(String id, Version version, String signature) { | ||
this.id = id; | ||
this.version = version; | ||
this.signature = signature; | ||
} | ||
|
||
@Override | ||
protected String getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
protected Version getVersion() { | ||
return version; | ||
} | ||
|
||
@Override | ||
public Map<String, String> getInstallableUnitProperties(InstallableUnitDescription iu) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isApplicable(String configSpec, boolean includeDefault, String candidateId, | ||
Version candidateVersion) { | ||
return id.equals(candidateId) && version.equals(candidateVersion); | ||
} | ||
|
||
@Override | ||
public Map<String, String> getArtifactProperties(IInstallableUnit iu, IArtifactDescriptor descriptor) { | ||
// workaround Bug 539672 | ||
if (descriptor instanceof ArtifactDescriptor) { | ||
ArtifactDescriptor artifactDescriptor = (ArtifactDescriptor) descriptor; | ||
artifactDescriptor.setProperty("pgp.signatures", signature); | ||
} | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.