use of org.gradle.api.publish.PublicationArtifact in project gradle by gradle.
the class Sign method sign.
/**
* Configures the task to sign every artifact of the given publications
*
* @since 4.8
*/
public void sign(Publication... publications) {
for (Publication publication : publications) {
PublicationInternal<?> publicationInternal = (PublicationInternal<?>) publication;
dependsOn((Callable<Set<? extends PublicationArtifact>>) () -> {
return publicationInternal.getPublishableArtifacts().matching(this::isNoSignatureArtifact);
});
publicationInternal.allPublishableArtifacts(artifact -> {
if (isNoSignatureArtifact(artifact)) {
addSignature(new Signature(artifact, artifact::getFile, null, null, this, this));
}
});
publicationInternal.whenPublishableArtifactRemoved(this::removeSignature);
}
}
Aggregations