提交 de8c15c3 编写于 作者: D Davis Goodin 提交者: GitHub

Fix version info missing from native binaries (dotnet/core-setup#7864)

Allow the SDK to restore SourceLink and find its MSBuild props and targets files. These are used to fetch Git information.

Use Arcade-generated '_version.c'. The new '_version.c' is identical to the old 'version.cpp'. The host build.sh generated an empty 'version.cpp' when it doesn't already exist at the specified path, which caused the "No version information" message to be included.

Commit migrated from https://github.com/dotnet/core-setup/commit/bac3b0dc8ec9e0d4d2441524ed2bca24f8bab748
上级 3b8712b4
<Project> <Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" /> <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
<!-- <!--
Always disable sourcelink in this project so that Arcade doesn't complain about 'The target Add basic project properties for NuGet restore, needed to import the SourceLink MSBuild tool
"InitializeSourceControlInformationFromSourceControlManager" does not exist in the project.'. package's targets into the build.
--> -->
<Import Project="$(RepositoryEngineeringDir)/DisableSourceControlManagement.targets" <PropertyGroup>
Condition="'$(DisableSourceControlManagementTargetsImported)' != 'true'" /> <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<!-- Target that builds dotnet, hostfxr and hostpolicy with the same version as what NetCoreApp will be built for <!-- Target that builds dotnet, hostfxr and hostpolicy with the same version as what NetCoreApp will be built for
since the build produced artifacts should always version the same (even if they may not get used). since the build produced artifacts should always version the same (even if they may not get used).
...@@ -19,11 +21,6 @@ ...@@ -19,11 +21,6 @@
BuildCoreHostUnix; BuildCoreHostUnix;
BuildCoreHostWindows" /> BuildCoreHostWindows" />
<PropertyGroup Condition="'$(OSGroup)' != 'Windows_NT'">
<GenerateVersionSourceFile>true</GenerateVersionSourceFile>
<NativeVersionSourceFile>$(ObjDir)version.cpp</NativeVersionSourceFile>
</PropertyGroup>
<Target Name="BuildCoreHostUnix" <Target Name="BuildCoreHostUnix"
Condition="'$(OSGroup)' != 'Windows_NT'" Condition="'$(OSGroup)' != 'Windows_NT'"
DependsOnTargets="GetLatestCommitHash;GenerateNativeVersionFile"> DependsOnTargets="GetLatestCommitHash;GenerateNativeVersionFile">
......
...@@ -100,7 +100,7 @@ __configuration=Debug ...@@ -100,7 +100,7 @@ __configuration=Debug
__linkPortable=0 __linkPortable=0
__cmake_defines= __cmake_defines=
__baseIntermediateOutputPath="$RootRepo/artifacts/obj" __baseIntermediateOutputPath="$RootRepo/artifacts/obj"
__versionSourceFile="$__baseIntermediateOutputPath/version.cpp" __versionSourceFile="$__baseIntermediateOutputPath/_version.c"
__cmake_bin_prefix= __cmake_bin_prefix=
while [ "$1" != "" ]; do while [ "$1" != "" ]; do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册