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

com.atlassian.bamboo.specs.builders.task.NodeTask Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.builders.task;

import com.atlassian.bamboo.specs.api.validators.common.ImporterUtils;
import com.atlassian.bamboo.specs.model.task.NodeTaskProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;

/**
 * Represents a generic task that executes a Node.js script.
 * 

* Bamboo provides additional tasks for more specific Node.js tools, which are suggested to use instead of this task for * convenience. For example: {@link NpmTask}, {@link GulpTask}. * * @see nodejs.org */ public class NodeTask extends BaseNodeTask { @NotNull private String script; @Nullable private String arguments; /** * Script to execute with node (e.g. 'server.js', 'application.js'). */ public NodeTask script(@NotNull String script) { ImporterUtils.checkNotNull("script", script); this.script = script; return this; } /** * Additional command line arguments to pass to node when executing the script. */ public NodeTask arguments(@Nullable String arguments) { this.arguments = arguments; return this; } @NotNull @Override protected NodeTaskProperties build() { return new NodeTaskProperties( description, taskEnabled, nodeExecutable, environmentVariables, workingSubdirectory, script, arguments, requirements, conditions); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof NodeTask)) { return false; } if (!super.equals(o)) { return false; } NodeTask nodeTask = (NodeTask) o; return script.equals(nodeTask.script) && Objects.equals(arguments, nodeTask.arguments); } @Override public int hashCode() { return Objects.hash(super.hashCode(), script, arguments); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy