io.knowledgelinks.cicd.semantic.versioning.api.BuildInfo Maven / Gradle / Ivy
package io.knowledgelinks.cicd.semantic.versioning.api;
/*-
* #%L
* Semantic Versioning
* %%
* Copyright (C) 2022 - 2023 Knowledgelinks
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import io.knowledgelinks.cicd.semantic.versioning.enums.ArtifactTypes;
import io.knowledgelinks.cicd.semantic.versioning.enums.BranchTypes;
/**
* A DTO object that stores information about the current build
*
* @author mstabile75
*
*/
public class BuildInfo {
/**
* The url to the git repository for git
* ls-remote calls
*/
String respositoryUrl = null;
/**
* The name of the repository branch that is being used for the build
*/
String branch = null;
/**
* The desired major version to be used in the build.
*/
int majorVersion = -1;
/**
* The desired minor version to be used in the build.
*/
int minorVersion = -1;
/**
* The build tool generated build number.
*/
int buildNumber = -1;
/**
* The {@link BranchTypes} [RELEASE, MASTER, FEATURE, NONE] that is being build. Calculated and
* set via parsers and/or the {@link BuildInfoBuilder} class.
*/
private BranchTypes branchType = BranchTypes.NONE;
/**
* The base artifact name / project name that is used to create the build artifact filename.
*
* For Example:
*
*
* artifactName: my-project
* Java:
* my-project-VERSION.jar
* Python:
* my_project-VERSION-py3-none-any.whl
*
*/
String artifactName = null;
private String lastReleaseVersion;
private String lastBranchVersion;
private String buildVersion;
List artifactTypes = new ArrayList<>();
private Map buildArtifacts;
public String getRespositoryUrl() {
return respositoryUrl;
}
public void setRespositoryUrl(String respositoryUrl) {
this.respositoryUrl = respositoryUrl;
}
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public int getMajorVersion() {
return majorVersion;
}
public void setMajorVersion(int majorVersion) {
this.majorVersion = majorVersion;
}
public int getMinorVersion() {
return minorVersion;
}
public void setMinorVersion(int minorVersion) {
this.minorVersion = minorVersion;
}
public int getBuildNumber() {
return buildNumber;
}
public void setBuildNumber(int buildNumber) {
this.buildNumber = buildNumber;
}
public BranchTypes getBranchType() {
return branchType;
}
public void setBranchType(BranchTypes branchType) {
this.branchType = branchType == null ? BranchTypes.NONE : branchType;
}
public String getArtifactName() {
return artifactName;
}
public void setArtifactName(String artifactName) {
this.artifactName = artifactName;
}
public String getLastReleaseVersion() {
return lastReleaseVersion;
}
public void setLastReleaseVersion(String lastReleaseVersion) {
this.lastReleaseVersion = lastReleaseVersion;
}
public String getLastBranchVersion() {
return lastBranchVersion;
}
public void setLastBranchVersion(String lastBranchVersion) {
this.lastBranchVersion = lastBranchVersion;
}
public String getBuildVersion() {
return buildVersion;
}
public void setBuildVersion(String buildVersion) {
this.buildVersion = buildVersion;
}
public List getArtifactTypes() {
return artifactTypes;
}
public void setArtifactTypes(List artifactTypes) {
this.artifactTypes = artifactTypes;
}
public Map getBuildArtifacts() {
return buildArtifacts;
}
public void setBuildArtifacts(Map buildArtifacts) {
this.buildArtifacts = buildArtifacts;
}
}