com.atlassian.bamboo.specs.builders.task.BaseNodeTask Maven / Gradle / Ivy
package com.atlassian.bamboo.specs.builders.task;
import com.atlassian.bamboo.specs.api.builders.task.Task;
import com.atlassian.bamboo.specs.model.task.BaseNodeTaskProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotNull;
/**
* Base class for Node.js related tasks.
*
* @param type of task
* @param type of properties generated by the task
*/
public abstract class BaseNodeTask extends Task {
@NotNull
protected String nodeExecutable;
@Nullable
protected String environmentVariables;
@Nullable
protected String workingSubdirectory;
/**
* Sets which Node.js executable to use.
*/
public B nodeExecutable(@NotNull String nodeExecutable) {
checkNotNull("nodeExecutable", nodeExecutable);
this.nodeExecutable = nodeExecutable;
return (B) this;
}
/**
* Sets environment variables for this task.
*/
public B environmentVariables(@Nullable String environmentVariables) {
this.environmentVariables = environmentVariables;
return (B) this;
}
/**
* Sets the working subdirectory for this task.
*/
public B workingSubdirectory(@Nullable String workingSubdirectory) {
this.workingSubdirectory = workingSubdirectory;
return (B) this;
}
}