/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/Core/MSBuildTaskTests/Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj
114 строк
6 KB
Jason Malinowski
Fix incremental build in Microsoft.Build.Tasks.CodeAnalysis.UnitTests
05 июн 2026, 00:48
05 июн 2026, 00:48
6b4098d
Код
Авторство
О чём код?
<?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"> <PropertyGroup> <OutputType>Library</OutputType> <RootNamespace>Microsoft.CodeAnalysis.BuildTasks.UnitTests</RootNamespace> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <TargetFrameworks>$(NetRoslyn);net472</TargetFrameworks> <!-- Multiple test failures --> <SkipTests Condition="'$(TestRuntime)' == 'Mono'">true</SkipTests> </PropertyGroup> <ItemGroup Label="Project References"> <ProjectReference Include="..\..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" /> <ProjectReference Include="..\..\Test\Core\Microsoft.CodeAnalysis.Test.Utilities.csproj" /> <ProjectReference Include="..\..\CSharp\csc\AnyCpu\csc.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" OutputItemType="CommandLineCompilerReference" /> <ProjectReference Include="..\..\VisualBasic\vbc\AnyCpu\vbc.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" OutputItemType="CommandLineCompilerReference" /> <ProjectReference Include="..\..\Server\VBCSCompiler\AnyCpu\VBCSCompiler.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" OutputItemType="CommandLineCompilerReference" /> <ProjectReference Include="..\..\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj" /> <ProjectReference Include="..\..\Test\Resources\Core\Microsoft.CodeAnalysis.Compiler.Test.Resources.csproj" /> <ProjectReference Include="..\MSBuildTask\MSBuild\Microsoft.Build.Tasks.CodeAnalysis.csproj" /> <ProjectReference Include="..\Portable\Microsoft.CodeAnalysis.csproj" /> <ProjectReference Include="..\..\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.vbproj" /> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'net472'"> <Reference Include="Microsoft.Build.Engine" /> <Reference Include="System" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <PackageReference Include="Moq" /> <PackageReference Include="Microsoft.Build" /> <PackageReference Include="Microsoft.Build.Tasks.Core" /> <PackageReference Include="Basic.CompilerLog.Util" /> <PackageReference Include="MessagePack" VersionOverride="3.1.4" /> </ItemGroup> <ItemGroup> <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> </ItemGroup> <ItemGroup> <Content Include="TestResources\**\*.*" /> <EmbeddedResource Include="TestResources\**\*.*" /> </ItemGroup> <ItemGroup> <None Include="app.config" /> </ItemGroup> <PropertyGroup> <_DotNetSdkVersionFile>$(IntermediateOutputPath)\DotNetVersions.g.cs</_DotNetSdkVersionFile> <_DotNetSdkVersionInputCacheFile>$(IntermediateOutputPath)\DotNetVersions.input.cache</_DotNetSdkVersionInputCacheFile> <_CurrentCompilerApiVersion>$([System.Version]::Parse($(VersionPrefix)).Major).$([System.Version]::Parse($(VersionPrefix)).Minor)</_CurrentCompilerApiVersion> </PropertyGroup> <!-- Captures the values embedded into DotNetVersions.g.cs in a cache file. WriteOnlyWhenDifferent ensures the cache file's timestamp only changes when those values actually change, which is what allows _GenerateSdkVersionAttribute below to be skipped (and avoid recompiling this assembly) on incremental builds. --> <PropertyGroup> <CoreCompileDependsOn>$(CoreCompileDependsOn);_GenerateSdkVersionAttribute</CoreCompileDependsOn> </PropertyGroup> <ItemGroup> <Compile Include="$(_DotNetSdkVersionFile)" /> </ItemGroup> <Target Name="_CreateSdkVersionInputCache"> <WriteLinesToFile File="$(_DotNetSdkVersionInputCacheFile)" Lines="$(NETCoreSdkVersion);$(_CurrentCompilerApiVersion)" Overwrite="true" WriteOnlyWhenDifferent="true" /> <ItemGroup> <FileWrites Include="$(_DotNetSdkVersionInputCacheFile)" /> </ItemGroup> </Target> <Target Name="_GenerateSdkVersionAttribute" DependsOnTargets="_CreateSdkVersionInputCache" Inputs="$(_DotNetSdkVersionInputCacheFile)" Outputs="$(_DotNetSdkVersionFile)"> <ItemGroup> <_Attribute Include="Microsoft.CodeAnalysis.BuildTasks.UnitTests.DotNetSdkVersionAttribute"> <_Parameter1>$(NETCoreSdkVersion)</_Parameter1> </_Attribute> <_Attribute Include="System.Reflection.AssemblyMetadataAttribute"> <_Parameter1>CurrentCompilerApiVersion</_Parameter1> <_Parameter2>$(_CurrentCompilerApiVersion)</_Parameter2> </_Attribute> </ItemGroup> <WriteCodeFragment AssemblyAttributes="@(_Attribute)" Language="$(Language)" OutputFile="$(_DotNetSdkVersionFile)"> <Output TaskParameter="OutputFile" ItemName="FileWrites" /> </WriteCodeFragment> </Target> <Target Name="CopyAssetsForIntegrationTests" Condition="'@(CommandLineCompilerReference)' != ''" AfterTargets="ResolveProjectReferences" BeforeTargets="AssignTargetPaths"> <PropertyGroup> <_CommandLineCompilerReferenceOutputPath>@(CommandLineCompilerReference->'%(RootDir)%(Directory)*.*')</_CommandLineCompilerReferenceOutputPath> <_LinkPrefix Condition="'$(TargetFramework)' != 'net472'">bincore\</_LinkPrefix> </PropertyGroup> <ItemGroup> <_CommandLineCompilerReferenceContent Include="$(_CommandLineCompilerReferenceOutputPath)" /> <_CommandLineCompilerReferenceKey Include="@(_CommandLineCompilerReferenceContent->'%(Filename)%(Extension)')" Original="%(Identity)" KeepDuplicates="false" /> </ItemGroup> <RemoveDuplicates Inputs="@(_CommandLineCompilerReferenceKey)"> <Output TaskParameter="Filtered" ItemName="_CommandLineCompilerReferenceDeduplicated" /> </RemoveDuplicates> <ItemGroup> <Content Include="%(_CommandLineCompilerReferenceDeduplicated.Original)" Link="$(_LinkPrefix)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" /> </ItemGroup> </Target> </Project>