Versions.props 5.6 KB
Newer Older
1
<?xml version="1.0" encoding="utf-8"?>
2
<!-- Copyright (c)  Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information. -->
3
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4

5
  <!-- This controls the version numbers of the build that we are producing -->
6 7

  <Import Project="Dependencies.props" />
8

9
  <PropertyGroup>
10
    <!-- This is the assembly version of Roslyn from the .NET assembly perspective. It should only be revved during significant point releases. -->
11
    <RoslynAssemblyVersionBase Condition="'$(RoslynAssemblyVersion)' == ''">2.0.0</RoslynAssemblyVersionBase>
12
    <!-- This is the file version of Roslyn, as placed in the PE header. It should be revved during point releases, and is also what provides the basis for our NuGet package versioning. -->
13
    <RoslynFileVersionBase Condition="'$(RoslynFileVersionBase)' == ''">2.0.1</RoslynFileVersionBase>
J
Jared Parsons 已提交
14 15 16
    <!-- The release moniker for our packages.  Developers should use "dev" and official builds pick the branch
         moniker listed below -->
    <RoslynNuGetMoniker Condition="'$(RoslynNuGetMoniker)' == ''">dev</RoslynNuGetMoniker>
17
    <RoslynNuGetMoniker Condition="'$(OfficialBuild)' == 'true'">rc5</RoslynNuGetMoniker>
18
    <!-- This is the base of the NuGet versioning for prerelease packages -->
J
Jared Parsons 已提交
19
    <NuGetPreReleaseVersion>$(RoslynFileVersionBase)-$(RoslynNuGetMoniker)</NuGetPreReleaseVersion>
20

21
    <!-- We should not be signing a build anywhere except for in MicroBuild, which will always specify 'BUILD_BUILDNUMBER'-->
22
    <BuildNumber Condition="'$(BuildNumber)' == ''">$(BUILD_BUILDNUMBER)</BuildNumber>
23
    <Error Condition="'$(BuildNumber)' == '' AND '$(OfficialBuild)' == 'true'">A build number must be specified for a signed build.</Error>
24

25 26 27 28 29
    <!-- When a build number is not specified, then we should default back to '00065535.0', which is a build number in the
         same format as provided by MicroBuild v2, but greater than any that MicroBuild v2 will produce, and is still compatible
         with the Win32 file version limitations. This is required so that builds done locally, where '$(OfficialBuild)' == 'true',
         can still be deployed to VS and override the version that is globally installed. -->
    <BuildNumber Condition="'$(BuildNumber)' == ''">00065535.0</BuildNumber>
30
    <!-- When a build number is specified, it needs to be in the format of 'x.y'-->
31 32
    <Error Condition="$(BuildNumber.Split('.').Length) != 2">BuildNumber should have two parts (in the form of 'x.y')</Error>

33
    <!-- Split the build parts out from the BuildNumber which is given to us by MicroBuild in the format of yyyymmdd.nn
34
         where BuildNumberFiveDigitDateStamp is mmmdd (such as 60615) and BuildNumberBuildOfTheDay is nn (which represents the nth build
35
         started that day). So the first build of the day, 20160615.1, will produce something similar to BuildNumberFiveDigitDateStamp: 60615,
36 37 38 39 40 41
         BuildNumberBuildOfTheDayPadded: 01;and the 12th build of the day, 20160615.12, will produce BuildNumberFiveDigitDateStamp: 60615, BuildNumberBuildOfTheDay: 12

         Additionally, in order ensure the value fits in the 16-bit PE header fields, we will only take the last five digits of the BuildNumber, so
         in the case of 20160615, we will set BuildNumberFiveDigitDateStamp to 60615. Unfortunately for releases in 2017 we can't go any higher, so
         well continue the month counting instead: the build after 61231 is 61301. -->
    <BuildNumberFiveDigitDateStamp>$([MSBuild]::Subtract($(BuildNumber.Split('.')[0].Substring(3).Trim()), 8800))</BuildNumberFiveDigitDateStamp>
42
    <BuildNumberBuildOfTheDayPadded>$(BuildNumber.Split('.')[1].PadLeft(2,'0'))</BuildNumberBuildOfTheDayPadded>
J
Jared Parsons 已提交
43 44 45 46

    <!-- NuGet version -->
    <NuGetReleaseVersion>$(RoslynFileVersionBase)</NuGetReleaseVersion>
    <NuGetPerBuildPreReleaseVersion>$(NuGetPreReleaseVersion)-$(BuildNumberFiveDigitDateStamp)-$(BuildNumberBuildOfTheDayPadded)</NuGetPerBuildPreReleaseVersion>
47
    <NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot> <!-- Respect environment variable if set -->
48 49
    <NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages</NuGetPackageRoot>
    <NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' != 'Windows_NT'">$(HOME)\.nuget\packages</NuGetPackageRoot>
50
    <NuGetPackagesDirectory>$(NuGetPackageRoot)</NuGetPackagesDirectory>
51
  </PropertyGroup>
52

53
  <Choose>
54
    <When Condition="'$(OfficialBuild)' == 'true' OR '$(UseShippingAssemblyVersion)' == 'true'">
55
      <PropertyGroup>
56 57 58
        <AssemblyVersion>$(RoslynAssemblyVersionBase).0</AssemblyVersion>
        <BuildVersion>$(RoslynFileVersionBase).$(BuildNumberFiveDigitDateStamp)</BuildVersion>
        <VsixVersion>$(RoslynFileVersionBase).$(BuildNumberFiveDigitDateStamp)$(BuildNumberBuildOfTheDayPadded)</VsixVersion>
59 60 61 62 63
      </PropertyGroup>
    </When>

    <Otherwise>
      <!-- No build version was supplied.  We'll use a special version, higher than anything
64 65 66 67
           installed, so that the assembly identity is different.  This will allows us to
           have a build with an actual number installed, but then build and F5 a build with
           this number. We will make AssemblyVersion and BuildVersion different, to catch
           any bugs where people might assume they are the same. -->
68 69
      <PropertyGroup>
        <AssemblyVersion>42.42.42.42</AssemblyVersion>
70 71
        <BuildVersion>42.42.42.42424</BuildVersion>
        <VsixVersion>42.42.42.42424</VsixVersion>
72 73 74
      </PropertyGroup>
    </Otherwise>
  </Choose>
75
</Project>