Customizing Build Number

Hi,

I am looking for a way to customise build_id / build_number

to match something like

    <_BuildNumber>$(OfficialBuildId)</_BuildNumber>
    <_BuildNumber Condition="'$(OfficialBuildId)' == ''">$([System.DateTime]::Now.ToString(yyyyMMdd)).1</_BuildNumber>

    <!--
      OfficialBuildId is assumed to have format "20yymmdd.r" (the assumption is checked later in a target).
    -->
    <_BuildNumberYY>$(_BuildNumber.Substring(2, 2))</_BuildNumberYY>
    <_BuildNumberMM>$(_BuildNumber.Substring(4, 2))</_BuildNumberMM>
    <_BuildNumberDD>$(_BuildNumber.Substring(6, 2))</_BuildNumberDD>
    <_BuildNumberR>$(_BuildNumber.Substring(9))</_BuildNumberR>

from arcade/Version.BeforeCommonTargets.targets at 938b3e8b4edcd96ca0f0cbbae63c87b3f51f7afe · dotnet/arcade · GitHub

Currently I cannot find a way to customise this

1 Like

Searching the repository for “Buildnumber”, I see a couple of files which suggest the value comes from an environment variable. The name of that variable is “BUILD_BUILDNUMBER”. So try setting that environment variable to your desired value in the command prompt before executing the build command …

1 Like