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

com.atlassian.bamboo.specs.builders.task.BowerTask 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.BowerTaskProperties;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;

import static com.atlassian.bamboo.specs.api.util.InliningUtils.preventInlining;

/**
 * Represents Bamboo task which executes Bower package manager for Node.js.
 *
 * @see bower.io
 */
public class BowerTask extends BaseNodeTask {
    public static final String DEFAULT_BOWER_EXECUTABLE = preventInlining("node_modules/bower/bin/bower");
    public static final String DEFAULT_BOWER_COMMAND = preventInlining("install");

    @NotNull
    private String bowerExecutable = DEFAULT_BOWER_EXECUTABLE;
    @NotNull
    private String command = DEFAULT_BOWER_COMMAND;

    /**
     * Specify path to the Bower executable for this task. Path must be relative to the working directory.
     * 

* Example: {@code node_modules/bower/bin/bower} */ public BowerTask bowerExecutable(@NotNull String bowerExecutable) { ImporterUtils.checkNotNull("bowerExecutable", bowerExecutable); this.bowerExecutable = bowerExecutable; return this; } /** * Command that Bower should run. Defaults to 'install' if not set. */ public BowerTask command(@NotNull String command) { ImporterUtils.checkNotNull("command", command); this.command = command; return this; } @NotNull @Override protected BowerTaskProperties build() { return new BowerTaskProperties( description, taskEnabled, nodeExecutable, environmentVariables, workingSubdirectory, bowerExecutable, command, requirements, conditions); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BowerTask)) { return false; } if (!super.equals(o)) { return false; } BowerTask bowerTask = (BowerTask) o; return bowerExecutable.equals(bowerTask.bowerExecutable) && command.equals(bowerTask.command); } @Override public int hashCode() { return Objects.hash(super.hashCode(), bowerExecutable, command); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy