
com.atlassian.clover.api.ci.CIOptions Maven / Gradle / Ivy
package com.atlassian.clover.api.ci;
import java.io.File;
public class CIOptions {
private final boolean optimize;
private final boolean html;
private final boolean json;
private final boolean historical;
private final String licenseCert;
private final File license;
private final File historyDir;
private final boolean fullClean;
private CIOptions(Builder builder) {
this.optimize = builder.optimize;
this.html = builder.html;
this.json = builder.json;
this.historical = builder.historical;
this.licenseCert = builder.licenseCert;
this.license = builder.license;
this.historyDir = builder.historyDir;
this.fullClean = builder.fullClean;
}
public boolean isOptimize() {
return optimize;
}
public boolean isHtml() {
return html;
}
public boolean isJson() {
return json;
}
public String getLicenseCert() {
return licenseCert;
}
public File getLicense() {
return license;
}
public File getHistoryDir() {
return historyDir;
}
public boolean isHistorical() {
return historical;
}
public boolean isFullClean() {
return fullClean;
}
/**
* This class is used to configure one of the {@link com.atlassian.clover.api.ci.Integrator} classes.
*
* Obtain a set of CIOptions using the static factory method: CIOptions.newDefaults().
*/
public static class Builder {
private boolean optimize = false;
private boolean html = true;
private boolean json = false;
private boolean historical = false;
private String licenseCert = null;
private File license = null;
private File historyDir = null;
private boolean fullClean = true;
/**
* Creates a brand new CIOptionsBuilder with default values.
*/
public Builder() {
}
/**
* Whether or not to optimize tests.
*
* @param optimize true if tests should be optimized using Clover's test optimization
* @return these options, but with optimization turned on.
*/
public Builder optimize(boolean optimize) {
this.optimize = optimize;
return this;
}
public Builder html(boolean html) {
this.html = html;
return this;
}
public Builder json(boolean json) {
this.json = json;
return this;
}
public Builder historical(boolean historical) {
this.historical = historical;
return this;
}
/**
* Use the given Clover license String for the build.
*
* @param licenseCert the license cert (including newline chars) to use
*/
public Builder licenseCert(String licenseCert) {
this.licenseCert = licenseCert;
return this;
}
/**
* Use the given Clover license Path for the build.
*
* @param license a file representing the clover license
*/
public Builder license(File license) {
this.license = license;
return this;
}
/**
* Use the given history directory to store Clover artifacts which are needed by Clover between builds.
*
* For example: Clover history points used to generate a Clover Historical Report,
* or the clover.snapshot file needed for Test Optimization.
*
* @param historyDir a directory to store Clover data between builds.
*/
public Builder historyDir(File historyDir) {
this.historyDir = historyDir;
return this;
}
/**
* @param fullClean true if all previous clover data (excluding the historydir) should be removed before running
* the build.
*/
public Builder fullClean(boolean fullClean) {
this.fullClean = fullClean;
return this;
}
public CIOptions build() {
return new CIOptions(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy