Skip to content

Global tools versioning#2615

Merged
tmat merged 8 commits intodotnet:masterfrom
tmat:GlobalToolsVersioning
Apr 30, 2019
Merged

Global tools versioning#2615
tmat merged 8 commits intodotnet:masterfrom
tmat:GlobalToolsVersioning

Conversation

@tmat
Copy link
Member

@tmat tmat commented Apr 23, 2019

Fixes #2234.

Allow projects to opt-in to release only package versioning by setting property PreReleaseVersionLabel to empty string and to automatically generating assembly and file versions by setting property AutoGenerateAssemblyVersion to true.

  • AssemblyVersion := MAJOR.MINOR.PATCH_NUMBER_HI.PATCH_NUMBER_LOW
  • FileVersion := AssemblyVersion
  • PackageVersion := MAJOR.MINOR.PATCH_NUMBER

where

  • R is the number of builds the build definition started on day YY/MM/DD
  • SHORT_DATE := YY * 1000 + MM * 50 + DD
  • PATCH_NUMBER := (SHORT_DATE- VersionBaseShortDate) * 100 + R
  • PATCH_NUMBER_HI := PATCH_NUMBER / 50000
  • PATCH_NUMBER_LOW := PATCH_NUMBER % 50000
  • BASE_DATE := 19000

Note: SHORT_DATE is a concept used by the versioning scheme we already use.

Example for 5th build today (2019/3/14):

  • AssemblyVersion = FileVersion = 3.0.0.16405
  • PackageVersion = 3.0.16405

Example for 1st build on (2025/12/29):

  • AssemblyVersion = FileVersion = 8.0.13.12901
  • PackageVersion = 8.0.662901

@tmat tmat marked this pull request as ready for review April 24, 2019 00:38
@tmat
Copy link
Member Author

tmat commented Apr 24, 2019

@tmat tmat force-pushed the GlobalToolsVersioning branch from 6903606 to d86a383 Compare April 24, 2019 02:52
@tmat
Copy link
Member Author

tmat commented Apr 24, 2019

Tested on dotnet/format global tool: dotnet/format#118
and Roslyn build task: dotnet/roslyn#35238

@tmat
Copy link
Member Author

tmat commented Apr 29, 2019

Ping

@wli3
Copy link

wli3 commented Apr 30, 2019

looks good on my part

@jaredpar
Copy link
Member

Somehow this is breaking dotnet/runtime builds now.

F:\workspace\_work\1\s\.dotnet\sdk\5.0.100-preview.1.20112.7\MSBuild.dll /nologo -maxcpucount /m -verbosity:m /v:minimal /bl:F:\workspace\_work\1\s\artifacts\log\Debug\ToolsetRestore.binlog /clp:Summary /clp:ErrorsOnly;NoSummary /nr:False /p:ContinuousIntegrationBuild=True /p:TreatWarningsAsErrors=true /p:__ToolsetLocationOutputFile=F:\workspace\_work\1\s\artifacts\toolset\5.0.0-beta.20121.6.txt /t:__WriteToolsetLocation /warnaserror F:\workspace\_work\1\s\artifacts\toolset\restore.proj
F:\workspace\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20121.6\tools\Version.BeforeCommonTargets.targets(57,5): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::Multiply($(_BuildNumberYY), 1000)". Method '[MSBuild]::Multiply' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order. [F:\workspace\_work\1\s\eng\empty.csproj]
##[error].packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20121.6\tools\Version.BeforeCommonTargets.targets(57,5): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::Multiply($(_BuildNumberYY), 1000)". Method '[MSBuild]::Multiply' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order.
(NETCORE_ENGINEERING_TELEMETRY=Category) Build failed.
##[error]BUILD: Error: Failed to generate version headers.
BUILD:     -linuxdac x64 Release -skiptests -skipbuildpackages -officialbuildid -enforcepgo
##[error]Cmd.exe exited with code '1'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version scheme that fit small app

4 participants