Search Results for

    Show / Hide Table of Contents

    Class GitVersionCalculator

    Uses Git to calculate the version of the application

    Inheritance
    Object
    GitVersionCalculator
    Implements
    IGitVersionCalculator
    Namespace: i5.Toolkit.Core.VersionTool
    Assembly: cs.temp.dll.dll
    Syntax
    public class GitVersionCalculator : IGitVersionCalculator

    Constructors

    GitVersionCalculator()

    Creates a new instance of the version calculator

    Declaration
    public GitVersionCalculator()

    Methods

    TryGetBranch(out String)

    Tries to get the name of the currently checked out branch in git

    Declaration
    public bool TryGetBranch(out string branchName)
    Parameters
    Type Name Description
    String branchName

    If the branch name could be fetched, it is passed to this out parameter

    Returns
    Type Description
    Boolean

    Returns true if the branch name could be fetched, otherwise false

    TryGetTotalCommitsOnBranch(out Int32)

    Tries to count the number of commits on the currently checked out branch

    Declaration
    public bool TryGetTotalCommitsOnBranch(out int commitCount)
    Parameters
    Type Name Description
    Int32 commitCount

    If the number of commits could be fetched, it is passed to this out parameter

    Returns
    Type Description
    Boolean

    Returns true if the number of commits could be calculated, false otherwise

    TryGetVersion(out String)

    Tries to get the version string based on git tags Assign a tag of the form "v1.2" in git The method will output a version of the form "1.2.n" where n is the number of commits since this tag

    Declaration
    public bool TryGetVersion(out string version)
    Parameters
    Type Name Description
    String version

    If a version could be retrieved, it will be passed to this out parameter

    Returns
    Type Description
    Boolean

    Returns true if the version could be read, otherwise false (e.g. when no tag exists or if git is not installed)

    Implements

    IGitVersionCalculator
    In This Article
    Back to top i5 Toolkit Documentation