com.bmuschko.gradle.docker.tasks.network.DockerExistingNetwork.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-plugin Show documentation
Show all versions of gradle-docker-plugin Show documentation
Gradle plugin for managing Docker images and containers.
package com.bmuschko.gradle.docker.tasks.network
import com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
import groovy.transform.CompileStatic
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
import java.util.concurrent.Callable
@CompileStatic
abstract class DockerExistingNetwork extends AbstractDockerRemoteApiTask {
/**
* The ID or name of the network to perform the operation on. The network for the provided ID has to be created first.
*/
@Input
final Property networkId = project.objects.property(String)
/**
* Sets the target network ID or name.
*
* @param networkId Network ID or name
* @see #targetNetworkId(Callable)
* @see #targetNetworkId(Provider)
*/
void targetNetworkId(String networkId) {
this.networkId.set(networkId)
}
/**
* Sets the target network ID or name.
*
* @param networkId Network ID or name as Callable
* @see #targetNetworkId(String)
* @see #targetNetworkId(Provider)
*/
void targetNetworkId(Callable networkId) {
targetNetworkId(project.provider(networkId))
}
/**
* Sets the target network ID or name.
*
* @param networkId Network ID or name as Provider
* @see #targetNetworkId(String)
* @see #targetNetworkId(Callable)
*/
void targetNetworkId(Provider networkId) {
this.networkId.set(networkId)
}
}