Skip to content
This repository was archived by the owner on Aug 5, 2019. It is now read-only.

Optional RepositoryInfo.xml file

Olivier Spinelli edited this page Oct 17, 2018 · 11 revisions

This RepositoryInfo.xml file may appear at the root level in the repository.

This file can define options like CI builds or StartingVersionForCSemVer that drives the behavior of SimpleGitVersion.Core. Its schema can be found here.

StartingVersionForCSemVer

This defines the first version that should be considered in the repository:

    <?xml version="1.0" encoding="utf-8"?>
    <RepositoryInfo xmlns="http://csemver.org/schemas/2015">
      <StartingVersionForCSemVer>v0.6.0-rc</StartingVersionForCSemVer>
    </RepositoryInfo>

When this version is specified, any existing commit tag with a version lower than it is simply ignored. This is typically used to start using CSemVer on a repository that did not use it before and therefore has incoherent or invalid tags.

Another common use is when for any reason one need to boost the actual version: jumping from any current version (like 1.0.0) to a target that violates the SemVer rule of consecutive versions (like 10.0.0).

Long Term Support branches

The RepositoryInfo.xml file can define two properties:

  • SingleMajor: Setting this major number will only allow versions with this exact number as their Major.
  • OnlyPatch: Defaults to false. Sets it to true to allow only patches version.
    <?xml version="1.0" encoding="utf-8"?>
    <RepositoryInfo xmlns="http://csemver.org/schemas/2015">
      <SingleMajor>4</SingleMajor>
      <OnlyPatch>true</OnlyPatch>
    </RepositoryInfo>

This SingleMajor and OnlyPatch are enough to fully drive the behavior of SimpleGitVersion regarding "Long Term Support" application life cycle.

Branches that support CI-Builds

Specifying which branches should generate CI-Builds assemblies and/or packages is easy:

    <?xml version="1.0" encoding="utf-8"?>
    <RepositoryInfo xmlns="http://csemver.org/schemas/2015">
      <Branches>
        <Branch Name="develop" />
        <Branch Name="master" VersionName="explore" CIVersionMode="LastReleaseBased" />
      </Branches>
    </RepositoryInfo>

The VersionName and CIVersionMode are optional.

  • When specified VersionName overrides the branch Name as the CI-Build identifier. To be able to generate CI-Build versions that fit into NuGet V2 package name (CSemVer short form), the VersionName (or the branch Name) must not exceed 8 characters.
  • CIVersionMode can be:
    • None: This suppress any CI builds as if the <Branch> element was not specified.
    • LastReleaseBased: This is the default. Semantic versions computed in this mode are greater than the base release but lower than any subsequent release.
    • ZeroTimed: The computed semantic version is a 0.0.0 version with a suffix that makes it lower than any actual package (ie. lower than v0.0.0-alpha that is the very first possible CSemVer version).

Ignoring local modifications to specific files

    <?xml version=""1.0"" encoding=""utf-8""?>
    <RepositoryInfo xmlns=""http://csemver.org/schemas/2015"">
      <IgnoreModifiedFiles>
        <Add>SharedKey.snk</Add>
        <Add>src/Project/ReleaseNotes.txt</Add>
      </IgnoreModifiedFiles>
    </RepositoryInfo>

This can be used if for any reason some files should (or can safely) be ignored in terms of local changes: uncommitted changes for these files will be ignored.

Debugging

This is a dangerous option since it ignores any locally modified files.

    <?xml version="1.0" encoding="utf-8"?>
    <RepositoryInfo xmlns="http://csemver.org/schemas/2015">
      <Debug IgnoreDirtyWorkingFolder="true"/>
    </RepositoryInfo>
Clone this wiki locally