/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Setup/DevDivInsertionFiles/DevDivInsertionFiles.csproj
299 строк
17 KB
dotnet-maestro[bot]
[main] Update dependencies from dotnet/arcade (#84819)
10 авг 2026, 23:50
Не верифицирован
10 авг 2026, 23:50
3d24b6a
Код
Авторство
О чём код?
<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> <Project Sdk="Microsoft.NET.Sdk"> <UsingTask TaskName="Microsoft.NET.Build.Tasks.JoinItems" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> <PropertyGroup> <TargetFramework>net472</TargetFramework> <OutputType>Library</OutputType> <ApplyNgenOptimization>full</ApplyNgenOptimization> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\..\VisualStudio\CSharp\Impl\Microsoft.VisualStudio.LanguageServices.CSharp.csproj"/> <ProjectReference Include="..\..\VisualStudio\VisualBasic\Impl\Microsoft.VisualStudio.LanguageServices.VisualBasic.vbproj"/> <ProjectReference Include="..\..\ExpressionEvaluator\CSharp\Source\ExpressionCompiler\Microsoft.CodeAnalysis.CSharp.ExpressionCompiler.csproj"/> <ProjectReference Include="..\..\ExpressionEvaluator\VisualBasic\Source\ExpressionCompiler\Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler.vbproj"/> </ItemGroup> <PropertyGroup> <_DependentAssemblyVersionsFile>$(VisualStudioBuildPackagesDir)DependentAssemblyVersions.csv</_DependentAssemblyVersionsFile> <_OptimizedDependenciesDir>$(ArtifactsTmpDir)OptimizedDependencies\</_OptimizedDependenciesDir> </PropertyGroup> <!-- List of dependencies that are expected to be inserted into VS by Roslyn Insertion Tool. Metadata: - OptimizeAssemblies List of relative paths within the package of the implementation assemblies that should get IBC data embedded. Each of these assemblies is expected to be trained and have IBC data available. Note - optimizing Authenticode-signed 3rd party libraries invalidates their signature. - UnsignAssemblies List of relative paths within the package of the implementation assemblies that need to be re-signed This target only unsigns them, SignTool signs them as with other unsigned files. --> <ItemGroup> <ExpectedDependency Include="Humanizer.Core"/> <ExpectedDependency Include="ICSharpCode.Decompiler"/> <ExpectedDependency Include="Microsoft.DiaSymReader"/> <ExpectedDependency Include="Microsoft.CodeAnalysis.Elfie"/> </ItemGroup> <Target Name="_CalculateDependenciesToInsert" DependsOnTargets="ResolveAssemblyReferences;GetAssemblyVersion"> <ItemGroup> <!-- Take all resolved non-framework dependencies of this project that originate from a NuGet package --> <_Dependency Include="@(ReferencePath->'%(NuGetPackageId)')" Condition="'%(ReferencePath.FrameworkFile)' != 'true' and '%(ReferencePath.NuGetPackageId)' != '' and '%(ReferencePath.ReferenceSourceTarget)' != 'ProjectReference'" /> <!-- Take all additional files that get copied to the output directory and are not satellite assemblies --> <_CopyLocalDependency Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')" Exclude="@(_Dependency)" Condition="'%(ReferenceCopyLocalPaths.Culture)' == ''"> <_AssemblyPath>%(ReferenceCopyLocalPaths.Identity)</_AssemblyPath> </_CopyLocalDependency> </ItemGroup> <Microsoft.DotNet.Arcade.Sdk.GetAssemblyFullName Items="@(_CopyLocalDependency)" PathMetadata="_AssemblyPath" FullNameMetadata="FusionName"> <Output TaskParameter="ItemsWithFullName" ItemName="_Dependency"/> </Microsoft.DotNet.Arcade.Sdk.GetAssemblyFullName> <!-- Calculate metadata we need --> <ItemGroup> <_Dependency> <_AssemblyName>$([MSBuild]::ValueOrDefault('%(_Dependency.FusionName)', '').Split(',')[0])</_AssemblyName> <_AssemblyVersion>$([MSBuild]::ValueOrDefault('%(_Dependency.FusionName)', '').Split(',')[1].Split('=')[1])</_AssemblyVersion> <_NuGetPackageFileName>%(_Dependency.NuGetPackageId).%(_Dependency.NuGetPackageVersion).nupkg</_NuGetPackageFileName> <_NuGetPackageDir>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(_Dependency.NuGetPackageId)', '').ToLower())\%(_Dependency.NuGetPackageVersion)\</_NuGetPackageDir> </_Dependency> </ItemGroup> <!-- AssemblyVersionVariables include the dependency name and version that needs to be updated in the VS repo's AssemblyVersions.tt file. The roslyn insertion tool will read the output of this and update the file during the insertion. These are separate from the _Dependency list as we do not need to always add the package dependency (e.g. private dependencies) --> <ItemGroup> <_AssemblyVersionVariable Include="Roslyn" Version="$(AssemblyVersion)"/> <_AssemblyVersionVariable Include="RazorRuntimeAssembly" Version="$(RazorAssemblyVersion)"/> <_AssemblyVersionVariable Include="RazorToolingAssembly" Version="$(RazorAssemblyVersion)"/> </ItemGroup> <!-- Exclude dependencies that are not inserted from Roslyn repo and are installed by other VS components. Note: can't use globs due to https://github.com/Microsoft/msbuild/issues/3791. --> <ItemGroup> <_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('Microsoft.VisualStudio.'))"/> <_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('Microsoft.ServiceHub.'))"/> <_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('System.Composition.'))"/> <_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('Microsoft.Internal.VisualStudio.'))"/> <_Dependency Remove="Azure.Core"/> <_Dependency Remove="EnvDTE"/> <_Dependency Remove="EnvDTE80"/> <_Dependency Remove="EnvDTE90"/> <_Dependency Remove="EnvDTE90A"/> <_Dependency Remove="EnvDTE100"/> <_Dependency Remove="Google.Protobuf"/> <_Dependency Remove="MessagePack"/> <_Dependency Remove="MessagePack.Annotations"/> <_Dependency Remove="Microsoft.Bcl.AsyncInterfaces"/> <_Dependency Remove="Microsoft.Bcl.HashCode" /> <_Dependency Remove="Microsoft.Build"/> <_Dependency Remove="Microsoft.Build.Framework"/> <_Dependency Remove="Microsoft.Build.Tasks.Core"/> <_Dependency Remove="Microsoft.Build.Utilities.Core"/> <_Dependency Remove="Microsoft.Diagnostics.Tracing.EventSource.Redist"/> <_Dependency Remove="Microsoft.Extensions.DependencyInjection"/> <_Dependency Remove="Microsoft.Extensions.DependencyInjection.Abstractions"/> <_Dependency Remove="Microsoft.Internal.Performance.CodeMarkers.DesignTime"/> <_Dependency Remove="Microsoft.ML.Tokenizers"/> <_Dependency Remove="Microsoft.MSXML"/> <_Dependency Remove="Microsoft.NET.StringTools"/> <_Dependency Remove="Microsoft.Win32.Registry"/> <_Dependency Remove="Nerdbank.MessagePack"/> <_Dependency Remove="Nerdbank.NetStandardBridge" /> <_Dependency Remove="Nerdbank.Streams"/> <_Dependency Remove="Newtonsoft.Json"/> <_Dependency Remove="NuGet.VisualStudio"/> <_Dependency Remove="NuGet.VisualStudio.Contracts"/> <_Dependency Remove="PolyType"/> <_Dependency Remove="stdole"/> <_Dependency Remove="StreamJsonRpc"/> <_Dependency Remove="System.Buffers" /> <_Dependency Remove="System.ClientModel"/> <_Dependency Remove="System.Collections.Immutable"/> <_Dependency Remove="System.Configuration.ConfigurationManager"/> <_Dependency Remove="System.Diagnostics.DiagnosticSource"/> <_Dependency Remove="System.Drawing.Common"/> <_Dependency Remove="System.Formats.Nrbf" /> <_Dependency Remove="System.IO.Packaging"/> <_Dependency Remove="System.IO.Pipelines"/> <_Dependency Remove="System.Memory"/> <_Dependency Remove="System.Memory.Data"/> <_Dependency Remove="System.Numerics.Vectors"/> <_Dependency Remove="System.Reflection.Metadata"/> <_Dependency Remove="System.Reflection.MetadataLoadContext"/> <_Dependency Remove="System.Reflection.TypeExtensions"/> <_Dependency Remove="System.Resources.Extensions"/> <_Dependency Remove="System.Runtime.CompilerServices.Unsafe"/> <_Dependency Remove="System.ValueTuple"/> <_Dependency Remove="System.Security.AccessControl"/> <_Dependency Remove="System.Security.Permissions"/> <_Dependency Remove="System.Security.Principal.Windows"/> <_Dependency Remove="System.Text.Encoding.CodePages" /> <_Dependency Remove="System.Text.Encodings.Web" /> <_Dependency Remove="System.Text.Json" /> <_Dependency Remove="System.Threading.AccessControl"/> <_Dependency Remove="System.Threading.Channels" /> <_Dependency Remove="System.Threading.Tasks.Dataflow"/> <_Dependency Remove="System.Threading.Tasks.Extensions" /> <_Dependency Remove="VSLangProj"/> <_Dependency Remove="VSLangProj2"/> <_Dependency Remove="VSLangProj80"/> <_Dependency Remove="VSLangProj90"/> <_Dependency Remove="VSLangProj100"/> <_Dependency Remove="VSLangProj110"/> <_Dependency Remove="VSLangProj140"/> <_Dependency Remove="VSLangProj150"/> <_Dependency Remove="VSLangProj157"/> <_Dependency Remove="VSLangProj158"/> <_Dependency Remove="VSLangProj165"/> <_Dependency Remove="VsWebSite.Interop"/> <_Dependency Remove="Microsoft.NET.StringTools" /> <_Dependency Remove="Microsoft.IO.Redist" /> </ItemGroup> <!-- Write out the filtered dependency versions we need to also update in VS. --> <ItemGroup> <_AssemblyVersionVariable Include="@(_Dependency->'%(_AssemblyName)')" Version="%(_Dependency._AssemblyVersion)" /> </ItemGroup> <!-- Sanity check that prevents us from accidentally inserting a new dependency without knowing. --> <ItemGroup> <_RemainingDependency Include="@(_Dependency)" Exclude="@(ExpectedDependency)"/> <_UninsertedExpectedDependency Include="@(ExpectedDependency)" Exclude="@(_Dependency)"/> </ItemGroup> <Error Text="Unexpected dependencies found -- update ExpectedDependency list: @(_RemainingDependency)" Condition="'@(_RemainingDependency)' != ''"/> <Error Text="Missing dependencies expected to be inserted -- update ExpectedDependency list: @(_UninsertedExpectedDependency)" Condition="'@(_UninsertedExpectedDependency)' != ''"/> <!-- For each relative path listed in OptimizeAssemblies and UnsignAssemblies metadata we need to calculate a full path of the corresponding optimized/unsigned assembly. First we split the list in OptimizeAssemblies/UnsignedAssemblies, prepend the directory path to each relative path, group the full paths and finally inner-join the items back to ExpectedDependency item group. --> <ItemGroup> <ExpectedDependency> <_EffectiveOptimizeAssemblies Condition="'$(EnableNgenOptimization)' == 'true' and '$(ApplyNgenOptimization)' != ''">%(ExpectedDependency.OptimizeAssemblies)</_EffectiveOptimizeAssemblies> </ExpectedDependency> <_OptimizeAssembliesSplit Include="%(ExpectedDependency._EffectiveOptimizeAssemblies)" DependencyName="%(ExpectedDependency.Identity)" /> <_UnsignAssembliesSplit Include="%(ExpectedDependency.UnsignAssemblies)" DependencyName="%(ExpectedDependency.Identity)"/> <_DependenciesWithFullPaths Include="@(_Dependency->'%(Identity)')" Exclude="@(_OptimizeAssembliesSplit->'%(DependencyName)');@(_UnsignAssembliesSplit->'%(DependencyName)')"/> <_DependenciesWithFullPaths Include="%(_OptimizeAssembliesSplit.DependencyName)" OptimizeAssembliesFullPaths="$(_OptimizedDependenciesDir)%(_OptimizeAssembliesSplit.DependencyName)\%(_OptimizeAssembliesSplit.Identity)" /> <_DependenciesWithFullPaths Include="%(_UnsignAssembliesSplit.DependencyName)" UnsignAssembliesFullPaths="$(_OptimizedDependenciesDir)%(_UnsignAssembliesSplit.DependencyName)\%(_UnsignAssembliesSplit.Identity)" /> </ItemGroup> <Microsoft.DotNet.Arcade.Sdk.GroupItemsBy Items="@(_DependenciesWithFullPaths)" GroupMetadata="OptimizeAssembliesFullPaths;UnsignAssembliesFullPaths"> <Output TaskParameter="GroupedItems" ItemName="_DependenciesWithFullPathsGrouped" /> </Microsoft.DotNet.Arcade.Sdk.GroupItemsBy> <JoinItems Left="@(ExpectedDependency)" LeftMetadata="*" Right="@(_DependenciesWithFullPathsGrouped)" RightMetadata="OptimizeAssembliesFullPaths;UnsignAssembliesFullPaths"> <Output TaskParameter="JoinResult" ItemName="_ExpectedDependencyWithFullPaths" /> </JoinItems> <!-- Join metadata specified in _Dependency and ExpectedMetadata groups. --> <JoinItems Left="@(_Dependency)" LeftMetadata="*" Right="@(_ExpectedDependencyWithFullPaths)" RightMetadata="*"> <Output TaskParameter="JoinResult" ItemName="_DependencyWithExpectedMetadata" /> </JoinItems> <ItemGroup> <!-- Input to ApplyOptimizations target: assembly paths to apply optimization data to. --> <OptimizeAssembly Include="%(_DependencyWithExpectedMetadata.OptimizeAssembliesFullPaths)" /> <!-- Assemblies in the unpacked packages that we want to unsign, but are not geting optimization data --> <_UnsignAssembly Include="%(_DependencyWithExpectedMetadata.UnsignAssembliesFullPaths)" /> <!-- Packages that contain optimized assembly or assembly we want to re-sign. --> <_PackageToRepack Include="%(_DependencyWithExpectedMetadata._NuGetPackageDir)%(_DependencyWithExpectedMetadata._NuGetPackageFileName)" UnpackDir="$(_OptimizedDependenciesDir)%(_DependencyWithExpectedMetadata.Identity)\" Parts="%(_DependencyWithExpectedMetadata._EffectiveOptimizeAssemblies);%(_DependencyWithExpectedMetadata.UnsignAssemblies)" ReplacementFiles="%(_DependencyWithExpectedMetadata.OptimizeAssembliesFullPaths);%(_DependencyWithExpectedMetadata.UnsignAssembliesFullPaths)" Condition="'%(_DependencyWithExpectedMetadata.OptimizeAssembliesFullPaths)' != '' or '%(_DependencyWithExpectedMetadata.UnsignAssembliesFullPaths)' != ''"/> <!-- Packages that we insert without modifications --> <_PackageToCopy Include="%(_DependencyWithExpectedMetadata._NuGetPackageDir)%(_DependencyWithExpectedMetadata._NuGetPackageFileName)" Exclude="@(_PackageToRepack)"/> </ItemGroup> </Target> <!-- Write a list of assembly names and versions that the insertion tool uses to update assembly versions in DevDiv. --> <Target Name="_GenerateDependentAssemblyVersions" BeforeTargets="AfterBuild" DependsOnTargets="_CalculateDependenciesToInsert" Inputs="$(MSBuildAllProjects)" Outputs="$(_DependentAssemblyVersionsFile)"> <MakeDir Directories="$(VisualStudioBuildPackagesDir)"/> <WriteLinesToFile Lines="@(_AssemblyVersionVariable->'%(Identity),%(Version)')" File="$(_DependentAssemblyVersionsFile)" Overwrite="true"/> <ItemGroup> <FileWrites Include="$(_DependentAssemblyVersionsFile)"/> </ItemGroup> </Target> <!-- Unpack dependent packages to a temp folder. --> <Target Name="_UnpackDependencies" Condition="'@(_PackageToRepack)' != ''"> <Unzip SourceFiles="%(_PackageToRepack.Identity)" DestinationFolder="%(_PackageToRepack.UnpackDir)" /> </Target> <!-- Copy NuGet packages to be inserted into VS by the insertion tool. --> <Target Name="_CopyPackagesToInsert" BeforeTargets="AfterBuild" Condition="'$(Configuration)' == 'Release' and '$(ContinuousIntegrationBuild)' == 'true'" DependsOnTargets="_CalculateDependenciesToInsert;_UnpackDependencies;ApplyOptimizations"> <PropertyGroup> <_OptimizedNuGetPackageVersionSuffix Condition="'$(OfficialBuild)' != 'true'">vs-ci</_OptimizedNuGetPackageVersionSuffix> <_OptimizedNuGetPackageVersionSuffix Condition="'$(OfficialBuild)' == 'true'">vs-$(VersionSuffixDateStamp)-$(VersionSuffixBuildOfTheDayPadded)</_OptimizedNuGetPackageVersionSuffix> <_OptimizedNuGetPackageVersionSuffix Condition="'$(PreReleaseVersionLabel)' == 'pr-validation'">pr-validation-$(VersionSuffixDateStamp)-$(VersionSuffixBuildOfTheDayPadded)</_OptimizedNuGetPackageVersionSuffix> </PropertyGroup> <MakeDir Directories="$(VisualStudioBuildPackagesDir)"/> <!-- Unsign assemblies that need to be unsigned but not optimized. --> <Microsoft.DotNet.Arcade.Sdk.Unsign FilePath="%(_UnsignAssembly.Identity)" Condition="'@(_UnsignAssembly)' != ''"/> <!-- Repack optimized dependencies --> <Microsoft.DotNet.Tools.ReplacePackageParts SourcePackage="%(_PackageToRepack.Identity)" DestinationFolder="$(VisualStudioBuildPackagesDir)" NewVersionSuffix="$(_OptimizedNuGetPackageVersionSuffix)" Parts="%(_PackageToRepack.Parts)" ReplacementFiles="%(_PackageToRepack.ReplacementFiles)" Condition="'@(_PackageToRepack)' != ''"> <Output TaskParameter="NewPackage" ItemName="FileWrites" /> </Microsoft.DotNet.Tools.ReplacePackageParts> <!-- Copy unoptimized dependencies --> <Copy SourceFiles="@(_PackageToCopy)" DestinationFolder="$(VisualStudioBuildPackagesDir)"> <Output TaskParameter="CopiedFiles" ItemName="FileWrites"/> </Copy> </Target> </Project>