Example usage for org.eclipse.jgit.api TagCommand setSigned

List of usage examples for org.eclipse.jgit.api TagCommand setSigned

Introduction

In this page you can find the example usage for org.eclipse.jgit.api TagCommand setSigned.

Prototype

public TagCommand setSigned(boolean signed) 

Source Link

Document

If set to true the Tag command creates a signed tag object.

Usage

From source file:org.ajoberstar.gradle.git.tasks.GitTag.java

License:Apache License

/**
 * Tags the HEAD./*from  w ww.j  a  va  2  s  . c  o  m*/
 */
@TaskAction
public void tag() {
    TagCommand cmd = getGit().tag();
    cmd.setName(getTagName());
    cmd.setMessage(getMessage());
    cmd.setSigned(getSign());
    cmd.setForceUpdate(getForce());
    if (tagger != null) {
        cmd.setTagger(getTagger());
    }

    try {
        cmd.call();
    } catch (ConcurrentRefUpdateException e) {
        throw new GradleException("Another process is accessing or updating the ref.", e);
    } catch (InvalidTagNameException e) {
        throw new GradleException("Invalid tag name: " + getTagName(), e);
    } catch (NoHeadException e) {
        throw new GradleException("Cannot tag without a HEAD revision.", e);
    } catch (GitAPIException e) {
        throw new GradleException("Problem with tag.", e);
    }
}