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

hudson.matrix.MatrixRun Maven / Gradle / Ivy

package hudson.matrix;

import hudson.model.Build;
import hudson.maven.*;

import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.Calendar;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.Ancestor;

/**
 * Execution of {@link MatrixConfiguration}.
 *
 * @author Kohsuke Kawaguchi
 */
public class MatrixRun extends Build {
    public MatrixRun(MatrixConfiguration job) throws IOException {
        super(job);
    }

    public MatrixRun(MatrixConfiguration job, Calendar timestamp) {
        super(job, timestamp);
    }

    public MatrixRun(MatrixConfiguration project, File buildDir) throws IOException {
        super(project, buildDir);
    }

    public String getUpUrl() {
        StaplerRequest req = Stapler.getCurrentRequest();
        if(req!=null) {
            List ancs = req.getAncestors();
            for( int i=1; i ancs = req.getAncestors();
            for( int i=1; i getBuildVariables() {
        // pick up user axes
        return new HashMap(getParent().getCombination());
    }

    /**
     * If the parent {@link MatrixRun} is kept, keep this record, too.
     */
    @Override
    public String getWhyKeepLog() {
        MatrixBuild pb = getParentBuild();
        if(pb!=null && pb.getWhyKeepLog()!=null)
            return hudson.maven.Messages.MavenBuild_KeptBecauseOfParent(pb);
        return super.getWhyKeepLog();
    }

    @Override
    public MatrixConfiguration getParent() {// don't know why, but javac wants this
        return super.getParent();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy