Add CommitHash to file info (#700)

This commit is contained in:
Pavel Krymets 2018-03-20 09:20:37 -07:00 committed by GitHub
parent 2bb9a8aaf9
commit f1d8ca3045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 40 deletions

25
build/native.targets Normal file
View File

@ -0,0 +1,25 @@
<Project>
<Target Name="CreateVersionHeader" BeforeTargets="PrepareForBuild">
<ItemGroup>
<VersionHeaderContents Include="// Copyright (c) .NET Foundation. All rights reserved." />
<VersionHeaderContents Include="// Licensed under the MIT License. See LICENSE.txt in the project root for license information." />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="// This file is auto-generated" />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="#define FileVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define FileVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define ProductVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define ProductVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define PlatformToolset &quot;$(PlatformToolset)\0&quot;" />
<VersionHeaderContents Include="#define CommitHash &quot;$(CommitHash)\0&quot;" />
</ItemGroup>
<ItemGroup>
<FileWrites Include="version.h" />
</ItemGroup>
<WriteLinesToFile File="version.h" Lines="@(VersionHeaderContents)" OverWrite="true" WriteOnlyWhenDifferent="True" />
</Target>
</Project>

View File

@ -7,9 +7,9 @@
<NuGetVerifierRuleFile Condition="'$(OS)' != 'Windows_NT'">$(RepositoryRoot)NuGetPackageVerifier.xplat.json</NuGetVerifierRuleFile> <NuGetVerifierRuleFile Condition="'$(OS)' != 'Windows_NT'">$(RepositoryRoot)NuGetPackageVerifier.xplat.json</NuGetVerifierRuleFile>
</PropertyGroup> </PropertyGroup>
<Target Name="BuildNativeAssets" DependsOnTargets="GetToolsets" > <Target Name="BuildNativeAssets" DependsOnTargets="Prepare;GetToolsets" >
<PropertyGroup> <PropertyGroup>
<BuildArgs>-p:Configuration=$(Configuration) -v:m -nologo -clp:NoSummary</BuildArgs> <BuildArgs>-p:Configuration=$(Configuration) -v:m -nologo -clp:NoSummary -p:CommitHash=$(CommitHash)</BuildArgs>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -227,24 +227,6 @@
<ClCompile Include="src\globalmodule.cpp" /> <ClCompile Include="src\globalmodule.cpp" />
<ClCompile Include="Src\proxymodule.cxx" /> <ClCompile Include="Src\proxymodule.cxx" />
</ItemGroup> </ItemGroup>
<Target Name="CreateVersionHeader" BeforeTargets="PrepareForBuild">
<ItemGroup>
<VersionHeaderContents Include="// Copyright (c) .NET Foundation. All rights reserved." />
<VersionHeaderContents Include="// Licensed under the MIT License. See LICENSE.txt in the project root for license information." />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="// This file is auto-generated" />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="#define FileVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define FileVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define ProductVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define ProductVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define PlatformToolset &quot;$(PlatformToolset)\0&quot;" />
</ItemGroup>
<WriteLinesToFile File="version.h" Lines="@(VersionHeaderContents)" OverWrite="true" WriteOnlyWhenDifferent="True" />
</Target>
<ItemGroup>
<FileWrites Include="version.h" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CommonLib\CommonLib.vcxproj"> <ProjectReference Include="..\CommonLib\CommonLib.vcxproj">
<Project>{55494e58-e061-4c4c-a0a8-837008e72f85}</Project> <Project>{55494e58-e061-4c4c-a0a8-837008e72f85}</Project>
@ -272,6 +254,7 @@
<ItemGroup> <ItemGroup>
<Xml Include="aspnetcore_schema.xml" /> <Xml Include="aspnetcore_schema.xml" />
</ItemGroup> </ItemGroup>
<Import Project="..\..\build\native.targets" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@ -10,6 +10,8 @@
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#define FileDescription "IIS AspNetCore Module. Commit: " CommitHash
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// 11 // 11
@ -75,7 +77,7 @@ BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "Microsoft Corporation" VALUE "CompanyName", "Microsoft Corporation"
VALUE "FileDescription", "IIS AspNetCore Module" VALUE "FileDescription", FileDescription
VALUE "FileVersion", FileVersionStr VALUE "FileVersion", FileVersionStr
VALUE "InternalName", "aspnetcore" VALUE "InternalName", "aspnetcore"
VALUE "LegalCopyright", "Copyright (C) Microsoft Corporation" VALUE "LegalCopyright", "Copyright (C) Microsoft Corporation"

View File

@ -238,24 +238,6 @@
<ClCompile Include="outofprocess\websockethandler.cxx" /> <ClCompile Include="outofprocess\websockethandler.cxx" />
<ClCompile Include="outofprocess\winhttphelper.cxx" /> <ClCompile Include="outofprocess\winhttphelper.cxx" />
</ItemGroup> </ItemGroup>
<Target Name="CreateVersionHeader" BeforeTargets="PrepareForBuild">
<ItemGroup>
<VersionHeaderContents Include="// Copyright (c) .NET Foundation. All rights reserved." />
<VersionHeaderContents Include="// Licensed under the MIT License. See LICENSE.txt in the project root for license information." />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="// This file is auto-generated" />
<VersionHeaderContents Include="%0a" />
<VersionHeaderContents Include="#define FileVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define FileVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define ProductVersion $(AspNetCoreModuleVersionMajor),$(AspNetCoreModuleVersionMinor),$(AssemblyBuild),$(AspNetCoreModuleVersionRevision)" />
<VersionHeaderContents Include="#define ProductVersionStr &quot;$(AspNetCoreModuleVersionMajor).$(AspNetCoreModuleVersionMinor).$(AssemblyBuild).$(AspNetCoreModuleVersionRevision)\0&quot;" />
<VersionHeaderContents Include="#define PlatformToolset &quot;$(PlatformToolset)\0&quot;" />
</ItemGroup>
<WriteLinesToFile File="version.h" Lines="@(VersionHeaderContents)" OverWrite="true" WriteOnlyWhenDifferent="True" />
</Target>
<ItemGroup>
<FileWrites Include="version.h" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CommonLib\CommonLib.vcxproj"> <ProjectReference Include="..\CommonLib\CommonLib.vcxproj">
<Project>{55494e58-e061-4c4c-a0a8-837008e72f85}</Project> <Project>{55494e58-e061-4c4c-a0a8-837008e72f85}</Project>
@ -270,6 +252,7 @@
<ItemGroup> <ItemGroup>
<None Include="Source.def" /> <None Include="Source.def" />
</ItemGroup> </ItemGroup>
<Import Project="..\..\build\native.targets" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@ -9,6 +9,8 @@
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#define FileDescription "IIS ASP.NET Core Module Request Handler. Commit: " CommitHash
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// 11 // 11
@ -74,7 +76,7 @@ BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "Microsoft" VALUE "CompanyName", "Microsoft"
VALUE "FileDescription", "IIS ASP.NET Core Module Request Handler" VALUE "FileDescription", FileDescription
VALUE "FileVersion", FileVersionStr VALUE "FileVersion", FileVersionStr
VALUE "InternalName", "aspnetcorerh.dll" VALUE "InternalName", "aspnetcorerh.dll"
VALUE "LegalCopyright", "Copyright (C) Microsoft Corporation" VALUE "LegalCopyright", "Copyright (C) Microsoft Corporation"