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

com.darylteo.gradle.plugins.vertx.deployments.VertxDeployment.groovy Maven / Gradle / Ivy

The newest version!
package com.darylteo.gradle.plugins.vertx.deployments;

import org.gradle.api.Project

class VertxDeployment implements Iterable {
  public final String name
  public final Project project
  public String description = ''
  public String version = null

  private List modules = []

  public VertxDeployment(Project project, String name) {
    this.name = name
    this.project = project
  }

  public void deploy(Project project, int instances, Closure closure) {
    this._deploy(new VertxProjectDeploymentItem(project, instances), instances, closure)
  }

  public void deploy(String notation, int instances, Closure closure) {
    this._deploy(new VertxModuleDeploymentItem(notation, instances), instances, closure)
  }

  public Iterator iterator() {
    return this.modules.iterator()
  }

  private void _deploy(VertxDeploymentItem item, int instances, Closure closure) {
    closure.delegate = item
    closure.resolveStrategy = Closure.DELEGATE_FIRST
    closure.call(item)

    modules += item
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy