Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
文字樣式
變更外觀
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
diff-runtime_sdk-Microsoft.NET.CrossGen.targets
建立於
9 個月前
差異永不過期
清除
匯出
分享
解釋
2 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
452 行
全部複製
7 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
457 行
全部複製
<!--
<!--
***********************************************************************************************
***********************************************************************************************
Microsoft.NET.CrossGen.targets
Microsoft.NET.CrossGen.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
***********************************************************************************************
-->
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
<!--
For ReadyToRun compilation, default to Crossgen for .NET Core 3.x and .NET 5. If PublishReadyToRunUseCrossgen2
For ReadyToRun compilation, default to Crossgen for .NET Core 3.x and .NET 5. If PublishReadyToRunUseCrossgen2
is set to true in the project or on the command line, use Crossgen2 and default to composite mode. For .NET 6
is set to true in the project or on the command line, use Crossgen2 and default to composite mode. For .NET 6
and higher, always use Crossgen2 and default to non-composite mode.
and higher, always use Crossgen2 and default to non-composite mode.
-->
-->
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0'">
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0'">
<PublishReadyToRunUseCrossgen2 Condition="'$(_TargetFrameworkVersionWithoutV)' >= '6.0'">true</PublishReadyToRunUseCrossgen2>
<PublishReadyToRunUseCrossgen2 Condition="'$(_TargetFrameworkVersionWithoutV)' >= '6.0'">true</PublishReadyToRunUseCrossgen2>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(PublishSingleFile)' == 'true' and '$(PublishReadyToRun)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '7.0'">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(PublishSingleFile)' == 'true' and '$(PublishReadyToRun)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '7.0'">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(_TargetFrameworkVersionWithoutV)' >= '6.0'">false</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(_TargetFrameworkVersionWithoutV)' >= '6.0'">false</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == ''">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == ''">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '$(SelfContained)' != 'true'">false</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '$(SelfContained)' != 'true'">false</PublishReadyToRunComposite>
<PublishReadyToRunUseRuntimePackOptimizationData Condition="'$(PublishReadyToRunUseRuntimePackOptimizationData)' == ''">true</PublishReadyToRunUseRuntimePackOptimizationData>
<PublishReadyToRunUseRuntimePackOptimizationData Condition="'$(PublishReadyToRunUseRuntimePackOptimizationData)' == ''">true</PublishReadyToRunUseRuntimePackOptimizationData>
<PublishReadyToRunPerfmapFormatVersion Condition="'$(PublishReadyToRunPerfmapFormatVersion)' == ''">1</PublishReadyToRunPerfmapFormatVersion>
<PublishReadyToRunPerfmapFormatVersion Condition="'$(PublishReadyToRunPerfmapFormatVersion)' == ''">1</PublishReadyToRunPerfmapFormatVersion>
複製
已複製
複製
已複製
<PublishReadyToRunEmitSymbols Condition="'$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos' or '$(TargetPlatformIdentifier)' == 'maccatalyst'">false</PublishReadyToRunEmitSymbols>
</PropertyGroup>
</PropertyGroup>
<!--
<!--
============================================================
============================================================
PrepOptimizer
PrepOptimizer
Sets up the common infrastructure for the optimization phase
Sets up the common infrastructure for the optimization phase
Outputs:
Outputs:
JitPath
JitPath
Crossgen
Crossgen
============================================================
============================================================
-->
-->
<Target Name="PrepOptimizer"
<Target Name="PrepOptimizer"
DependsOnTargets="_RestoreCrossgen;"
DependsOnTargets="_RestoreCrossgen;"
Condition="$(SkipOptimization) != 'true' ">
Condition="$(SkipOptimization) != 'true' ">
<!-- Get the coreclr path -->
<!-- Get the coreclr path -->
<ItemGroup>
<ItemGroup>
<_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
<_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" />
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" />
<_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
<_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" />
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" />
<_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
<_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" />
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" />
<_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
<_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)"
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" />
Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" />
</ItemGroup>
</ItemGroup>
<NETSdkError Condition="'@(_CoreclrResolvedPath->Count())' > 1"
<NETSdkError Condition="'@(_CoreclrResolvedPath->Count())' > 1"
ResourceName="MultipleFilesResolved"
ResourceName="MultipleFilesResolved"
FormatArguments="coreclr" />
FormatArguments="coreclr" />
<NETSdkError Condition="'@(_CoreclrResolvedPath)'== ''"
<NETSdkError Condition="'@(_CoreclrResolvedPath)'== ''"
ResourceName="UnableToFindResolvedPath"
ResourceName="UnableToFindResolvedPath"
FormatArguments="coreclr" />
FormatArguments="coreclr" />
<NETSdkError Condition="'@(_JitResolvedPath->Count())' > 1"
<NETSdkError Condition="'@(_JitResolvedPath->Count())' > 1"
ResourceName="MultipleFilesResolved"
ResourceName="MultipleFilesResolved"
FormatArguments="jit" />
FormatArguments="jit" />
<NETSdkError Condition="'@(_JitResolvedPath)'== ''"
<NETSdkError Condition="'@(_JitResolvedPath)'== ''"
ResourceName="UnableToFindResolvedPath"
ResourceName="UnableToFindResolvedPath"
FormatArguments="jit" />
FormatArguments="jit" />
<!-- Get the crossgen and jit path-->
<!-- Get the crossgen and jit path-->
<PropertyGroup>
<PropertyGroup>
<_CoreclrPath>@(_CoreclrResolvedPath)</_CoreclrPath>
<_CoreclrPath>@(_CoreclrResolvedPath)</_CoreclrPath>
<JitPath>@(_JitResolvedPath)</JitPath>
<JitPath>@(_JitResolvedPath)</JitPath>
<_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath)))</_CoreclrDir>
<_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath)))</_CoreclrDir>
<_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\"))</_CoreclrPkgDir>
<_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\"))</_CoreclrPkgDir>
<CrossgenDir>$([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools"))</CrossgenDir>
<CrossgenDir>$([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools"))</CrossgenDir>
<!-- TODO override with rid specific tools path for x-arch -->
<!-- TODO override with rid specific tools path for x-arch -->
<Crossgen>$([System.IO.Path]::Combine($(CrossgenDir),"crossgen"))</Crossgen>
<Crossgen>$([System.IO.Path]::Combine($(CrossgenDir),"crossgen"))</Crossgen>
<Crossgen Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe"))</Crossgen>
<Crossgen Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe"))</Crossgen>
</PropertyGroup>
</PropertyGroup>
<NETSdkError Condition="!Exists($(Crossgen))"
<NETSdkError Condition="!Exists($(Crossgen))"
ResourceName="UnableToFindResolvedPath"
ResourceName="UnableToFindResolvedPath"
FormatArguments="$(Crossgen)" />
FormatArguments="$(Crossgen)" />
<!-- Copy crossgen into the netcoreapp folder to ensure it can load Microsoft.DiaSymReader.Native when creating PDBs -->
<!-- Copy crossgen into the netcoreapp folder to ensure it can load Microsoft.DiaSymReader.Native when creating PDBs -->
<Copy SourceFiles="$(Crossgen)"
<Copy SourceFiles="$(Crossgen)"
DestinationFolder="$(_NetCoreRefDir)"
DestinationFolder="$(_NetCoreRefDir)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Copy>
<PropertyGroup>
<PropertyGroup>
<Crossgen>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen)))))))</Crossgen>
<Crossgen>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen)))))))</Crossgen>
</PropertyGroup>
</PropertyGroup>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
_RunOptimizer
_RunOptimizer
Start the optimization phase
Start the optimization phase
============================================================
============================================================
-->
-->
<Target Name="_RunOptimizer"
<Target Name="_RunOptimizer"
DependsOnTargets="_InitializeBasicProps;
DependsOnTargets="_InitializeBasicProps;
_ComputeResolvedFilesToStoreTypes;
_ComputeResolvedFilesToStoreTypes;
_SetupStageForCrossgen"
_SetupStageForCrossgen"
Condition="$(SkipOptimization) != 'true' ">
Condition="$(SkipOptimization) != 'true' ">
<ItemGroup>
<ItemGroup>
<AssembliestoCrossgen Include="$(MSBuildProjectFullPath)">
<AssembliestoCrossgen Include="$(MSBuildProjectFullPath)">
<Properties>
<Properties>
CrossgenExe=$(Crossgen);
CrossgenExe=$(Crossgen);
CrossgenJit=$(JitPath);
CrossgenJit=$(JitPath);
CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath);
CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath);
CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension);
CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension);
CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath);
CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath);
_RuntimeOptimizedDir=$(_RuntimeOptimizedDir);
_RuntimeOptimizedDir=$(_RuntimeOptimizedDir);
PublishDir=$(StoreStagingDir);
PublishDir=$(StoreStagingDir);
CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir);
CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir);
CreateProfilingSymbols=$(CreateProfilingSymbols);
CreateProfilingSymbols=$(CreateProfilingSymbols);
StoreSymbolsStagingDir=$(StoreSymbolsStagingDir);
StoreSymbolsStagingDir=$(StoreSymbolsStagingDir);
_RuntimeSymbolsDir=$(_RuntimeSymbolsDir)
_RuntimeSymbolsDir=$(_RuntimeSymbolsDir)
</Properties>
</Properties>
</AssembliestoCrossgen>
</AssembliestoCrossgen>
</ItemGroup>
</ItemGroup>
<!-- CrossGen the assemblies -->
<!-- CrossGen the assemblies -->
<MSBuild Projects="@(AssembliestoCrossgen)"
<MSBuild Projects="@(AssembliestoCrossgen)"
Targets="RunCrossGen"
Targets="RunCrossGen"
BuildInParallel="$(BuildInParallel)"
BuildInParallel="$(BuildInParallel)"
Condition="'@(_ManagedResolvedFilesToOptimize)' != ''"/>
Condition="'@(_ManagedResolvedFilesToOptimize)' != ''"/>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
RunCrossGen
RunCrossGen
Target Encapsulating the crossgen command
Target Encapsulating the crossgen command
============================================================
============================================================
-->
-->
<Target Name="RunCrossGen"
<Target Name="RunCrossGen"
DependsOnTargets="_InitializeBasicProps;">
DependsOnTargets="_InitializeBasicProps;">
<PropertyGroup>
<PropertyGroup>
<CrossgenProfilingSymbolsOutputDirectory>$([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath)))</CrossgenProfilingSymbolsOutputDirectory>
<CrossgenProfilingSymbolsOutputDirectory>$([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath)))</CrossgenProfilingSymbolsOutputDirectory>
<CrossgenSymbolsStagingDirectory>$([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath)))</CrossgenSymbolsStagingDirectory>
<CrossgenSymbolsStagingDirectory>$([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath)))</CrossgenSymbolsStagingDirectory>
<CrossgenCommandline>$(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)"</CrossgenCommandline>
<CrossgenCommandline>$(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)"</CrossgenCommandline>
<CreateProfilingSymbolsOptionName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">CreatePDB</CreateProfilingSymbolsOptionName>
<CreateProfilingSymbolsOptionName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">CreatePDB</CreateProfilingSymbolsOptionName>
<CreateProfilingSymbolsOptionName Condition="'$(CreateProfilingSymbolsOptionName)' == ''">CreatePerfMap</CreateProfilingSymbolsOptionName>
<CreateProfilingSymbolsOptionName Condition="'$(CreateProfilingSymbolsOptionName)' == ''">CreatePerfMap</CreateProfilingSymbolsOptionName>
</PropertyGroup>
</PropertyGroup>
<Message Text="CrossgenCommandline: $(CrossgenCommandline)"/>
<Message Text="CrossgenCommandline: $(CrossgenCommandline)"/>
<!--Optimization skip if the assembly is already present in the final output directory-->
<!--Optimization skip if the assembly is already present in the final output directory-->
<Exec
<Exec
Command="$(CrossgenCommandline)"
Command="$(CrossgenCommandline)"
Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))"
Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))"
IgnoreStandardErrorWarningFormat="true" />
IgnoreStandardErrorWarningFormat="true" />
<Copy SourceFiles = "$(CrossgenOutputAssembly)"
<Copy SourceFiles = "$(CrossgenOutputAssembly)"
DestinationFiles="$(PublishDir)\$(CrossgenSubOutputPath)"
DestinationFiles="$(PublishDir)\$(CrossgenSubOutputPath)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))">
Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Copy>
<!-- Create profiling symbols if requested -->
<!-- Create profiling symbols if requested -->
<MakeDir Directories="$(CrossgenProfilingSymbolsOutputDirectory)"
<MakeDir Directories="$(CrossgenProfilingSymbolsOutputDirectory)"
Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" />
Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" />
<Exec Command="$(CrossgenExe) -nologo -readytorun -platform_assemblies_paths $(CrossgenPlatformAssembliesPath) -$(CreateProfilingSymbolsOptionName) $(CrossgenProfilingSymbolsOutputDirectory) $(CrossgenOutputAssembly)"
<Exec Command="$(CrossgenExe) -nologo -readytorun -platform_assemblies_paths $(CrossgenPlatformAssembliesPath) -$(CreateProfilingSymbolsOptionName) $(CrossgenProfilingSymbolsOutputDirectory) $(CrossgenOutputAssembly)"
Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))"
Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))"
IgnoreStandardErrorWarningFormat="true" />
IgnoreStandardErrorWarningFormat="true" />
<ItemGroup>
<ItemGroup>
<_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*"
<_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*"
Condition="'$(CreateProfilingSymbols)' == 'true'" />
Condition="'$(CreateProfilingSymbols)' == 'true'" />
</ItemGroup>
</ItemGroup>
<Copy SourceFiles="@(_ProfilingSymbols)"
<Copy SourceFiles="@(_ProfilingSymbols)"
DestinationFolder="$(CrossgenSymbolsStagingDirectory)"
DestinationFolder="$(CrossgenSymbolsStagingDirectory)"
Condition="'$(CreateProfilingSymbols)' == 'true'"
Condition="'$(CreateProfilingSymbols)' == 'true'"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)">
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Copy>
</Target>
</Target>
<Target Name="_InitializeBasicProps">
<Target Name="_InitializeBasicProps">
<PropertyGroup>
<PropertyGroup>
<PathSeparator>$([System.IO.Path]::PathSeparator)</PathSeparator>
<PathSeparator>$([System.IO.Path]::PathSeparator)</PathSeparator>
<DirectorySeparatorChar>$([System.IO.Path]::DirectorySeparatorChar)</DirectorySeparatorChar>
<DirectorySeparatorChar>$([System.IO.Path]::DirectorySeparatorChar)</DirectorySeparatorChar>
</PropertyGroup>
</PropertyGroup>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
_GetCrossgenProps
_GetCrossgenProps
Generates props used by Crossgen
Generates props used by Crossgen
============================================================
============================================================
-->
-->
<Target Name="_GetCrossgenProps"
<Target Name="_GetCrossgenProps"
Condition="$(SkipOptimization) != 'true' ">
Condition="$(SkipOptimization) != 'true' ">
<PropertyGroup>
<PropertyGroup>
<_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize"))</_CrossProjFileDir>
<_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize"))</_CrossProjFileDir>
<_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp"))</_NetCoreRefDir> <!-- flat netcore app assemblies-->
<_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp"))</_NetCoreRefDir> <!-- flat netcore app assemblies-->
</PropertyGroup>
</PropertyGroup>
<MakeDir Directories="$(_CrossProjFileDir)"/>
<MakeDir Directories="$(_CrossProjFileDir)"/>
<PropertyGroup>
<PropertyGroup>
<_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json))</_CrossProjAssetsFile>
<_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json))</_CrossProjAssetsFile>
</PropertyGroup>
</PropertyGroup>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
_SetupStageForCrossgen
_SetupStageForCrossgen
============================================================
============================================================
-->
-->
<Target Name="_SetupStageForCrossgen"
<Target Name="_SetupStageForCrossgen"
DependsOnTargets="_GetCrossgenProps;">
DependsOnTargets="_GetCrossgenProps;">
<PropertyGroup>
<PropertyGroup>
<_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref"))</_RuntimeRefDir> <!-- flat app managed assemblies -->
<_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref"))</_RuntimeRefDir> <!-- flat app managed assemblies -->
<_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt"))</_RuntimeOptimizedDir> <!-- optimized app managed assemblies in nuget cache layout -->
<_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt"))</_RuntimeOptimizedDir> <!-- optimized app managed assemblies in nuget cache layout -->
<_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols"))</_RuntimeSymbolsDir>
<_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols"))</_RuntimeSymbolsDir>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" />
<_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" />
</ItemGroup>
</ItemGroup>
<MakeDir Directories="$(_RuntimeOptimizedDir)"/>
<MakeDir Directories="$(_RuntimeOptimizedDir)"/>
<MakeDir Directories="$(_RuntimeSymbolsDir)"
<MakeDir Directories="$(_RuntimeSymbolsDir)"
Condition="'$(CreateProfilingSymbols)' == 'true'" />
Condition="'$(CreateProfilingSymbols)' == 'true'" />
<!-- Copy managed files to a flat temp directory for passing it as ref -->
<!-- Copy managed files to a flat temp directory for passing it as ref -->
<Copy SourceFiles = "@(_ManagedResolvedFilesToOptimize)"
<Copy SourceFiles = "@(_ManagedResolvedFilesToOptimize)"
DestinationFolder="$(_RuntimeRefDir)"
DestinationFolder="$(_RuntimeRefDir)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Copy>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
_RestoreCrossgen
_RestoreCrossgen
Restores netcoreapp and publishes it to a temp directory
Restores netcoreapp and publishes it to a temp directory
============================================================
============================================================
-->
-->
<Target Name="_RestoreCrossgen"
<Target Name="_RestoreCrossgen"
DependsOnTargets="PrepforRestoreForComposeStore;
DependsOnTargets="PrepforRestoreForComposeStore;
_SetupStageForCrossgen;
_SetupStageForCrossgen;
ProcessFrameworkReferences;
ProcessFrameworkReferences;
ApplyImplicitVersions;
ApplyImplicitVersions;
_ComputePackageReferencePublish"
_ComputePackageReferencePublish"
Condition="$(SkipOptimization) != 'true' ">
Condition="$(SkipOptimization) != 'true' ">
<ItemGroup>
<ItemGroup>
<!-- Filter package references to the one for the platform library, in order to find the right version -->
<!-- Filter package references to the one for the platform library, in order to find the right version -->
<PackageReferenceForCrossGen Include="@(PackageReference)" Condition="'%(Identity)' == '$(MicrosoftNETPlatformLibrary)'" />
<PackageReferenceForCrossGen Include="@(PackageReference)" Condition="'%(Identity)' == '$(MicrosoftNETPlatformLibrary)'" />
</ItemGroup>
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)"
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="Restore"
Targets="Restore"
Properties="RuntimeIdentifiers=$(RuntimeIdentifier);
Properties="RuntimeIdentifiers=$(RuntimeIdentifier);
RestoreGraphProjectInput=$(MSBuildProjectFullPath);
RestoreGraphProjectInput=$(MSBuildProjectFullPath);
RestoreOutputPath=$(_CrossProjFileDir);
RestoreOutputPath=$(_CrossProjFileDir);
StorePackageName=$(MicrosoftNETPlatformLibrary);
StorePackageName=$(MicrosoftNETPlatformLibrary);
StorePackageVersion=%(PackageReferenceForCrossGen.Version);"/>
StorePackageVersion=%(PackageReferenceForCrossGen.Version);"/>
<!-- For future: Use ResolvePackageAssets instead of ResolveCopyLocalAssets, delete ResolveCopyLocalAssets task -->
<!-- For future: Use ResolvePackageAssets instead of ResolveCopyLocalAssets, delete ResolveCopyLocalAssets task -->
<ResolveCopyLocalAssets Condition="'$(_TargetFrameworkVersionWithoutV)' < '3.0'"
<ResolveCopyLocalAssets Condition="'$(_TargetFrameworkVersionWithoutV)' < '3.0'"
AssetsFilePath="$(_CrossProjAssetsFile)"
AssetsFilePath="$(_CrossProjAssetsFile)"
TargetFramework="$(_TFM)"
TargetFramework="$(_TFM)"
RuntimeIdentifier="$(RuntimeIdentifier)"
RuntimeIdentifier="$(RuntimeIdentifier)"
PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
RuntimeFrameworks="@(RuntimeFramework)"
RuntimeFrameworks="@(RuntimeFramework)"
ExcludedPackageReferences="@(_ExcludeFromPublishPackageReference)"
ExcludedPackageReferences="@(_ExcludeFromPublishPackageReference)"
IsSelfContained="$(SelfContained)"
IsSelfContained="$(SelfContained)"
PreserveStoreLayout="false">
PreserveStoreLayout="false">
<Output TaskParameter="ResolvedAssets" ItemName="CrossgenResolvedAssembliesToPublish" />
<Output TaskParameter="ResolvedAssets" ItemName="CrossgenResolvedAssembliesToPublish" />
</ResolveCopyLocalAssets>
</ResolveCopyLocalAssets>
<GetPackageDirectory Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'"
<GetPackageDirectory Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'"
Items="@(RuntimePack)"
Items="@(RuntimePack)"
AssetsFileWithAdditionalPackageFolders="$(_CrossProjAssetsFile)">
AssetsFileWithAdditionalPackageFolders="$(_CrossProjAssetsFile)">
<Output TaskParameter="Output" ItemName="_CrossgenRuntimePack" />
<Output TaskParameter="Output" ItemName="_CrossgenRuntimePack" />
</GetPackageDirectory>
</GetPackageDirectory>
<ResolveRuntimePackAssets Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'"
<ResolveRuntimePackAssets Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'"
FrameworkReferences="@(FrameworkReference)"
FrameworkReferences="@(FrameworkReference)"
ResolvedRuntimePacks="@(_CrossgenRuntimePack)"
ResolvedRuntimePacks="@(_CrossgenRuntimePack)"
DisableTransitiveFrameworkReferenceDownloads="$(DisableTransitiveFrameworkReferenceDownloads)">
DisableTransitiveFrameworkReferenceDownloads="$(DisableTransitiveFrameworkReferenceDownloads)">
<Output TaskParameter="RuntimePackAssets" ItemName="CrossgenResolvedAssembliesToPublish" />
<Output TaskParameter="RuntimePackAssets" ItemName="CrossgenResolvedAssembliesToPublish" />
</ResolveRuntimePackAssets>
</ResolveRuntimePackAssets>
<!-- Copy managed files to a flat temp directory for passing it as ref for crossgen -->
<!-- Copy managed files to a flat temp directory for passing it as ref for crossgen -->
<Copy SourceFiles = "@(CrossgenResolvedAssembliesToPublish)"
<Copy SourceFiles = "@(CrossgenResolvedAssembliesToPublish)"
DestinationFolder="$(_NetCoreRefDir)"
DestinationFolder="$(_NetCoreRefDir)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Copy>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
CreateReadyToRunImages
CreateReadyToRunImages
Create ReadyToRun images for managed assemblies in _ResolvedFileToPublishAlways and _ResolvedFileToPublishPreserveNewest.
Create ReadyToRun images for managed assemblies in _ResolvedFileToPublishAlways and _ResolvedFileToPublishPreserveNewest.
============================================================
============================================================
-->
-->
<Target Name="CreateReadyToRunImages"
<Target Name="CreateReadyToRunImages"
Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0' And '$(PublishReadyToRun)' == 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'"
Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0' And '$(PublishReadyToRun)' == 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'"
DependsOnTargets="_PrepareForReadyToRunCompilation;
DependsOnTargets="_PrepareForReadyToRunCompilation;
_CreateR2RImages;
_CreateR2RImages;
_CreateR2RSymbols">
_CreateR2RSymbols">
<ItemGroup>
<ItemGroup>
<R2RTelemetry Include="PublishReadyToRunUseCrossgen2" Value="$(PublishReadyToRunUseCrossgen2)" />
<R2RTelemetry Include="PublishReadyToRunUseCrossgen2" Value="$(PublishReadyToRunUseCrossgen2)" />
<R2RTelemetry Include="Crossgen2PackVersion" Value="%(ResolvedCrossgen2Pack.NuGetPackageVersion)" />
<R2RTelemetry Include="Crossgen2PackVersion" Value="%(ResolvedCrossgen2Pack.NuGetPackageVersion)" />
<R2RTelemetry Include="CompileListCount" Value="@(_ReadyToRunCompileList->Count())" />
<R2RTelemetry Include="CompileListCount" Value="@(_ReadyToRunCompileList->Count())" />
<R2RTelemetry Include="FailedCount" Value="@(_ReadyToRunCompilationFailures->Count())" />
<R2RTelemetry Include="FailedCount" Value="@(_ReadyToRunCompilationFailures->Count())" />
</ItemGroup>
</ItemGroup>
<AllowEmptyTelemetry EventName="ReadyToRun" EventData="@(R2RTelemetry)" />
<AllowEmptyTelemetry EventName="ReadyToRun" EventData="@(R2RTelemetry)" />
<NETSdkError Condition="'@(_ReadyToRunCompilationFailures)' != ''" ResourceName="ReadyToRunCompilationFailed" />
<NETSdkError Condition="'@(_ReadyToRunCompilationFailures)' != ''" ResourceName="ReadyToRunCompilationFailed" />
<NETSdkInformation Condition="'$(_ReadyToRunCompilerHasWarnings)' != ''" ResourceName="ReadyToRunCompilationHasWarnings_Info" />
<NETSdkInformation Condition="'$(_ReadyToRunCompilerHasWarnings)' != ''" ResourceName="ReadyToRunCompilationHasWarnings_Info" />
<ItemGroup>
<ItemGroup>
<!--
<!--
Note: we only remove the entries for the IL images and replace them with the entries for the R2R images.
Note: we only remove the entries for the IL images and replace them with the entries for the R2R images.
We do not do the same for PDBs, because the native PDBs created by the R2R compiler complement the IL PDBs
We do not do the same for PDBs, because the native PDBs created by the R2R compiler complement the IL PDBs
and do not replace them. IL PDBs are still required for debugging. Native PDBs emitted by the R2R compiler are
and do not replace them. IL PDBs are still required for debugging. Native PDBs emitted by the R2R compiler are
only used for profiling purposes.
only used for profiling purposes.
-->
-->
<ResolvedFileToPublish Remove="@(_ReadyToRunCompositeBuildInput)" />
<ResolvedFileToPublish Remove="@(_ReadyToRunCompositeBuildInput)" />
<ResolvedFileToPublish Remove="@(_ReadyToRunCompileList)" />
<ResolvedFileToPublish Remove="@(_ReadyToRunCompileList)" />
<ResolvedFileToPublish Include="@(_ReadyToRunFilesToPublish)" />
<ResolvedFileToPublish Include="@(_ReadyToRunFilesToPublish)" />
</ItemGroup>
</ItemGroup>
</Target>
</Target>
<!--
<!--
============================================================
============================================================
_PrepareForReadyToRunCompilation
_PrepareForReadyToRunCompilation
Prepare build for ReadyToRun compilations. Builds list of assemblies to compile, and computes paths to ReadyToRun compiler bits
Prepare build for ReadyToRun compilations. Builds list of assemblies to compile, and computes paths to ReadyToRun compiler bits
============================================================
============================================================
-->
-->
<UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="PrepareForReadyToRunCompilation" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="PrepareForReadyToRunCompilation" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="_PrepareForReadyToRunCompilation" DependsOnTargets="ResolveReadyToRunCompilers;_ComputeManagedRuntimePackAssemblies;_ComputeAssembliesToPostprocessOnPublish">
<Target Name="_PrepareForReadyToRunCompilation" DependsOnTargets="ResolveReadyToRunCompilers;_ComputeManagedRuntimePackAssemblies;_ComputeAssembliesToPostprocessOnPublish">
<PropertyGroup>
<PropertyGroup>
<_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R</_ReadyToRunOutputPath>
<_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R</_ReadyToRunOutputPath>
</PropertyGroup>
</PropertyGroup>
<MakeDir Directories="$(_ReadyToRunOutputPath)" />
<MakeDir Directories="$(_ReadyToRunOutputPath)" />
<ItemGroup>
<ItemGroup>
<_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" />
<_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" />
</ItemGroup>
</ItemGroup>
<!-- Even if app is not self-contained, crossgen requires closure of implementation assemblies. Resolve conflicts
<!-- Even if app is not self-contained, crossgen requires closure of implementation assemblies. Resolve conflicts
of the runtime pack assets as though we were copying them locally, and add them to the R2R implementation
of the runtime pack assets as though we were copying them locally, and add them to the R2R implementation
assembly list. -->
assembly list. -->
<ItemGroup Condition="'$(SelfContained)' != 'true'">
<ItemGroup Condition="'$(SelfContained)' != 'true'">
<_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" />
<_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" />
</ItemGroup>
</ItemGroup>
<ResolvePackageFileConflicts Condition="'$(SelfContained)' != 'true'"
<ResolvePackageFileConflicts Condition="'$(SelfContained)' != 'true'"
ReferenceCopyLocalPaths="@(_ReadyToRunImplementationAssemblies)">
ReferenceCopyLocalPaths="@(_ReadyToRunImplementationAssemblies)">
<Output TaskParameter="ReferenceCopyLocalPathsWithoutConflicts" ItemName="_ReadyToRunImplementationAssembliesWithoutConflicts" />
<Output TaskParameter="ReferenceCopyLocalPathsWithoutConflicts" ItemName="_ReadyToRunImplementationAssembliesWithoutConflicts" />
</ResolvePackageFileConflicts>
</ResolvePackageFileConflicts>
<ItemGroup Condition="'$(SelfContained)' != 'true'">
<ItemGroup Condition="'$(SelfContained)' != 'true'">
<_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" />
<_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" />
<_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" />
<_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" />
<_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" />
<_ReadyToRunPgoFiles Include="@(RuntimePackAsset)"
<_ReadyToRunPgoFiles Include="@(RuntimePackAsset)"
Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" />
Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" />
</ItemGroup>
</ItemGroup>
<PrepareForReadyToRunCompilation CrossgenTool="@(CrossgenTool)"
<PrepareForReadyToRunCompilation CrossgenTool="@(CrossgenTool)"
Crossgen2Tool="@(Crossgen2Tool)"
Crossgen2Tool="@(Crossgen2Tool)"
OutputPath="$(_ReadyToRunOutputPath)"
OutputPath="$(_ReadyToRunOutputPath)"
MainAssembly="@(IntermediateAssembly)"
MainAssembly="@(IntermediateAssembly)"
Assemblies="@(_ReadyToRunImplementationAssemblies)"
Assemblies="@(_ReadyToRunImplementationAssemblies)"
ExcludeList="@(PublishReadyToRunExclude)"
ExcludeList="@(PublishReadyToRunExclude)"
EmitSymbols="$(PublishReadyToRunEmitSymbols)"
EmitSymbols="$(PublishReadyToRunEmitSymbols)"
IncludeSymbolsInSingleFile="$(IncludeSymbolsInSingleFile)"
IncludeSymbolsInSingleFile="$(IncludeSymbolsInSingleFile)"
ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)"
ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)"
Crossgen2Composite="$(PublishReadyToRunComposite)"
Crossgen2Composite="$(PublishReadyToRunComposite)"
PublishReadyToRunCompositeExclusions="@(PublishReadyToRunCompositeExclusions)"
PublishReadyToRunCompositeExclusions="@(PublishReadyToRunCompositeExclusions)"
PublishReadyToRunCompositeRoots="@(PublishReadyToRunCompositeRoots)">
PublishReadyToRunCompositeRoots="@(PublishReadyToRunCompositeRoots)">
<Output TaskParameter="ReadyToRunCompileList" ItemName="_ReadyToRunCompileList" />
<Output TaskParameter="ReadyToRunCompileList" ItemName="_ReadyToRunCompileList" />
<Output TaskParameter="ReadyToRunSymbolsCompileList" ItemName="_ReadyToRunSymbolsCompileList" />
<Output TaskParameter="ReadyToRunSymbolsCompileList" ItemName="_ReadyToRunSymbolsCompileList" />
<Output TaskParameter="ReadyToRunFilesToPublish" ItemName="_ReadyToRunFilesToPublish" />
<Output TaskParameter="ReadyToRunFilesToPublish" ItemName="_ReadyToRunFilesToPublish" />
<Output TaskParameter="ReadyToRunAssembliesToReference" ItemName="_ReadyToRunAssembliesToReference" />
<Output TaskParameter="ReadyToRunAssembliesToReference" ItemName="_ReadyToRunAssembliesToReference" />
<Output TaskParameter="ReadyToRunCompositeBuildReferences" ItemName="_ReadyToRunCompositeBuildReferences" />
<Output TaskParameter="ReadyToRunCompositeBuildReferences" ItemName="_ReadyToRunCompositeBuildReferences" />
<Output TaskParameter="ReadyToRunCompositeBuildInput" ItemName="_ReadyToRunCompositeBuildInput" />
<Output TaskParameter="ReadyToRunCompositeBuildInput" ItemName="_ReadyToRunCompositeBuildInput" />
<Output TaskParameter="ReadyToRunCompositeUnrootedBuildInput" ItemName="_ReadyToRunCompositeUnrootedBuildInput" />
<Output TaskParameter="ReadyToRunCompositeUnrootedBuildInput" ItemName="_ReadyToRunCompositeUnrootedBuildInput" />
</PrepareForReadyToRunCompilation>
</PrepareForReadyToRunCompilation>
</Target>
</Target>
<UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="ResolveReadyToRunCompilers" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="ResolveReadyToRunCompilers" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="ResolveReadyToRunCompilers">
<Target Name="ResolveReadyToRunCompilers">
<ResolveReadyToRunCompilers RuntimePacks="@(ResolvedRuntimePack)"
<ResolveReadyToRunCompilers RuntimePacks="@(ResolvedRuntimePack)"
Crossgen2Packs="@(ResolvedCrossgen2Pack)"
Crossgen2Packs="@(ResolvedCrossgen2Pack)"
TargetingPacks="@(ResolvedTargetingPack)"
TargetingPacks="@(ResolvedTargetingPack)"
RuntimeGraphPath="$(RuntimeIdentifierGraphPath)"
RuntimeGraphPath="$(RuntimeIdentifierGraphPath)"
NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)"
NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)"
EmitSymbols="$(PublishReadyToRunEmitSymbols)"
EmitSymbols="$(PublishReadyToRunEmitSymbols)"
ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)"
ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)"
PerfmapFormatVersion="$(PublishReadyToRunPerfmapFormatVersion)">
PerfmapFormatVersion="$(PublishReadyToRunPerfmapFormatVersion)">
<Output TaskParameter="CrossgenTool" ItemName="CrossgenTool" />
<Output TaskParameter="CrossgenTool" ItemName="CrossgenTool" />
複製
已複製
複製
已複製
<Output TaskParameter="
Cro
<Output TaskParameter="
Crossgen2Tool" ItemName="Crossgen2Tool" />
</ResolveReadyToRunCompilers>
</Target>
<!--
============================================================
_CreateR2RImages
已保存差異
原始文本
開啟檔案
<!-- *********************************************************************************************** Microsoft.NET.CrossGen.targets WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- For ReadyToRun compilation, default to Crossgen for .NET Core 3.x and .NET 5. If PublishReadyToRunUseCrossgen2 is set to true in the project or on the command line, use Crossgen2 and default to composite mode. For .NET 6 and higher, always use Crossgen2 and default to non-composite mode. --> <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0'"> <PublishReadyToRunUseCrossgen2 Condition="'$(_TargetFrameworkVersionWithoutV)' >= '6.0'">true</PublishReadyToRunUseCrossgen2> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(PublishSingleFile)' == 'true' and '$(PublishReadyToRun)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '7.0'">true</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(_TargetFrameworkVersionWithoutV)' >= '6.0'">false</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == ''">true</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '$(SelfContained)' != 'true'">false</PublishReadyToRunComposite> <PublishReadyToRunUseRuntimePackOptimizationData Condition="'$(PublishReadyToRunUseRuntimePackOptimizationData)' == ''">true</PublishReadyToRunUseRuntimePackOptimizationData> <PublishReadyToRunPerfmapFormatVersion Condition="'$(PublishReadyToRunPerfmapFormatVersion)' == ''">1</PublishReadyToRunPerfmapFormatVersion> <PublishReadyToRunEmitSymbols Condition="'$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos' or '$(TargetPlatformIdentifier)' == 'maccatalyst'">false</PublishReadyToRunEmitSymbols> </PropertyGroup> <!-- ============================================================ PrepOptimizer Sets up the common infrastructure for the optimization phase Outputs: JitPath Crossgen ============================================================ --> <Target Name="PrepOptimizer" DependsOnTargets="_RestoreCrossgen;" Condition="$(SkipOptimization) != 'true' "> <!-- Get the coreclr path --> <ItemGroup> <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" /> <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" /> <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" /> <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" /> </ItemGroup> <NETSdkError Condition="'@(_CoreclrResolvedPath->Count())' > 1" ResourceName="MultipleFilesResolved" FormatArguments="coreclr" /> <NETSdkError Condition="'@(_CoreclrResolvedPath)'== ''" ResourceName="UnableToFindResolvedPath" FormatArguments="coreclr" /> <NETSdkError Condition="'@(_JitResolvedPath->Count())' > 1" ResourceName="MultipleFilesResolved" FormatArguments="jit" /> <NETSdkError Condition="'@(_JitResolvedPath)'== ''" ResourceName="UnableToFindResolvedPath" FormatArguments="jit" /> <!-- Get the crossgen and jit path--> <PropertyGroup> <_CoreclrPath>@(_CoreclrResolvedPath)</_CoreclrPath> <JitPath>@(_JitResolvedPath)</JitPath> <_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath)))</_CoreclrDir> <_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\"))</_CoreclrPkgDir> <CrossgenDir>$([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools"))</CrossgenDir> <!-- TODO override with rid specific tools path for x-arch --> <Crossgen>$([System.IO.Path]::Combine($(CrossgenDir),"crossgen"))</Crossgen> <Crossgen Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe"))</Crossgen> </PropertyGroup> <NETSdkError Condition="!Exists($(Crossgen))" ResourceName="UnableToFindResolvedPath" FormatArguments="$(Crossgen)" /> <!-- Copy crossgen into the netcoreapp folder to ensure it can load Microsoft.DiaSymReader.Native when creating PDBs --> <Copy SourceFiles="$(Crossgen)" DestinationFolder="$(_NetCoreRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> <PropertyGroup> <Crossgen>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen)))))))</Crossgen> </PropertyGroup> </Target> <!-- ============================================================ _RunOptimizer Start the optimization phase ============================================================ --> <Target Name="_RunOptimizer" DependsOnTargets="_InitializeBasicProps; _ComputeResolvedFilesToStoreTypes; _SetupStageForCrossgen" Condition="$(SkipOptimization) != 'true' "> <ItemGroup> <AssembliestoCrossgen Include="$(MSBuildProjectFullPath)"> <Properties> CrossgenExe=$(Crossgen); CrossgenJit=$(JitPath); CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath); CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension); CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath); _RuntimeOptimizedDir=$(_RuntimeOptimizedDir); PublishDir=$(StoreStagingDir); CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir); CreateProfilingSymbols=$(CreateProfilingSymbols); StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); _RuntimeSymbolsDir=$(_RuntimeSymbolsDir) </Properties> </AssembliestoCrossgen> </ItemGroup> <!-- CrossGen the assemblies --> <MSBuild Projects="@(AssembliestoCrossgen)" Targets="RunCrossGen" BuildInParallel="$(BuildInParallel)" Condition="'@(_ManagedResolvedFilesToOptimize)' != ''"/> </Target> <!-- ============================================================ RunCrossGen Target Encapsulating the crossgen command ============================================================ --> <Target Name="RunCrossGen" DependsOnTargets="_InitializeBasicProps;"> <PropertyGroup> <CrossgenProfilingSymbolsOutputDirectory>$([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath)))</CrossgenProfilingSymbolsOutputDirectory> <CrossgenSymbolsStagingDirectory>$([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath)))</CrossgenSymbolsStagingDirectory> <CrossgenCommandline>$(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)"</CrossgenCommandline> <CreateProfilingSymbolsOptionName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">CreatePDB</CreateProfilingSymbolsOptionName> <CreateProfilingSymbolsOptionName Condition="'$(CreateProfilingSymbolsOptionName)' == ''">CreatePerfMap</CreateProfilingSymbolsOptionName> </PropertyGroup> <Message Text="CrossgenCommandline: $(CrossgenCommandline)"/> <!--Optimization skip if the assembly is already present in the final output directory--> <Exec Command="$(CrossgenCommandline)" Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))" IgnoreStandardErrorWarningFormat="true" /> <Copy SourceFiles = "$(CrossgenOutputAssembly)" DestinationFiles="$(PublishDir)\$(CrossgenSubOutputPath)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> <!-- Create profiling symbols if requested --> <MakeDir Directories="$(CrossgenProfilingSymbolsOutputDirectory)" Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" /> <Exec Command="$(CrossgenExe) -nologo -readytorun -platform_assemblies_paths $(CrossgenPlatformAssembliesPath) -$(CreateProfilingSymbolsOptionName) $(CrossgenProfilingSymbolsOutputDirectory) $(CrossgenOutputAssembly)" Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" IgnoreStandardErrorWarningFormat="true" /> <ItemGroup> <_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*" Condition="'$(CreateProfilingSymbols)' == 'true'" /> </ItemGroup> <Copy SourceFiles="@(_ProfilingSymbols)" DestinationFolder="$(CrossgenSymbolsStagingDirectory)" Condition="'$(CreateProfilingSymbols)' == 'true'" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <Target Name="_InitializeBasicProps"> <PropertyGroup> <PathSeparator>$([System.IO.Path]::PathSeparator)</PathSeparator> <DirectorySeparatorChar>$([System.IO.Path]::DirectorySeparatorChar)</DirectorySeparatorChar> </PropertyGroup> </Target> <!-- ============================================================ _GetCrossgenProps Generates props used by Crossgen ============================================================ --> <Target Name="_GetCrossgenProps" Condition="$(SkipOptimization) != 'true' "> <PropertyGroup> <_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize"))</_CrossProjFileDir> <_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp"))</_NetCoreRefDir> <!-- flat netcore app assemblies--> </PropertyGroup> <MakeDir Directories="$(_CrossProjFileDir)"/> <PropertyGroup> <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json))</_CrossProjAssetsFile> </PropertyGroup> </Target> <!-- ============================================================ _SetupStageForCrossgen ============================================================ --> <Target Name="_SetupStageForCrossgen" DependsOnTargets="_GetCrossgenProps;"> <PropertyGroup> <_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref"))</_RuntimeRefDir> <!-- flat app managed assemblies --> <_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt"))</_RuntimeOptimizedDir> <!-- optimized app managed assemblies in nuget cache layout --> <_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols"))</_RuntimeSymbolsDir> </PropertyGroup> <ItemGroup> <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> </ItemGroup> <MakeDir Directories="$(_RuntimeOptimizedDir)"/> <MakeDir Directories="$(_RuntimeSymbolsDir)" Condition="'$(CreateProfilingSymbols)' == 'true'" /> <!-- Copy managed files to a flat temp directory for passing it as ref --> <Copy SourceFiles = "@(_ManagedResolvedFilesToOptimize)" DestinationFolder="$(_RuntimeRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <!-- ============================================================ _RestoreCrossgen Restores netcoreapp and publishes it to a temp directory ============================================================ --> <Target Name="_RestoreCrossgen" DependsOnTargets="PrepforRestoreForComposeStore; _SetupStageForCrossgen; ProcessFrameworkReferences; ApplyImplicitVersions; _ComputePackageReferencePublish" Condition="$(SkipOptimization) != 'true' "> <ItemGroup> <!-- Filter package references to the one for the platform library, in order to find the right version --> <PackageReferenceForCrossGen Include="@(PackageReference)" Condition="'%(Identity)' == '$(MicrosoftNETPlatformLibrary)'" /> </ItemGroup> <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="RuntimeIdentifiers=$(RuntimeIdentifier); RestoreGraphProjectInput=$(MSBuildProjectFullPath); RestoreOutputPath=$(_CrossProjFileDir); StorePackageName=$(MicrosoftNETPlatformLibrary); StorePackageVersion=%(PackageReferenceForCrossGen.Version);"/> <!-- For future: Use ResolvePackageAssets instead of ResolveCopyLocalAssets, delete ResolveCopyLocalAssets task --> <ResolveCopyLocalAssets Condition="'$(_TargetFrameworkVersionWithoutV)' < '3.0'" AssetsFilePath="$(_CrossProjAssetsFile)" TargetFramework="$(_TFM)" RuntimeIdentifier="$(RuntimeIdentifier)" PlatformLibraryName="$(MicrosoftNETPlatformLibrary)" RuntimeFrameworks="@(RuntimeFramework)" ExcludedPackageReferences="@(_ExcludeFromPublishPackageReference)" IsSelfContained="$(SelfContained)" PreserveStoreLayout="false"> <Output TaskParameter="ResolvedAssets" ItemName="CrossgenResolvedAssembliesToPublish" /> </ResolveCopyLocalAssets> <GetPackageDirectory Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" Items="@(RuntimePack)" AssetsFileWithAdditionalPackageFolders="$(_CrossProjAssetsFile)"> <Output TaskParameter="Output" ItemName="_CrossgenRuntimePack" /> </GetPackageDirectory> <ResolveRuntimePackAssets Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" FrameworkReferences="@(FrameworkReference)" ResolvedRuntimePacks="@(_CrossgenRuntimePack)" DisableTransitiveFrameworkReferenceDownloads="$(DisableTransitiveFrameworkReferenceDownloads)"> <Output TaskParameter="RuntimePackAssets" ItemName="CrossgenResolvedAssembliesToPublish" /> </ResolveRuntimePackAssets> <!-- Copy managed files to a flat temp directory for passing it as ref for crossgen --> <Copy SourceFiles = "@(CrossgenResolvedAssembliesToPublish)" DestinationFolder="$(_NetCoreRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <!-- ============================================================ CreateReadyToRunImages Create ReadyToRun images for managed assemblies in _ResolvedFileToPublishAlways and _ResolvedFileToPublishPreserveNewest. ============================================================ --> <Target Name="CreateReadyToRunImages" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0' And '$(PublishReadyToRun)' == 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'" DependsOnTargets="_PrepareForReadyToRunCompilation; _CreateR2RImages; _CreateR2RSymbols"> <ItemGroup> <R2RTelemetry Include="PublishReadyToRunUseCrossgen2" Value="$(PublishReadyToRunUseCrossgen2)" /> <R2RTelemetry Include="Crossgen2PackVersion" Value="%(ResolvedCrossgen2Pack.NuGetPackageVersion)" /> <R2RTelemetry Include="CompileListCount" Value="@(_ReadyToRunCompileList->Count())" /> <R2RTelemetry Include="FailedCount" Value="@(_ReadyToRunCompilationFailures->Count())" /> </ItemGroup> <AllowEmptyTelemetry EventName="ReadyToRun" EventData="@(R2RTelemetry)" /> <NETSdkError Condition="'@(_ReadyToRunCompilationFailures)' != ''" ResourceName="ReadyToRunCompilationFailed" /> <NETSdkInformation Condition="'$(_ReadyToRunCompilerHasWarnings)' != ''" ResourceName="ReadyToRunCompilationHasWarnings_Info" /> <ItemGroup> <!-- Note: we only remove the entries for the IL images and replace them with the entries for the R2R images. We do not do the same for PDBs, because the native PDBs created by the R2R compiler complement the IL PDBs and do not replace them. IL PDBs are still required for debugging. Native PDBs emitted by the R2R compiler are only used for profiling purposes. --> <ResolvedFileToPublish Remove="@(_ReadyToRunCompositeBuildInput)" /> <ResolvedFileToPublish Remove="@(_ReadyToRunCompileList)" /> <ResolvedFileToPublish Include="@(_ReadyToRunFilesToPublish)" /> </ItemGroup> </Target> <!-- ============================================================ _PrepareForReadyToRunCompilation Prepare build for ReadyToRun compilations. Builds list of assemblies to compile, and computes paths to ReadyToRun compiler bits ============================================================ --> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="PrepareForReadyToRunCompilation" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="_PrepareForReadyToRunCompilation" DependsOnTargets="ResolveReadyToRunCompilers;_ComputeManagedRuntimePackAssemblies;_ComputeAssembliesToPostprocessOnPublish"> <PropertyGroup> <_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R</_ReadyToRunOutputPath> </PropertyGroup> <MakeDir Directories="$(_ReadyToRunOutputPath)" /> <ItemGroup> <_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" /> </ItemGroup> <!-- Even if app is not self-contained, crossgen requires closure of implementation assemblies. Resolve conflicts of the runtime pack assets as though we were copying them locally, and add them to the R2R implementation assembly list. --> <ItemGroup Condition="'$(SelfContained)' != 'true'"> <_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" /> </ItemGroup> <ResolvePackageFileConflicts Condition="'$(SelfContained)' != 'true'" ReferenceCopyLocalPaths="@(_ReadyToRunImplementationAssemblies)"> <Output TaskParameter="ReferenceCopyLocalPathsWithoutConflicts" ItemName="_ReadyToRunImplementationAssembliesWithoutConflicts" /> </ResolvePackageFileConflicts> <ItemGroup Condition="'$(SelfContained)' != 'true'"> <_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" /> <_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" /> </ItemGroup> <ItemGroup> <_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" /> <_ReadyToRunPgoFiles Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" /> </ItemGroup> <PrepareForReadyToRunCompilation CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" OutputPath="$(_ReadyToRunOutputPath)" MainAssembly="@(IntermediateAssembly)" Assemblies="@(_ReadyToRunImplementationAssemblies)" ExcludeList="@(PublishReadyToRunExclude)" EmitSymbols="$(PublishReadyToRunEmitSymbols)" IncludeSymbolsInSingleFile="$(IncludeSymbolsInSingleFile)" ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2Composite="$(PublishReadyToRunComposite)" PublishReadyToRunCompositeExclusions="@(PublishReadyToRunCompositeExclusions)" PublishReadyToRunCompositeRoots="@(PublishReadyToRunCompositeRoots)"> <Output TaskParameter="ReadyToRunCompileList" ItemName="_ReadyToRunCompileList" /> <Output TaskParameter="ReadyToRunSymbolsCompileList" ItemName="_ReadyToRunSymbolsCompileList" /> <Output TaskParameter="ReadyToRunFilesToPublish" ItemName="_ReadyToRunFilesToPublish" /> <Output TaskParameter="ReadyToRunAssembliesToReference" ItemName="_ReadyToRunAssembliesToReference" /> <Output TaskParameter="ReadyToRunCompositeBuildReferences" ItemName="_ReadyToRunCompositeBuildReferences" /> <Output TaskParameter="ReadyToRunCompositeBuildInput" ItemName="_ReadyToRunCompositeBuildInput" /> <Output TaskParameter="ReadyToRunCompositeUnrootedBuildInput" ItemName="_ReadyToRunCompositeUnrootedBuildInput" /> </PrepareForReadyToRunCompilation> </Target> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="ResolveReadyToRunCompilers" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="ResolveReadyToRunCompilers"> <ResolveReadyToRunCompilers RuntimePacks="@(ResolvedRuntimePack)" Crossgen2Packs="@(ResolvedCrossgen2Pack)" TargetingPacks="@(ResolvedTargetingPack)" RuntimeGraphPath="$(RuntimeIdentifierGraphPath)" NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)" EmitSymbols="$(PublishReadyToRunEmitSymbols)" ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)" PerfmapFormatVersion="$(PublishReadyToRunPerfmapFormatVersion)"> <Output TaskParameter="CrossgenTool" ItemName="CrossgenTool" /> <Output TaskParameter="Crossgen2Tool" ItemName="Crossgen2Tool" /> </ResolveReadyToRunCompilers> </Target> <!-- ============================================================ _CreateR2RImages Compiles assemblies in the _ReadyToRunCompileList list into ReadyToRun images ============================================================ --> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="RunReadyToRunCompiler" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="_CreateR2RImages" Inputs="$(MSBuildAllProjects);@(_ReadyToRunCompileList);@(_ReadyToRunCompositeBuildInput);@(_ReadyToRunPgoFiles)" Outputs="%(_ReadyToRunCompileList.OutputR2RImage);%(_ReadyToRunCompileList.OutputPDBImage)"> <RunReadyToRunCompiler CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" UseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2PgoFiles="@(_ReadyToRunPgoFiles)" Crossgen2ExtraCommandLineArgs="$(PublishReadyToRunCrossgen2ExtraArgs)" ImplementationAssemblyReferences="@(_ReadyToRunAssembliesToReference)" ShowCompilerWarnings="$(PublishReadyToRunShowWarnings)" CompilationEntry="@(_ReadyToRunCompileList)" ContinueOnError="ErrorAndContinue" ReadyToRunCompositeBuildReferences="@(_ReadyToRunCompositeBuildReferences)" ReadyToRunCompositeBuildInput="@(_ReadyToRunCompositeBuildInput)" ReadyToRunCompositeUnrootedBuildInput="@(_ReadyToRunCompositeUnrootedBuildInput)"> <Output TaskParameter="ExitCode" PropertyName="_ReadyToRunCompilerExitCode" /> <Output TaskParameter="WarningsDetected" PropertyName="_ReadyToRunWarningsDetected" /> </RunReadyToRunCompiler> <PropertyGroup> <!-- Use distinct property here as any of the invocations can set it --> <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true</_ReadyToRunCompilerHasWarnings> </PropertyGroup> <ItemGroup> <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunCompileList)" /> </ItemGroup> </Target> <!-- ============================================================ _CreateR2RSymbols Emit native symbols for ReadyToRun images in the _ReadyToRunSymbolsCompileList list ============================================================ --> <Target Name="_CreateR2RSymbols" Inputs="$(MSBuildAllProjects);@(_ReadyToRunSymbolsCompileList)" Outputs="%(_ReadyToRunSymbolsCompileList.OutputPDBImage)" Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '@(Crossgen2Tool -> '%(IsVersion5)')' == 'true'"> <RunReadyToRunCompiler CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" UseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2ExtraCommandLineArgs="$(PublishReadyToRunCrossgen2ExtraArgs)" ImplementationAssemblyReferences="@(_ReadyToRunAssembliesToReference)" ShowCompilerWarnings="$(PublishReadyToRunShowWarnings)" CompilationEntry="@(_ReadyToRunSymbolsCompileList)" ContinueOnError="ErrorAndContinue"> <Output TaskParameter="ExitCode" PropertyName="_ReadyToRunCompilerExitCode" /> <Output TaskParameter="WarningsDetected" PropertyName="_ReadyToRunWarningsDetected" /> </RunReadyToRunCompiler> <PropertyGroup> <!-- Use distinct property here as any of the invocations can set it --> <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true</_ReadyToRunCompilerHasWarnings> </PropertyGroup> <ItemGroup> <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunSymbolsCompileList)" /> </ItemGroup> </Target> </Project>
更改後文本
開啟檔案
<!-- *********************************************************************************************** Microsoft.NET.CrossGen.targets WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- For ReadyToRun compilation, default to Crossgen for .NET Core 3.x and .NET 5. If PublishReadyToRunUseCrossgen2 is set to true in the project or on the command line, use Crossgen2 and default to composite mode. For .NET 6 and higher, always use Crossgen2 and default to non-composite mode. --> <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0'"> <PublishReadyToRunUseCrossgen2 Condition="'$(_TargetFrameworkVersionWithoutV)' >= '6.0'">true</PublishReadyToRunUseCrossgen2> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(PublishSingleFile)' == 'true' and '$(PublishReadyToRun)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '7.0'">true</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(_TargetFrameworkVersionWithoutV)' >= '6.0'">false</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == ''">true</PublishReadyToRunComposite> <PublishReadyToRunComposite Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '$(SelfContained)' != 'true'">false</PublishReadyToRunComposite> <PublishReadyToRunUseRuntimePackOptimizationData Condition="'$(PublishReadyToRunUseRuntimePackOptimizationData)' == ''">true</PublishReadyToRunUseRuntimePackOptimizationData> <PublishReadyToRunPerfmapFormatVersion Condition="'$(PublishReadyToRunPerfmapFormatVersion)' == ''">1</PublishReadyToRunPerfmapFormatVersion> </PropertyGroup> <!-- ============================================================ PrepOptimizer Sets up the common infrastructure for the optimization phase Outputs: JitPath Crossgen ============================================================ --> <Target Name="PrepOptimizer" DependsOnTargets="_RestoreCrossgen;" Condition="$(SkipOptimization) != 'true' "> <!-- Get the coreclr path --> <ItemGroup> <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" /> <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" /> <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" /> <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" /> </ItemGroup> <NETSdkError Condition="'@(_CoreclrResolvedPath->Count())' > 1" ResourceName="MultipleFilesResolved" FormatArguments="coreclr" /> <NETSdkError Condition="'@(_CoreclrResolvedPath)'== ''" ResourceName="UnableToFindResolvedPath" FormatArguments="coreclr" /> <NETSdkError Condition="'@(_JitResolvedPath->Count())' > 1" ResourceName="MultipleFilesResolved" FormatArguments="jit" /> <NETSdkError Condition="'@(_JitResolvedPath)'== ''" ResourceName="UnableToFindResolvedPath" FormatArguments="jit" /> <!-- Get the crossgen and jit path--> <PropertyGroup> <_CoreclrPath>@(_CoreclrResolvedPath)</_CoreclrPath> <JitPath>@(_JitResolvedPath)</JitPath> <_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath)))</_CoreclrDir> <_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\"))</_CoreclrPkgDir> <CrossgenDir>$([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools"))</CrossgenDir> <!-- TODO override with rid specific tools path for x-arch --> <Crossgen>$([System.IO.Path]::Combine($(CrossgenDir),"crossgen"))</Crossgen> <Crossgen Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe"))</Crossgen> </PropertyGroup> <NETSdkError Condition="!Exists($(Crossgen))" ResourceName="UnableToFindResolvedPath" FormatArguments="$(Crossgen)" /> <!-- Copy crossgen into the netcoreapp folder to ensure it can load Microsoft.DiaSymReader.Native when creating PDBs --> <Copy SourceFiles="$(Crossgen)" DestinationFolder="$(_NetCoreRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> <PropertyGroup> <Crossgen>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen)))))))</Crossgen> </PropertyGroup> </Target> <!-- ============================================================ _RunOptimizer Start the optimization phase ============================================================ --> <Target Name="_RunOptimizer" DependsOnTargets="_InitializeBasicProps; _ComputeResolvedFilesToStoreTypes; _SetupStageForCrossgen" Condition="$(SkipOptimization) != 'true' "> <ItemGroup> <AssembliestoCrossgen Include="$(MSBuildProjectFullPath)"> <Properties> CrossgenExe=$(Crossgen); CrossgenJit=$(JitPath); CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath); CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension); CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath); _RuntimeOptimizedDir=$(_RuntimeOptimizedDir); PublishDir=$(StoreStagingDir); CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir); CreateProfilingSymbols=$(CreateProfilingSymbols); StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); _RuntimeSymbolsDir=$(_RuntimeSymbolsDir) </Properties> </AssembliestoCrossgen> </ItemGroup> <!-- CrossGen the assemblies --> <MSBuild Projects="@(AssembliestoCrossgen)" Targets="RunCrossGen" BuildInParallel="$(BuildInParallel)" Condition="'@(_ManagedResolvedFilesToOptimize)' != ''"/> </Target> <!-- ============================================================ RunCrossGen Target Encapsulating the crossgen command ============================================================ --> <Target Name="RunCrossGen" DependsOnTargets="_InitializeBasicProps;"> <PropertyGroup> <CrossgenProfilingSymbolsOutputDirectory>$([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath)))</CrossgenProfilingSymbolsOutputDirectory> <CrossgenSymbolsStagingDirectory>$([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath)))</CrossgenSymbolsStagingDirectory> <CrossgenCommandline>$(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)"</CrossgenCommandline> <CreateProfilingSymbolsOptionName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">CreatePDB</CreateProfilingSymbolsOptionName> <CreateProfilingSymbolsOptionName Condition="'$(CreateProfilingSymbolsOptionName)' == ''">CreatePerfMap</CreateProfilingSymbolsOptionName> </PropertyGroup> <Message Text="CrossgenCommandline: $(CrossgenCommandline)"/> <!--Optimization skip if the assembly is already present in the final output directory--> <Exec Command="$(CrossgenCommandline)" Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))" IgnoreStandardErrorWarningFormat="true" /> <Copy SourceFiles = "$(CrossgenOutputAssembly)" DestinationFiles="$(PublishDir)\$(CrossgenSubOutputPath)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" Condition="!Exists($([System.IO.Path]::Combine($(PublishDir),$(CrossgenSubOutputPath))))"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> <!-- Create profiling symbols if requested --> <MakeDir Directories="$(CrossgenProfilingSymbolsOutputDirectory)" Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" /> <Exec Command="$(CrossgenExe) -nologo -readytorun -platform_assemblies_paths $(CrossgenPlatformAssembliesPath) -$(CreateProfilingSymbolsOptionName) $(CrossgenProfilingSymbolsOutputDirectory) $(CrossgenOutputAssembly)" Condition="'$(CreateProfilingSymbols)' == 'true' and Exists($(CrossgenOutputAssembly))" IgnoreStandardErrorWarningFormat="true" /> <ItemGroup> <_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*" Condition="'$(CreateProfilingSymbols)' == 'true'" /> </ItemGroup> <Copy SourceFiles="@(_ProfilingSymbols)" DestinationFolder="$(CrossgenSymbolsStagingDirectory)" Condition="'$(CreateProfilingSymbols)' == 'true'" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <Target Name="_InitializeBasicProps"> <PropertyGroup> <PathSeparator>$([System.IO.Path]::PathSeparator)</PathSeparator> <DirectorySeparatorChar>$([System.IO.Path]::DirectorySeparatorChar)</DirectorySeparatorChar> </PropertyGroup> </Target> <!-- ============================================================ _GetCrossgenProps Generates props used by Crossgen ============================================================ --> <Target Name="_GetCrossgenProps" Condition="$(SkipOptimization) != 'true' "> <PropertyGroup> <_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize"))</_CrossProjFileDir> <_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp"))</_NetCoreRefDir> <!-- flat netcore app assemblies--> </PropertyGroup> <MakeDir Directories="$(_CrossProjFileDir)"/> <PropertyGroup> <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json))</_CrossProjAssetsFile> </PropertyGroup> </Target> <!-- ============================================================ _SetupStageForCrossgen ============================================================ --> <Target Name="_SetupStageForCrossgen" DependsOnTargets="_GetCrossgenProps;"> <PropertyGroup> <_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref"))</_RuntimeRefDir> <!-- flat app managed assemblies --> <_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt"))</_RuntimeOptimizedDir> <!-- optimized app managed assemblies in nuget cache layout --> <_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols"))</_RuntimeSymbolsDir> </PropertyGroup> <ItemGroup> <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> </ItemGroup> <MakeDir Directories="$(_RuntimeOptimizedDir)"/> <MakeDir Directories="$(_RuntimeSymbolsDir)" Condition="'$(CreateProfilingSymbols)' == 'true'" /> <!-- Copy managed files to a flat temp directory for passing it as ref --> <Copy SourceFiles = "@(_ManagedResolvedFilesToOptimize)" DestinationFolder="$(_RuntimeRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <!-- ============================================================ _RestoreCrossgen Restores netcoreapp and publishes it to a temp directory ============================================================ --> <Target Name="_RestoreCrossgen" DependsOnTargets="PrepforRestoreForComposeStore; _SetupStageForCrossgen; ProcessFrameworkReferences; ApplyImplicitVersions; _ComputePackageReferencePublish" Condition="$(SkipOptimization) != 'true' "> <ItemGroup> <!-- Filter package references to the one for the platform library, in order to find the right version --> <PackageReferenceForCrossGen Include="@(PackageReference)" Condition="'%(Identity)' == '$(MicrosoftNETPlatformLibrary)'" /> </ItemGroup> <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="RuntimeIdentifiers=$(RuntimeIdentifier); RestoreGraphProjectInput=$(MSBuildProjectFullPath); RestoreOutputPath=$(_CrossProjFileDir); StorePackageName=$(MicrosoftNETPlatformLibrary); StorePackageVersion=%(PackageReferenceForCrossGen.Version);"/> <!-- For future: Use ResolvePackageAssets instead of ResolveCopyLocalAssets, delete ResolveCopyLocalAssets task --> <ResolveCopyLocalAssets Condition="'$(_TargetFrameworkVersionWithoutV)' < '3.0'" AssetsFilePath="$(_CrossProjAssetsFile)" TargetFramework="$(_TFM)" RuntimeIdentifier="$(RuntimeIdentifier)" PlatformLibraryName="$(MicrosoftNETPlatformLibrary)" RuntimeFrameworks="@(RuntimeFramework)" ExcludedPackageReferences="@(_ExcludeFromPublishPackageReference)" IsSelfContained="$(SelfContained)" PreserveStoreLayout="false"> <Output TaskParameter="ResolvedAssets" ItemName="CrossgenResolvedAssembliesToPublish" /> </ResolveCopyLocalAssets> <GetPackageDirectory Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" Items="@(RuntimePack)" AssetsFileWithAdditionalPackageFolders="$(_CrossProjAssetsFile)"> <Output TaskParameter="Output" ItemName="_CrossgenRuntimePack" /> </GetPackageDirectory> <ResolveRuntimePackAssets Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" FrameworkReferences="@(FrameworkReference)" ResolvedRuntimePacks="@(_CrossgenRuntimePack)" DisableTransitiveFrameworkReferenceDownloads="$(DisableTransitiveFrameworkReferenceDownloads)"> <Output TaskParameter="RuntimePackAssets" ItemName="CrossgenResolvedAssembliesToPublish" /> </ResolveRuntimePackAssets> <!-- Copy managed files to a flat temp directory for passing it as ref for crossgen --> <Copy SourceFiles = "@(CrossgenResolvedAssembliesToPublish)" DestinationFolder="$(_NetCoreRefDir)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"> <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> </Copy> </Target> <!-- ============================================================ CreateReadyToRunImages Create ReadyToRun images for managed assemblies in _ResolvedFileToPublishAlways and _ResolvedFileToPublishPreserveNewest. ============================================================ --> <Target Name="CreateReadyToRunImages" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0' And '$(PublishReadyToRun)' == 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'" DependsOnTargets="_PrepareForReadyToRunCompilation; _CreateR2RImages; _CreateR2RSymbols"> <ItemGroup> <R2RTelemetry Include="PublishReadyToRunUseCrossgen2" Value="$(PublishReadyToRunUseCrossgen2)" /> <R2RTelemetry Include="Crossgen2PackVersion" Value="%(ResolvedCrossgen2Pack.NuGetPackageVersion)" /> <R2RTelemetry Include="CompileListCount" Value="@(_ReadyToRunCompileList->Count())" /> <R2RTelemetry Include="FailedCount" Value="@(_ReadyToRunCompilationFailures->Count())" /> </ItemGroup> <AllowEmptyTelemetry EventName="ReadyToRun" EventData="@(R2RTelemetry)" /> <NETSdkError Condition="'@(_ReadyToRunCompilationFailures)' != ''" ResourceName="ReadyToRunCompilationFailed" /> <NETSdkInformation Condition="'$(_ReadyToRunCompilerHasWarnings)' != ''" ResourceName="ReadyToRunCompilationHasWarnings_Info" /> <ItemGroup> <!-- Note: we only remove the entries for the IL images and replace them with the entries for the R2R images. We do not do the same for PDBs, because the native PDBs created by the R2R compiler complement the IL PDBs and do not replace them. IL PDBs are still required for debugging. Native PDBs emitted by the R2R compiler are only used for profiling purposes. --> <ResolvedFileToPublish Remove="@(_ReadyToRunCompositeBuildInput)" /> <ResolvedFileToPublish Remove="@(_ReadyToRunCompileList)" /> <ResolvedFileToPublish Include="@(_ReadyToRunFilesToPublish)" /> </ItemGroup> </Target> <!-- ============================================================ _PrepareForReadyToRunCompilation Prepare build for ReadyToRun compilations. Builds list of assemblies to compile, and computes paths to ReadyToRun compiler bits ============================================================ --> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="PrepareForReadyToRunCompilation" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="_PrepareForReadyToRunCompilation" DependsOnTargets="ResolveReadyToRunCompilers;_ComputeManagedRuntimePackAssemblies;_ComputeAssembliesToPostprocessOnPublish"> <PropertyGroup> <_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R</_ReadyToRunOutputPath> </PropertyGroup> <MakeDir Directories="$(_ReadyToRunOutputPath)" /> <ItemGroup> <_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" /> </ItemGroup> <!-- Even if app is not self-contained, crossgen requires closure of implementation assemblies. Resolve conflicts of the runtime pack assets as though we were copying them locally, and add them to the R2R implementation assembly list. --> <ItemGroup Condition="'$(SelfContained)' != 'true'"> <_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" /> </ItemGroup> <ResolvePackageFileConflicts Condition="'$(SelfContained)' != 'true'" ReferenceCopyLocalPaths="@(_ReadyToRunImplementationAssemblies)"> <Output TaskParameter="ReferenceCopyLocalPathsWithoutConflicts" ItemName="_ReadyToRunImplementationAssembliesWithoutConflicts" /> </ResolvePackageFileConflicts> <ItemGroup Condition="'$(SelfContained)' != 'true'"> <_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" /> <_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" /> </ItemGroup> <ItemGroup> <_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" /> <_ReadyToRunPgoFiles Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" /> </ItemGroup> <PrepareForReadyToRunCompilation CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" OutputPath="$(_ReadyToRunOutputPath)" MainAssembly="@(IntermediateAssembly)" Assemblies="@(_ReadyToRunImplementationAssemblies)" ExcludeList="@(PublishReadyToRunExclude)" EmitSymbols="$(PublishReadyToRunEmitSymbols)" IncludeSymbolsInSingleFile="$(IncludeSymbolsInSingleFile)" ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2Composite="$(PublishReadyToRunComposite)" PublishReadyToRunCompositeExclusions="@(PublishReadyToRunCompositeExclusions)" PublishReadyToRunCompositeRoots="@(PublishReadyToRunCompositeRoots)"> <Output TaskParameter="ReadyToRunCompileList" ItemName="_ReadyToRunCompileList" /> <Output TaskParameter="ReadyToRunSymbolsCompileList" ItemName="_ReadyToRunSymbolsCompileList" /> <Output TaskParameter="ReadyToRunFilesToPublish" ItemName="_ReadyToRunFilesToPublish" /> <Output TaskParameter="ReadyToRunAssembliesToReference" ItemName="_ReadyToRunAssembliesToReference" /> <Output TaskParameter="ReadyToRunCompositeBuildReferences" ItemName="_ReadyToRunCompositeBuildReferences" /> <Output TaskParameter="ReadyToRunCompositeBuildInput" ItemName="_ReadyToRunCompositeBuildInput" /> <Output TaskParameter="ReadyToRunCompositeUnrootedBuildInput" ItemName="_ReadyToRunCompositeUnrootedBuildInput" /> </PrepareForReadyToRunCompilation> </Target> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="ResolveReadyToRunCompilers" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="ResolveReadyToRunCompilers"> <ResolveReadyToRunCompilers RuntimePacks="@(ResolvedRuntimePack)" Crossgen2Packs="@(ResolvedCrossgen2Pack)" TargetingPacks="@(ResolvedTargetingPack)" RuntimeGraphPath="$(RuntimeIdentifierGraphPath)" NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)" EmitSymbols="$(PublishReadyToRunEmitSymbols)" ReadyToRunUseCrossgen2="$(PublishReadyToRunUseCrossgen2)" PerfmapFormatVersion="$(PublishReadyToRunPerfmapFormatVersion)"> <Output TaskParameter="CrossgenTool" ItemName="CrossgenTool" /> <Output TaskParameter="Crossgen2Tool" ItemName="Crossgen2Tool" /> </ResolveReadyToRunCompilers> </Target> <!-- ============================================================ _CreateR2RImages Compiles assemblies in the _ReadyToRunCompileList list into ReadyToRun images ============================================================ --> <UsingTask Condition="'$(Crossgen2TasksOverriden)' != 'true'" TaskName="RunReadyToRunCompiler" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <Target Name="_CreateR2RImages" Inputs="$(MSBuildAllProjects);@(_ReadyToRunCompileList);@(_ReadyToRunCompositeBuildInput);@(_ReadyToRunPgoFiles)" Outputs="%(_ReadyToRunCompileList.OutputR2RImage);%(_ReadyToRunCompileList.OutputPDBImage)"> <RunReadyToRunCompiler CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" UseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2PgoFiles="@(_ReadyToRunPgoFiles)" Crossgen2ExtraCommandLineArgs="$(PublishReadyToRunCrossgen2ExtraArgs)" ImplementationAssemblyReferences="@(_ReadyToRunAssembliesToReference)" ShowCompilerWarnings="$(PublishReadyToRunShowWarnings)" CompilationEntry="@(_ReadyToRunCompileList)" ContinueOnError="ErrorAndContinue" ReadyToRunCompositeBuildReferences="@(_ReadyToRunCompositeBuildReferences)" ReadyToRunCompositeBuildInput="@(_ReadyToRunCompositeBuildInput)" ReadyToRunCompositeUnrootedBuildInput="@(_ReadyToRunCompositeUnrootedBuildInput)"> <Output TaskParameter="ExitCode" PropertyName="_ReadyToRunCompilerExitCode" /> <Output TaskParameter="WarningsDetected" PropertyName="_ReadyToRunWarningsDetected" /> </RunReadyToRunCompiler> <PropertyGroup> <!-- Use distinct property here as any of the invocations can set it --> <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true</_ReadyToRunCompilerHasWarnings> </PropertyGroup> <ItemGroup> <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunCompileList)" /> </ItemGroup> </Target> <!-- ============================================================ _CreateR2RSymbols Emit native symbols for ReadyToRun images in the _ReadyToRunSymbolsCompileList list ============================================================ --> <Target Name="_CreateR2RSymbols" Inputs="$(MSBuildAllProjects);@(_ReadyToRunSymbolsCompileList)" Outputs="%(_ReadyToRunSymbolsCompileList.OutputPDBImage)" Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '@(Crossgen2Tool -> '%(IsVersion5)')' == 'true'"> <RunReadyToRunCompiler CrossgenTool="@(CrossgenTool)" Crossgen2Tool="@(Crossgen2Tool)" UseCrossgen2="$(PublishReadyToRunUseCrossgen2)" Crossgen2ExtraCommandLineArgs="$(PublishReadyToRunCrossgen2ExtraArgs)" ImplementationAssemblyReferences="@(_ReadyToRunAssembliesToReference)" ShowCompilerWarnings="$(PublishReadyToRunShowWarnings)" CompilationEntry="@(_ReadyToRunSymbolsCompileList)" ContinueOnError="ErrorAndContinue"> <Output TaskParameter="ExitCode" PropertyName="_ReadyToRunCompilerExitCode" /> <Output TaskParameter="WarningsDetected" PropertyName="_ReadyToRunWarningsDetected" /> </RunReadyToRunCompiler> <PropertyGroup> <!-- Use distinct property here as any of the invocations can set it --> <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true</_ReadyToRunCompilerHasWarnings> </PropertyGroup> <ItemGroup> <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunSymbolsCompileList)" /> </ItemGroup> </Target> </Project>
尋找差異