You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
387
external/corefx/Tools-Override/versioning.targets
vendored
Normal file
387
external/corefx/Tools-Override/versioning.targets
vendored
Normal file
@@ -0,0 +1,387 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<UsingTask TaskName="GenerateCurrentVersion" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
|
||||
|
||||
<!-- Setup the default file version information -->
|
||||
<PropertyGroup>
|
||||
<MajorVersion Condition="'$(MajorVersion)' == ''">1</MajorVersion>
|
||||
<MinorVersion Condition="'$(MinorVersion)' == ''">0</MinorVersion>
|
||||
|
||||
<!-- These should be set by importing the targets below but initializing to 0 for consistency -->
|
||||
<BuildNumberMajor Condition="'$(BuildNumberMajor)' == ''">0</BuildNumberMajor>
|
||||
<BuildNumberMinor Condition="'$(BuildNumberMinor)' == ''">0</BuildNumberMinor>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Import a build target that includes the build numbers -->
|
||||
<Import Project="$(BuildNumberTarget)" Condition="Exists('$(BuildNumberTarget)')" />
|
||||
|
||||
<!-- #################################### -->
|
||||
<!-- Generate Assembly Info -->
|
||||
<!-- #################################### -->
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion Condition="'$(AssemblyVersion)'==''">1.0.0.0</AssemblyVersion>
|
||||
<CLSCompliant Condition="'$(CLSCompliant)'==''">false</CLSCompliant>
|
||||
<AssemblyFileVersion Condition="'$(AssemblyFileVersion)'==''">$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</AssemblyFileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateAssemblyInfo Condition="'$(GenerateAssemblyInfo)'==''">true</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GenerateAssemblyInfo)'=='true'">
|
||||
<AssemblyInfoFile Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(IntermediateOutputPath)_AssemblyInfo.cs</AssemblyInfoFile>
|
||||
<AssemblyInfoFile Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(IntermediateOutputPath)_AssemblyInfo.vb</AssemblyInfoFile>
|
||||
<AssemblyInfoPartialFile Condition="'$(MSBuildProjectExtension)' == '.csproj'">$(MSBuildThisFileDirectory)AssemblyInfoPartial.cs</AssemblyInfoPartialFile>
|
||||
<AssemblyInfoPartialFile Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(MSBuildThisFileDirectory)AssemblyInfoPartial.vb</AssemblyInfoPartialFile>
|
||||
<AssemblyInfoPartialFileLink Condition="'$(MSBuildProjectExtension)' == '.csproj'">Properties/_AssemblyInfo.cs</AssemblyInfoPartialFileLink>
|
||||
<AssemblyInfoPartialFileLink Condition="'$(MSBuildProjectExtension)' == '.vbproj'">My Project/_AssemblyInfo.vb</AssemblyInfoPartialFileLink>
|
||||
<CoreCompileDependsOn>$(CoreCompileDependsOn);GenerateAssemblyInfo</CoreCompileDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="GenerateAssemblyInfo"
|
||||
Inputs="$(MSBuildProjectFile)"
|
||||
Outputs="$(AssemblyInfoFile)"
|
||||
Condition="'$(GenerateAssemblyInfo)'=='true'"
|
||||
DependsOnTargets="CreateVersionFileDuringBuild">
|
||||
|
||||
<Error Condition="!Exists('$(IntermediateOutputPath)')" Text="GenerateAssemblyInfo failed because IntermediateOutputPath isn't set to a valid directory" />
|
||||
|
||||
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
|
||||
<AssemblyInfoUsings Include="using System%3B" />
|
||||
<AssemblyInfoUsings Include="using System.Reflection%3B" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyTitle("$(AssemblyName)")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyDescription("$(AssemblyName)")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyDefaultAlias("$(AssemblyName)")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyCompany("Microsoft Corporation")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyProduct("Microsoft\x00ae .NET Framework")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyVersion("$(AssemblyVersion)")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyFileVersion("$(AssemblyFileVersion)")]" />
|
||||
<AssemblyInfoLines Include="[assembly:AssemblyInformationalVersion(@"$(AssemblyFileVersion)$(BuiltByString). Commit Hash%3A $(LatestCommit)")]" />
|
||||
<AssemblyInfoLines Condition="'$(CLSCompliant)'=='true'" Include="[assembly:CLSCompliant(true)]" />
|
||||
<AssemblyInfoLines Condition="'$(AssemblyComVisible)'!=''" Include="[assembly:System.Runtime.InteropServices.ComVisible($(AssemblyComVisible))]" />
|
||||
<AssemblyInfoLines Condition="'$(SkipFrameworkAssemblyMetadata)' != 'true'"
|
||||
Include="[assembly:System.Reflection.AssemblyMetadata("%(AssemblyMetadata.Identity)", "%(AssemblyMetadata.Value)")]" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vbproj'">
|
||||
<AssemblyInfoUsings Include="Imports System" />
|
||||
<AssemblyInfoUsings Include="Imports System.Reflection" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyTitle("$(AssemblyName)")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyDescription("$(AssemblyName)")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyDefaultAlias("$(AssemblyName)")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyCompany("Microsoft Corporation")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyProduct("Microsoft\x00ae .NET Framework")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyVersion("$(AssemblyVersion)")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyFileVersion("$(AssemblyFileVersion)")>" />
|
||||
<AssemblyInfoLines Include="<Assembly:AssemblyInformationalVersion("$(AssemblyFileVersion)$(BuiltByString). Commit Hash%3A $(LatestCommit)")>" />
|
||||
<AssemblyInfoLines Condition="'$(CLSCompliant)'=='true'" Include="<Assembly:CLSCompliant(True)>" />
|
||||
<AssemblyInfoLines Condition="'$(AssemblyComVisible)'!=''" Include="<Assembly:System.Runtime.InteropServices.ComVisible($(AssemblyComVisible))>" />
|
||||
<AssemblyInfoLines Condition="'$(SkipFrameworkAssemblyMetadata)' != 'true'"
|
||||
Include="<assembly:System.Reflection.AssemblyMetadata("%(AssemblyMetadata.Identity)", "%(AssemblyMetadata.Value)")>" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj' And '$(GenerateThisAssemblyClass)' == 'true'">
|
||||
<AssemblyInfoLines Include="internal static class ThisAssembly" />
|
||||
<AssemblyInfoLines Include="{" />
|
||||
<AssemblyInfoLines Include="%20%20%20%20internal const string Title = "$(AssemblyName)"%3B" />
|
||||
<AssemblyInfoLines Include="%20%20%20%20internal const string Copyright = "\u00A9 Microsoft Corporation. All rights reserved."%3B" />
|
||||
<AssemblyInfoLines Include="%20%20%20%20internal const string Version = "$(AssemblyVersion)"%3B" />
|
||||
<AssemblyInfoLines Include="%20%20%20%20internal const string InformationalVersion = "$(AssemblyFileVersion)"%3B" />
|
||||
<AssemblyInfoLines Include="}" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile
|
||||
File="$(AssemblyInfoFile)"
|
||||
Lines="@(AssemblyInfoUsings);@(AssemblyInfoLines);@(AssemblyInfoSource)"
|
||||
Overwrite="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(AssemblyInfoFile)" />
|
||||
<FileWrites Include="$(AssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Target>
|
||||
|
||||
<ItemGroup Condition="'$(GenerateAssemblyInfo)'=='true' AND '$(StringResourcesPath)' != '' AND '$(ExcludeAssemblyInfoPartialFile)' != 'true'">
|
||||
<Compile Include="$(AssemblyInfoPartialFile)">
|
||||
<Visible>true</Visible>
|
||||
<Link>$(AssemblyInfoPartialFileLink)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateNativeVersionInfo Condition="'$(GenerateNativeVersionInfo)'==''">false</GenerateNativeVersionInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GenerateNativeVersionInfo)'=='true'">
|
||||
<NativeVersionFileDir>$(BaseIntermediateOutputPath)</NativeVersionFileDir>
|
||||
<NativeVersionHeaderFile>$(NativeVersionFileDir)_version.h</NativeVersionHeaderFile>
|
||||
<GenerateVersionHeader>true</GenerateVersionHeader>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="GenerateVersionHeader"
|
||||
Inputs="$(MSBuildProjectFile)"
|
||||
Outputs="$(NativeVersionHeaderFile)"
|
||||
DependsOnTargets="CreateVersionFileDuringBuild"
|
||||
Condition="'$(NativeVersionHeaderFile)'!='' and '$(GenerateVersionHeader)'=='true' and !Exists($(NativeVersionHeaderFile))">
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Defining versioning variables -->
|
||||
<NativeVersionLines Include="#ifndef VER_COMPANYNAME_STR" />
|
||||
<NativeVersionLines Include="#define VER_COMPANYNAME_STR "Microsoft Corporation"" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#ifndef VER_FILEDESCRIPTION_STR" />
|
||||
<NativeVersionLines Include="#define VER_FILEDESCRIPTION_STR "$(AssemblyName)"" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#ifndef VER_INTERNALNAME_STR" />
|
||||
<NativeVersionLines Include="#define VER_INTERNALNAME_STR VER_FILEDESCRIPTION_STR" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#ifndef VER_ORIGINALFILENAME_STR" />
|
||||
<NativeVersionLines Include="#define VER_ORIGINALFILENAME_STR VER_FILEDESCRIPTION_STR" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#ifndef VER_PRODUCTNAME_STR" />
|
||||
<NativeVersionLines Include="#define VER_PRODUCTNAME_STR "Microsoft\xae .NET Framework"" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#undef VER_PRODUCTVERSION" />
|
||||
<NativeVersionLines Include="#define VER_PRODUCTVERSION $(MajorVersion),$(MinorVersion),$(BuildNumberMajor),$(BuildNumberMinor)" />
|
||||
<NativeVersionLines Include="#undef VER_PRODUCTVERSION_STR" />
|
||||
<NativeVersionLines Include="#define VER_PRODUCTVERSION_STR "$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)$(BuiltByString). Commit Hash%3A $(LatestCommit)"" />
|
||||
<NativeVersionLines Include="#undef VER_FILEVERSION" />
|
||||
<NativeVersionLines Include="#define VER_FILEVERSION $(MajorVersion),$(MinorVersion),$(BuildNumberMajor),$(BuildNumberMinor)" />
|
||||
<NativeVersionLines Include="#undef VER_FILEVERSION_STR" />
|
||||
<NativeVersionLines Include="#define VER_FILEVERSION_STR "$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)$(BuiltByString). Commit Hash%3A $(LatestCommit)"" />
|
||||
<NativeVersionLines Include="#ifndef VER_LEGALCOPYRIGHT_STR" />
|
||||
<NativeVersionLines Include="#define VER_LEGALCOPYRIGHT_STR "\xa9 Microsoft Corporation. All rights reserved."" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
<NativeVersionLines Include="#ifndef VER_DEBUG" />
|
||||
<NativeVersionLines Condition="'$(Configuration)'=='Debug'" Include="#define VER_DEBUG VS_FF_DEBUG" />
|
||||
<NativeVersionLines Condition="'$(Configuration)'!='Debug'" Include="#define VER_DEBUG 0" />
|
||||
<NativeVersionLines Include="#endif" />
|
||||
</ItemGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('$(NativeVersionFileDir)')" Directories="$(NativeVersionFileDir)" />
|
||||
|
||||
<WriteLinesToFile
|
||||
File="$(NativeVersionHeaderFile)"
|
||||
Lines="@(NativeVersionLines)"
|
||||
Overwrite="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(NativeVersionHeaderFile)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(GenerateVersionSourceFile)'=='true'">
|
||||
<NativeVersionSourceDir>$(BaseIntermediateOutputPath)</NativeVersionSourceDir>
|
||||
<NativeVersionSourceFile>$(NativeVersionSourceDir)version.c</NativeVersionSourceFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Non Windows versioning requires to generate a source file and include it on the compilation. -->
|
||||
<Target Name="GenerateVersionSourceFile"
|
||||
Inputs="$(MSBuildProjectFile)"
|
||||
Outputs="$(NativeVersionSourceFile)"
|
||||
DependsOnTargets="CreateVersionFileDuringBuild"
|
||||
Condition="'$(NativeVersionSourceFile)'!='' and '$(GenerateVersionSourceFile)'=='true'">
|
||||
|
||||
<ItemGroup>
|
||||
<SourceFileLines />
|
||||
<SourceFileLines Include="static char sccsid%5B%5D %5F%5Fattribute%5F%5F%28%28used%29%29 %3D %22%40%28%23%29Version $(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)$(BuiltByString). Commit Hash%3A $(LatestCommit)%22%3B" />
|
||||
<!-- Since this is a source file, compiler will complain if there is no new line at end of file, so adding one bellow. -->
|
||||
<SourceFileLines Include=" " />
|
||||
</ItemGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('$(NativeVersionSourceDir)')" Directories="$(NativeVersionSourceDir)" />
|
||||
|
||||
<WriteLinesToFile
|
||||
File="$(NativeVersionSourceFile)"
|
||||
Lines="@(SourceFileLines)"
|
||||
Overwrite="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(NativeVersionSourceFile)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<GetNuGetPackageVersionsDependsOn>$(GetNuGetPackageVersionsDependsOn);CreateVersionInfoFile</GetNuGetPackageVersionsDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SyncInfoDirectory Condition="'$(SyncInfoDirectory)' == ''">$(ObjDir)</SyncInfoDirectory>
|
||||
<SyncInfoFile Condition="'$(SyncInfoFile)' == ''">$(SyncInfoDirectory)version.txt</SyncInfoFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CreateVersionInfoFile"
|
||||
DependsOnTargets="CreateVersionFileDuringBuild"
|
||||
BeforeTargets="BuildAllProjects"
|
||||
Inputs="$(LatestCommit)"
|
||||
Outputs="$(SyncInfoFile)">
|
||||
<MakeDir Condition="!Exists('$(SyncInfoDirectory)')"
|
||||
Directories="$(SyncInfoDirectory)" />
|
||||
<WriteLinesToFile
|
||||
Condition="'$(LatestCommit)' != ''"
|
||||
File="$(SyncInfoFile)"
|
||||
Lines="$(LatestCommit)"
|
||||
Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Target: CreateOrUpdateCurrentVersionFile
|
||||
|
||||
Generates the version data and saves it to $(BuildVersionFile) if it hasn't been imported
|
||||
|
||||
Outputs:
|
||||
$(LatestCommit)
|
||||
$(BuiltByString)
|
||||
$(BuildNumberMajor)
|
||||
$(BuildNumberMinor)
|
||||
$(AssemblyFileVersion)
|
||||
-->
|
||||
<Target Name="CreateOrUpdateCurrentVersionFile"
|
||||
BeforeTargets="ResolveProjectReferences"
|
||||
Condition="'$(SkipVersionGeneration)' != 'true' AND '$(VersionPropsImported)' != 'true'">
|
||||
<!-- ############################### -->
|
||||
<!-- Get the latest commit hash -->
|
||||
<Exec Command="git rev-parse HEAD 2>&1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
|
||||
<Output TaskParameter="ExitCode" PropertyName="LatestCommitExitCode" />
|
||||
</Exec>
|
||||
<!-- We shouldn't fail the build if we can't retreive the commit hash, so in this case just set it to N/A -->
|
||||
<PropertyGroup Condition="'$(LatestCommitExitCode)'!='0'">
|
||||
<LatestCommit>N/A</LatestCommit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LatestCommitExitCode/>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- ############################### -->
|
||||
<!-- Get the latest commit date -->
|
||||
<ItemGroup>
|
||||
<VersionTargetsFile Include="$(MSBuildThisFileFullPath)" />
|
||||
</ItemGroup>
|
||||
<!-- Windows Exec command requires DOS escaping for the percent sign since it secretly runs the process in a shell instead of calling createprocess. -->
|
||||
<PropertyGroup>
|
||||
<LatestDateCommand Condition="'$(OsEnvironment)'=='Windows_NT'">git show -s --format=^%25%25cd --date=short HEAD</LatestDateCommand>
|
||||
<LatestDateCommand Condition="'$(OsEnvironment)'!='Windows_NT'">git show -s --format=%25cd --date=short HEAD</LatestDateCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="$(LatestDateCommand)" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="VersionSeedDate" />
|
||||
<Output TaskParameter="ExitCode" PropertyName="LatestDateCommandExitCode" />
|
||||
</Exec>
|
||||
<PropertyGroup Condition="'$(LatestDateCommandExitCode)'!='0'">
|
||||
<VersionSeedDate>%(VersionTargetsFile.ModifiedTime)</VersionSeedDate>
|
||||
<VersionSeedSourceComment>VersionSeedDate was produced by getting the timestamp of versioning.targets.</VersionSeedSourceComment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(LatestDateCommandExitCode)'=='0'">
|
||||
<VersionSeedSourceComment>VersionSeedDate was produced by taking the timestamp of the last git commit.</VersionSeedSourceComment>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<VersionTargetsFile Remove="@(VersionTargetsFile)" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<LatestDateCommand/>
|
||||
<LatestDateCommandExitCode/>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- ############################### -->
|
||||
<!-- Get Username -->
|
||||
<PropertyGroup>
|
||||
<VersionUserName Condition="'$(VersionUserName)' == ''">$(USERNAME)</VersionUserName>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="whoami" Condition="'$(VersionUserName)' == ''" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="VersionUserName" />
|
||||
</Exec>
|
||||
|
||||
<!-- ############################### -->
|
||||
<!-- Get Hostname -->
|
||||
<PropertyGroup>
|
||||
<VersionHostName Condition="'$(VersionHostName)' == ''">$(COMPUTERNAME)</VersionHostName>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="hostname" Condition="'$(OSEnvironment)'!='Windows_NT' AND '$(VersionHostName)'==''" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="VersionHostName" />
|
||||
</Exec>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuiltByString Condition="'$(BuiltByString)' == '' AND '$(VersionUserName)' != '' AND '$(VersionHostName)' != ''">%20built by: $(VersionUserName)-$(VersionHostName)</BuiltByString>
|
||||
<VersionUserName/>
|
||||
<VersionHostName/>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Setting default parameters in case that they are not set before. -->
|
||||
<PropertyGroup>
|
||||
<!-- Padding should be equal or greater to 5. Using 5 to align with internal build system. -->
|
||||
<VersionPadding Condition="'$(VersionPadding)'==''">5</VersionPadding>
|
||||
<!-- Using the following default comparison date will produce versions that align with our internal build system. -->
|
||||
<VersionComparisonDate Condition="'$(VersionComparisonDate)'==''">1996-04-01</VersionComparisonDate>
|
||||
</PropertyGroup>
|
||||
|
||||
<GenerateCurrentVersion SeedDate="$(VersionSeedDate)" OfficialBuildId="$(OfficialBuildId)" ComparisonDate="$(VersionComparisonDate)" Padding="$(VersionPadding)">
|
||||
<Output PropertyName="BuildNumberMajor" TaskParameter="GeneratedVersion" />
|
||||
<Output PropertyName="BuildNumberMinor" TaskParameter="GeneratedRevision" />
|
||||
</GenerateCurrentVersion>
|
||||
<PropertyGroup>
|
||||
<VersionPadding/>
|
||||
<VersionComparisonDate/>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionFileContent>
|
||||
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This is a generated file. $(VersionSourceComment) Seed Date is $(VersionSeedDate). -->
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VersionPropsImported>true</VersionPropsImported>
|
||||
<BuildNumberMajor Condition="'%24(BuildNumberMajor)' == ''">$(BuildNumberMajor)</BuildNumberMajor>
|
||||
<BuildNumberMinor Condition="'%24(BuildNumberMinor)' == ''">$(BuildNumberMinor)</BuildNumberMinor>
|
||||
<LatestCommit Condition="'%24(LatestCommit)' == ''">$(LatestCommit)</LatestCommit>
|
||||
<BuiltByString Condition="'%24(BuiltByString)' == ''">$(BuiltByString)</BuiltByString>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
]]>
|
||||
</VersionFileContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Since by default the file will get dropped at the obj dir, make sure that the dir is created already or else WriteLinesToFile will error. -->
|
||||
<MakeDir Directories="$(BuildVersionFilePath)" />
|
||||
|
||||
<WriteLinesToFile
|
||||
ContinueOnError="WarnAndContinue"
|
||||
Condition="!Exists('$(BuildVersionFile)')"
|
||||
File="$(BuildVersionFile)"
|
||||
Lines="$(VersionFileContent)"
|
||||
Overwrite="true" />
|
||||
|
||||
<!-- Delete old BuildVersion.props files -->
|
||||
<ItemGroup>
|
||||
<OldBuildVersionFiles Include="$(BuildVersionFilePath)BuildVersions-*.props" Exclude="$(BuildVersionFile)" />
|
||||
</ItemGroup>
|
||||
<Delete Files="@(OldBuildVersionFiles)" TreatErrorsAsWarnings="true"/>
|
||||
<ItemGroup>
|
||||
<OldBuildVersionFiles Remove="@(OldBuildVersionFiles)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Redefine AssemblyFileVersion because we just computed it. -->
|
||||
<AssemblyFileVersion>$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</AssemblyFileVersion>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<!-- This target will only be executed if BuildVersion.props doesn't exist yet -->
|
||||
<Target Name="CreateVersionFileDuringBuild" Condition="'$(SkipVersionGeneration)'!='true' AND '$(ShouldCreateVersionFileDuringBuild)'=='true'" DependsOnTargets="CreateOrUpdateCurrentVersionFile">
|
||||
<PropertyGroup Condition="'$(SkipVersionGeneration)'!='true'">
|
||||
<VersionSuffix Condition="'$(PreReleaseLabel)' != ''">-$(PreReleaseLabel)</VersionSuffix>
|
||||
<VersionSuffix Condition="'$(IncludeBuildNumberInPackageVersion)' == 'true'">$(VersionSuffix)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionSuffix>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="NativeResourceCompile" DependsOnTargets="$(BeforeResourceCompileTargets)" Inputs="$(MsBuildThisFileDirectory)NativeVersion.rc" Outputs="$(Win32Resource)">
|
||||
<Error Condition="!Exists('$(RCPATH)')" Text="NativeResourceCompile failed because RCPath is set to an non-existing rc.exe path." />
|
||||
|
||||
<Exec Command='"$(RCPath)" /i $(BaseIntermediateOutputPath) /i $(IntermediateOutputPath) /i $(WindowsSDKPath)\inc /i $(VCSDKPath)\Include /D _UNICODE /D UNICODE /l"0x0409" /r /fo "$(Win32Resource)" "$(MsBuildThisFileDirectory)NativeVersion.rc"' />
|
||||
</Target>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user