2017-12-21 02:36:52 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
|
|
|
|
<!-- Set the version number: major, minor, build and release (i.e. alpha, beta or blank for RTM)-->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionMajor Condition="'$(VersionMajor)' == ''">1</VersionMajor>
|
|
|
|
<VersionMinor Condition="'$(VersionMinor)' == ''">0</VersionMinor>
|
2019-10-03 18:51:35 +02:00
|
|
|
<VersionBuild Condition="'$(VersionBuild)' == ''">1</VersionBuild>
|
2019-09-26 00:04:13 +02:00
|
|
|
<VersionRelease Condition="'$(VersionRelease)' == ''"></VersionRelease>
|
2017-12-21 02:36:52 +01:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- For NuGet Package Dependencies -->
|
|
|
|
<PropertyGroup>
|
2019-09-26 00:04:13 +02:00
|
|
|
<OpenApiCorePackageDependency>[1.1.4, 2.0.0)</OpenApiCorePackageDependency>
|
2019-10-03 18:51:35 +02:00
|
|
|
<ODataEdmPackageDependency>[7.6.1, 8.0.0)</ODataEdmPackageDependency>
|
2017-12-21 02:36:52 +01:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Revision number is a date code. Note that this only work for 6 years before the year part (year minus 2017)
|
|
|
|
overflows the Int16. The system convert below will throw errors when this happens.
|
|
|
|
-->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionStartYear Condition="'$(VersionStartYear)' == ''">2017</VersionStartYear>
|
|
|
|
<VersionDateCode>$([System.Convert]::ToInt16('$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))'))</VersionDateCode>
|
|
|
|
<VersionRevision Condition="'$(VersionRevision)' == '' OR '$(VersionRevision)' == '0'">$([System.Convert]::ToString($(VersionDateCode)))</VersionRevision>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Product Version -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionFullSemantic>$(VersionMajor).$(VersionMinor).$(VersionBuild)</VersionFullSemantic>
|
|
|
|
<VersionFull>$(VersionFullSemantic).$(VersionRevision)</VersionFull>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- For NuGet Packages -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionNuGetSemantic>$(VersionFullSemantic)</VersionNuGetSemantic>
|
|
|
|
<VersionNuGetSemantic Condition="'$(VersionRelease)'!=''">$(VersionFullSemantic)-$(VersionRelease)</VersionNuGetSemantic>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
==================================================================================================
|
|
|
|
Property Groups to define version information. Do not modify this section.
|
|
|
|
================================================================================================== -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionFileGenerationEnabled Condition="'$(VersionFileGenerationEnabled)' == '' AND '$(MSBuildProjectExtension)' == '.csproj'">true</VersionFileGenerationEnabled>
|
|
|
|
<VersionFileGenerationEnabled Condition="'$(VersionFileGenerationEnabled)' == ''">false</VersionFileGenerationEnabled>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionStartYear Condition="'$(VersionStartYear)' == ''">2017</VersionStartYear>
|
|
|
|
<VersionMajor Condition="'$(VersionMajor)' == '0'">INVALID_VersionMajor</VersionMajor>
|
|
|
|
<VersionMajor Condition="'$(VersionMajor)' == ''">INVALID_VersionMajor</VersionMajor>
|
|
|
|
<VersionMinor Condition="'$(VersionMinor)' == ''">INVALID_VersionMinor</VersionMinor>
|
|
|
|
<VersionBuild Condition="'$(VersionBuild)' == ''">INVALID_VersionBuild</VersionBuild>
|
|
|
|
<VersionRevision Condition="'$(VersionRevision)' == '' OR '$(VersionRevision)' == '0'">$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))</VersionRevision>
|
|
|
|
<VersionRevision Condition="'$(VersionRevision)' == ''">0</VersionRevision>
|
|
|
|
<VersionRelease Condition="'$(VersionRelease)' == ''"></VersionRelease>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</AssemblyVersion>
|
|
|
|
<AssemblyFileVersion>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</AssemblyFileVersion>
|
|
|
|
<AssemblyInfoVersion>$(AssemblyFileVersion)</AssemblyInfoVersion>
|
|
|
|
<AssemblyVersionFile>$(IntermediateOutputPath)$(MSBuildProjectName).version.cs</AssemblyVersionFile>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup Condition="'$(VersionFileGenerationEnabled)' == 'true'">
|
|
|
|
<Compile Include="$(AssemblyVersionFile)" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<Clean Include="$(AssemblyVersionFile)" Condition="'$(MSBuildProjectExtension)' == '.csproj'"/>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<AssemblyCompany>Microsoft Corporation.</AssemblyCompany>
|
|
|
|
<AssemblyCopyright>© Microsoft Corporation. All rights reserved.</AssemblyCopyright>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- GenerateVersionFile target: generates assembly attributes into a source file that is included -->
|
|
|
|
<Target Name="GenerateVersionFileCore" Condition="'$(ShouldGenerateVersionFile)' == 'true'">
|
|
|
|
<ItemGroup>
|
|
|
|
<LinesToWrite Include="// $(SourceFileCopyright)" Condition="'$(SourceFileCopyright)' != ''"/>
|
|
|
|
<LinesToWrite Include="// <auto-generated>" />
|
|
|
|
<LinesToWrite Include="// This code was generated by a tool." />
|
|
|
|
<LinesToWrite Include="// </auto-generated>" />
|
|
|
|
<LinesToWrite Include="[assembly: System.Reflection.AssemblyCompany("$(AssemblyCompany)")]" Condition="'$(AssemblyCompany)' != ''"/>
|
|
|
|
<LinesToWrite Include="[assembly: System.Reflection.AssemblyCopyright("$(AssemblyCopyright)")]" Condition="'$(AssemblyCopyright)' != ''"/>
|
|
|
|
<LinesToWrite Include="[assembly: System.Reflection.AssemblyVersion("$(AssemblyVersion)")]" Condition="'$(AssemblyVersion)' != ''"/>
|
|
|
|
<LinesToWrite Include="[assembly: System.Reflection.AssemblyFileVersion("$(AssemblyFileVersion)")]" Condition="'$(AssemblyFileVersion)' != ''"/>
|
|
|
|
<LinesToWrite Include="[assembly: System.Reflection.AssemblyInformationalVersion("$(AssemblyInfoVersion)")]" Condition="'$(AssemblyInfoVersion)' != ''" />
|
|
|
|
<LinesToWrite Include="[assembly: System.Resources.SatelliteContractVersionAttribute("$(SatelliteContractVersion)")]" Condition="'$(SatelliteContractVersion)' != ''"/>
|
|
|
|
<LinesToWrite Include="@(VersionFileAttribute)" Condition="'@(VersionFileAttribute)' != ''" />
|
|
|
|
</ItemGroup>
|
|
|
|
<WriteLinesToFile File="$(AssemblyVersionFile)" Lines="@(LinesToWrite)" Overwrite="true" Encoding="Unicode"/>
|
|
|
|
<Message Text="Assembly Version File: $(AssemblyVersionFile)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<!-- ShouldGenerateVersionFile target: determines whether a version needs to be generated. -->
|
|
|
|
<Target Name="ShouldGenerateVersionFile">
|
|
|
|
<ReadLinesFromFile File="$(AssemblyVersionFile)" Condition="Exists('$(AssemblyVersionFile)')">
|
|
|
|
<Output ItemName="VersionText" TaskParameter="Lines"/>
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionText>@(VersionText)</VersionText>
|
|
|
|
<ShouldGenerateVersionFile>!$(VersionText.Contains('$(AssemblyFileVersion)'))</ShouldGenerateVersionFile>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="ValidateVersionValues">
|
|
|
|
<!-- Throw if any of the version values is not int16 -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<VersionMajor>$([System.Convert]::ToInt16('$(VersionMajor)'))</VersionMajor>
|
|
|
|
<VersionMinor>$([System.Convert]::ToInt16('$(VersionMinor)'))</VersionMinor>
|
|
|
|
<VersionBuild>$([System.Convert]::ToUInt16('$(VersionBuild)'))</VersionBuild>
|
|
|
|
<VersionRevision>$([System.Convert]::ToInt16('$(VersionRevision)'))</VersionRevision>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(VersionFileGenerationEnabled)' == 'true'">
|
|
|
|
<BeforeCompileDependsOn>ValidateVersionValues;ShouldGenerateVersionFile;GenerateVersionFileCore</BeforeCompileDependsOn>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="BeforeCompile" DependsOnTargets="$(BeforeCompileDependsOn)" />
|
|
|
|
</Project>
|