All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajoberstar.gradle.git.publish.GitPublishExtension Maven / Gradle / Ivy

There is a newer version: 4.2.2
Show newest version
package org.ajoberstar.gradle.git.publish;

import javax.inject.Inject;

import org.gradle.api.Action;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.Project;
import org.gradle.api.file.CopySpec;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.util.PatternFilterable;

public class GitPublishExtension {
  private final NamedDomainObjectContainer publications;

  @Inject
  public GitPublishExtension(Project project, ObjectFactory objectFactory) {
    this.publications = objectFactory.domainObjectContainer(GitPublication.class, name -> new GitPublication(name, project, objectFactory));
  }

  public NamedDomainObjectContainer getPublications() {
    return publications;
  }

  public void publications(Action> action) {
    action.execute(publications);
  }

  public DirectoryProperty getRepoDir() {
    return publications.getByName("main").getRepoDir();
  }

  public Property getRepoUri() {
    return publications.getByName("main").getRepoUri();
  }

  public Property getReferenceRepoUri() {
    return publications.getByName("main").getReferenceRepoUri();
  }

  public Property getBranch() {
    return publications.getByName("main").getBranch();
  }

  public Property getCommitMessage() {
    return publications.getByName("main").getCommitMessage();
  }

  public Property getSign() {
    return publications.getByName("main").getSign();
  }

  public CopySpec getContents() {
    return publications.getByName("main").getContents();
  }

  public void contents(Action action) {
    publications.getByName("main").contents(action);
  }

  public PatternFilterable getPreserve() {
    return publications.getByName("main").getPreserve();
  }

  public void preserve(Action action) {
    publications.getByName("main").preserve(action);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy