Skip to content

Commit 4271041

Browse files
committed
Simplify MSBuild logic in project files
- Add necessary guard to check for pack. - Remove redundant properties and values. - Remove and adjust quotes in property functions. - Use wildcards to generalize and reduce items declared.
1 parent aef6f77 commit 4271041

12 files changed

+71
-115
lines changed

CommunityToolkit.sln

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{CFA75BE0-5
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CD16E790-7B7B-411E-9CE7-768E759CC22D}"
1919
ProjectSection(SolutionItems) = preProject
20+
eng\AssemblyInfo.Shared.cs = eng\AssemblyInfo.Shared.cs
2021
eng\Sign-Package.ps1 = eng\Sign-Package.ps1
2122
eng\SignClientSettings.json = eng\SignClientSettings.json
2223
eng\Toolkit.Common.props = eng\Toolkit.Common.props

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<!-- Embed source files that are not tracked by the source control manager to the PDB -->
2020
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2121
<!-- Include PDB in the built .nupkg -->
22-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
22+
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2323
</PropertyGroup>
2424
<ItemGroup>
2525
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

eng/AssemblyInfo.Shared.cs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
// This file contains assembly and module attributes that is shared across projects.
6+
// Include it in `Directory.Build.targets` near to all projects that need this file.
7+
8+
using System.Runtime.CompilerServices;
9+
10+
/*
11+
Using `[module: SkipLocalsInit]` suppresses the .init flag for local variables for the entire module.
12+
This doesn't affect the correctness of the methods in this assembly, as none of them are relying on
13+
JIT ensuring that all local memory is zeroed out to work. Doing this can provide some minor
14+
performance benefits, depending on the workload.
15+
*/
16+
[module: SkipLocalsInit]

eng/Toolkit.Common.targets

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<PropertyGroup>
3+
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
44
<Company>Microsoft</Company>
55
<Authors>Microsoft</Authors>
66
<Product>.NET Community Toolkit</Product>
@@ -13,19 +13,25 @@
1313
<PackageIcon>Icon.png</PackageIcon>
1414
</PropertyGroup>
1515

16-
<PropertyGroup>
16+
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
1717
<!-- TODO: Dynamically generate Title if one wasn't set -->
1818
<Title Condition="'$(Title)' == ''">$(Product) Asset</Title>
1919
<PackageTags Condition="'$(PackageTags)' != ''">$(CommonTags);$(PackageTags)</PackageTags>
2020
<PackageTags Condition="'$(PackageTags)' == ''">$(CommonTags)</PackageTags>
2121
</PropertyGroup>
2222

23-
<ItemGroup Condition="$(IsPackable)">
23+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
2424
<None Pack="true" PackagePath="\" Visible="False" Include="$(BuildToolsDirectory)Icon.png" />
2525
<None Pack="true" PackagePath="\" Visible="False" Include="$(RepositoryDirectory)License.md" />
2626
<None Pack="true" PackagePath="\" Visible="False" Include="$(RepositoryDirectory)ThirdPartyNotices.txt" />
2727
</ItemGroup>
2828

29+
<!-- Checked Version properties to use down the line -->
30+
<PropertyGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))' == '.NETCoreApp'">
31+
<_ToolkitTargetFrameworkVersion>$([MSBuild]::GetTargetFrameworkVersion($(TargetFramework)))</_ToolkitTargetFrameworkVersion>
32+
<_NET_6_OR_GREATER>$([MSBuild]::VersionGreaterThanOrEquals($(_ToolkitTargetFrameworkVersion), '6.0'))</_NET_6_OR_GREATER>
33+
</PropertyGroup>
34+
2935
<!--
3036
Add additional Pre-Processor symbols to $(DefineConstants) and $(FinalDefineConstants) in VB.
3137
This overrides the same target in the .NET SDK. Since, that version has issues in DesignTime.

eng/Toolkit.TextTemplates.targets

+4-31
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,17 @@
66
</ItemGroup>
77

88
<ItemGroup>
9-
<None Update="Generated\Guard.Comparable.Numeric.tt">
9+
<None Update="**\*.tt">
1010
<Generator>TextTemplatingFileGenerator</Generator>
11-
<LastGenOutput>Guard.Comparable.Numeric.g.cs</LastGenOutput>
12-
</None>
13-
<None Update="Generated\Guard.Collection.tt">
14-
<Generator>TextTemplatingFileGenerator</Generator>
15-
<LastGenOutput>Guard.Collection.g.cs</LastGenOutput>
16-
</None>
17-
<None Update="Generated\ThrowHelper.Collection.tt">
18-
<Generator>TextTemplatingFileGenerator</Generator>
19-
<LastGenOutput>ThrowHelper.Collection.g.cs</LastGenOutput>
20-
</None>
21-
<None Update="Generated\TypeInfo.ttinclude">
22-
<Generator>TextTemplatingFileGenerator</Generator>
23-
<LastGenOutput>TypeInfo.g.cs</LastGenOutput>
11+
<LastGenOutput>%(Filename).g.cs</LastGenOutput>
2412
</None>
2513
</ItemGroup>
2614

2715
<ItemGroup>
28-
<Compile Update="Generated\Guard.Comparable.Numeric.g.cs">
29-
<DesignTime>True</DesignTime>
16+
<Compile Update="**\*.g.cs">
3017
<AutoGen>True</AutoGen>
31-
<DependentUpon>Guard.Comparable.Numeric.tt</DependentUpon>
32-
</Compile>
33-
<Compile Update="Generated\Guard.Collection.g.cs">
3418
<DesignTime>True</DesignTime>
35-
<AutoGen>True</AutoGen>
36-
<DependentUpon>Guard.Collection.tt</DependentUpon>
37-
</Compile>
38-
<Compile Update="Generated\ThrowHelper.Collection.g.cs">
39-
<DesignTime>True</DesignTime>
40-
<AutoGen>True</AutoGen>
41-
<DependentUpon>ThrowHelper.Collection.tt</DependentUpon>
42-
</Compile>
43-
<Compile Update="Generated\TypeInfo.g.cs">
44-
<DesignTime>True</DesignTime>
45-
<AutoGen>True</AutoGen>
46-
<DependentUpon>TypeInfo.ttinclude</DependentUpon>
19+
<DependentUpon>$([System.IO.Path]::ChangeExtension(%(Filename), '.tt'))</DependentUpon>
4720
</Compile>
4821
</ItemGroup>
4922

src/CommunityToolkit.HighPerformance/CommunityToolkit.HighPerformance.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<!-- On .NET Standard 2.0, the unit test project also needs access to internals -->
4141
<ItemGroup>
42-
<InternalsVisibleTo Include="CommunityToolkit.HighPerformance.UnitTests, PublicKey=$(AssemblySignPublicKey)" />
42+
<InternalsVisibleTo Include="CommunityToolkit.HighPerformance.UnitTests" />
4343
</ItemGroup>
4444

4545
<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<!-- Add the [InternalsVisibleTo] attribute for the test project -->
4141
<ItemGroup>
42-
<InternalsVisibleTo Include="CommunityToolkit.Mvvm.Internals.UnitTests, PublicKey=$(AssemblySignPublicKey)" />
42+
<InternalsVisibleTo Include="CommunityToolkit.Mvvm.Internals.UnitTests" />
4343
</ItemGroup>
4444

4545
<!--

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
<Project>
22

33
<!-- Get the analyzer from the CommunityToolkit.Mvvm NuGet package -->
4-
<Target Name="MVVMToolkitGatherAnalyzers">
4+
<Target Name="MVVMToolkit_GatherAnalyzers">
55
<ItemGroup>
6-
<MVVMToolkitAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'CommunityToolkit.Mvvm'" />
6+
<MVVMToolkit_Analyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'CommunityToolkit.Mvvm'" />
77
</ItemGroup>
88
</Target>
99

1010
<!-- Remove the analyzer if using Roslyn 3.x (incremental generators require Roslyn 4.x) -->
11-
<Target Name="MVVMToolkitRemoveAnalyzersForRoslyn3"
11+
<Target Name="MVVMToolkit_RemoveAnalyzers_WhenRoslynVersionIsNotSupported"
1212
Condition="'$(CSharpCoreTargetsPath)' != ''"
1313
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
14-
DependsOnTargets="MVVMToolkitGatherAnalyzers">
14+
DependsOnTargets="MVVMToolkit_GatherAnalyzers">
1515

1616
<!--
1717
Use the CSharpCoreTargetsPath property to find the version of the compiler we are using. This is the same mechanism
1818
MSBuild uses to find the compiler. We could check the assembly version for any compiler assembly (since they all have
1919
the same version) but Microsoft.Build.Tasks.CodeAnalysis.dll is where MSBuild loads the compiler tasks from so if
2020
someone is getting creative with msbuild tasks/targets this is the "most correct" assembly to check.
2121
-->
22-
<GetAssemblyIdentity AssemblyFiles="$([System.IO.Path]::Combine(`$([System.IO.Path]::GetDirectoryName($(CSharpCoreTargetsPath)))`,`Microsoft.Build.Tasks.CodeAnalysis.dll`))">
23-
<Output TaskParameter="Assemblies" ItemName="MVVMToolkitCurrentCompilerAssemblyIdentity"/>
22+
<GetAssemblyIdentity AssemblyFiles="$([System.IO.Path]::Combine($([System.IO.Path]::GetDirectoryName($(CSharpCoreTargetsPath))), 'Microsoft.Build.Tasks.CodeAnalysis.dll'))">
23+
<Output TaskParameter="Assemblies" ItemName="MVVMToolkit_CurrentCompilerAssemblyIdentity"/>
2424
</GetAssemblyIdentity>
2525

2626
<PropertyGroup>
2727
<!-- Transform the resulting item from GetAssemblyIdentity into a property representing its assembly version -->
28-
<MVVMToolkitCurrentCompilerVersion>@(MVVMToolkitCurrentCompilerAssemblyIdentity->'%(Version)')</MVVMToolkitCurrentCompilerVersion>
28+
<MVVMToolkit_CurrentCompilerVersion>@(MVVMToolkit_CurrentCompilerAssemblyIdentity->%(Version))</MVVMToolkit_CurrentCompilerVersion>
2929

30-
<!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
31-
<MVVMToolkitCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(MVVMToolkitCurrentCompilerVersion), 4.0))">true</MVVMToolkitCurrentCompilerVersionIsNotNewEnough>
30+
<!-- The CurrentCompilerIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
31+
<MVVMToolkit_CurrentCompilerIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(MVVMToolkit_CurrentCompilerVersion), 4.0))">true</MVVMToolkit_CurrentCompilerIsNotNewEnough>
3232
</PropertyGroup>
3333

3434
<!-- If the Roslyn version is < 4.0, disable the source generators -->
35-
<ItemGroup Condition ="'$(MVVMToolkitCurrentCompilerVersionIsNotNewEnough)' == 'true'">
36-
<Analyzer Remove="@(MVVMToolkitAnalyzer)"/>
35+
<ItemGroup Condition ="'$(MVVMToolkit_CurrentCompilerIsNotNewEnough)' == 'true'">
36+
<Analyzer Remove="@(MVVMToolkit_Analyzer)"/>
3737
</ItemGroup>
3838

3939
<!--
4040
If the source generators are disabled, also emit a warning. This would've been produced by MSBuild itself as well, but
4141
emitting this manually lets us customize the message to inform developers as to why exactly the generators have been
4242
disabled, and that the rest of the MVVM Toolkit will still keep working as intended, just without additional features.
4343
-->
44-
<Warning Condition ="'$(MVVMToolkitCurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The MVVM Toolkit source generators have been disabled on the current configuration, as they need Roslyn 4.x in order to work. The MVVM Toolkit will work just fine, but features relying on the source generators will not be available."/>
44+
<Warning Condition ="'$(MVVMToolkit_CurrentCompilerIsNotNewEnough)' == 'true'" Text="The MVVM Toolkit source generators have been disabled on the current configuration, as they need Roslyn 4.x in order to work. The MVVM Toolkit will work just fine, but features relying on the source generators will not be available."/>
4545
</Target>
4646

4747
<!--
48-
Manually remove duplicate analyzers if Roslyn component versioning is not supported (ie. if a legacy .csproj project is used).
48+
Manually remove additional analyzers if Roslyn component versioning is not supported (ie. if a legacy .csproj project is used).
4949
This target is only run if Roslyn 4.0 or greater is present, as otherwise all analyzers would have already been removed anyway.
5050
-->
51-
<Target Name="MVVMToolkitRemoveDuplicateAnalyzersWhenRoslynComponentVersioningIsNotSupported"
52-
Condition="'$(MVVMToolkitCurrentCompilerVersionIsNotNewEnough)' != 'true' AND '$(SupportsRoslynComponentVersioning)' != 'true'"
51+
<Target Name="MVVMToolkit_RemoveAdditionalAnalyzers_WhenRoslynComponentVersioningIsNotSupported"
52+
Condition="'$(MVVMToolkit_CurrentCompilerIsNotNewEnough)' != 'true' AND '$(SupportsRoslynComponentVersioning)' != 'true'"
5353
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
54-
DependsOnTargets="MVVMToolkitRemoveAnalyzersForRoslyn3">
54+
DependsOnTargets="MVVMToolkit_RemoveAnalyzers_WhenRoslynVersionIsNotSupported">
5555

5656
<!--
5757
This switch manually implements Roslyn component versioning. That is, it checks the current version of Roslyn and
5858
removes and removes all analyzers except the highest version that is supported. The fallback is just Roslyn 4.0.
5959
-->
6060
<PropertyGroup>
61-
<MVVMToolkitSelectedRoslynAnalyzerDirectoryName Condition="$([MSBuild]::VersionGreaterThanOrEquals($(MVVMToolkitCurrentCompilerVersion), 4.3))">roslyn4.3</MVVMToolkitSelectedRoslynAnalyzerDirectoryName>
62-
<MVVMToolkitSelectedRoslynAnalyzerDirectoryName Condition="'$(MVVMToolkitSelectedRoslynAnalyzerDirectoryName)' == ''">roslyn4.0</MVVMToolkitSelectedRoslynAnalyzerDirectoryName>
61+
<MVVMToolkit_SelectedRoslynAnalyzerTarget Condition="$([MSBuild]::VersionGreaterThanOrEquals($(MVVMToolkit_CurrentCompilerVersion), 4.3))">roslyn4.3</MVVMToolkit_SelectedRoslynAnalyzerTarget>
62+
<MVVMToolkit_SelectedRoslynAnalyzerTarget Condition="'$(MVVMToolkit_SelectedRoslynAnalyzerTarget)' == ''">roslyn4.0</MVVMToolkit_SelectedRoslynAnalyzerTarget>
6363
</PropertyGroup>
6464

6565
<!--
6666
This condition is a bit convoluted, but it's essentially just selecting all analyzers from the NuGet package that don't have the target Roslyn directory name in their full path.
6767
For instance, if Roslyn 4.3 is the highest supported version, the target directory name will be "roslyn 4.3", and this condition will filter out all analyzers with a path such
68-
as: "C:\...\.nuget\...\CommunityToolkit.Mvvm\analyzers\roslyn4.0\cs\CommunityToolkit.Mvvm". The [System.String]::Concat trick is used to achieve two things: we can't directly
68+
as: "C:\...\.nuget\...\CommunityToolkit.Mvvm\analyzers\roslyn4.0\cs\CommunityToolkit.Mvvm". The [System.String]::Copy trick is used to achieve two things: we can't directly
6969
invoke a property function (ie. Contains in this case) on a metadata item, so we need an intermediate string to invoke it on. We could also use [System.String]::new, but using
70-
Concat is more efficient as it'll just skip the allocation entirely if one of the two inputs is an empty string, which is the case here.
70+
Copy is more efficient (on .NET Framework runtime) as it'll just skip the allocation entirely.
7171
-->
7272
<ItemGroup>
73-
<Analyzer Remove="@(MVVMToolkitAnalyzer)" Condition="!$([System.String]::Concat('', '%(MVVMToolkitAnalyzer.FullPath)').Contains('$(MVVMToolkitSelectedRoslynAnalyzerDirectoryName)'))"/>
73+
<Analyzer Remove="@(MVVMToolkit_Analyzer)" Condition="!$([System.String]::Copy(%(MVVMToolkit_Analyzer.FullPath)).Contains($(MVVMToolkit_SelectedRoslynAnalyzerTarget)))"/>
7474
</ItemGroup>
7575
</Target>
7676

7777
<!-- Remove the analyzer if Roslyn is missing -->
78-
<Target Name="MVVMToolkitRemoveAnalyzersForRosynNotFound"
78+
<Target Name="MVVMToolkit_RemoveAnalyzers_WhenRoslynIsNotFound"
7979
Condition="'$(CSharpCoreTargetsPath)' == ''"
8080
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
81-
DependsOnTargets="MVVMToolkitGatherAnalyzers">
81+
DependsOnTargets="MVVMToolkit_GatherAnalyzers">
8282

8383
<!-- If no Roslyn assembly could be found, just remove the analyzer without emitting a warning -->
8484
<ItemGroup>
85-
<Analyzer Remove="@(MVVMToolkitAnalyzer)"/>
85+
<Analyzer Remove="@(MVVMToolkit_Analyzer)"/>
8686
</ItemGroup>
8787
</Target>
8888

src/Directory.Build.props

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<Import Project="..\Directory.Build.props" />
3+
<Import Project="..\$(MSBuildThisFile)" />
44

55
<PropertyGroup>
66
<IsPackable>true</IsPackable>
@@ -12,10 +12,7 @@
1212

1313
<!-- Include PolySharp to generate polyfills for all projects (on their .NET Standard 2.x targets) -->
1414
<ItemGroup>
15-
<PackageReference Include="PolySharp" Version="1.8.1">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>build; analyzers</IncludeAssets>
18-
</PackageReference>
15+
<PackageReference Include="PolySharp" Version="1.8.1" PrivateAssets="All" IncludeAssets="Analyzers;Build" />
1916
</ItemGroup>
2017

2118
</Project>

src/Directory.Build.targets

+10-47
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,19 @@
11
<Project>
22

3-
<Import Project="..\Directory.Build.targets" />
3+
<Import Project="..\$(MSBuildThisFile)" />
44

5-
<!-- Define NETSTANDARD2_1_OR_GREATER for .NET Standard 2.1 targets and above -->
6-
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0'">
7-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
8-
</PropertyGroup>
9-
10-
<!-- Configure trimming for projects on .NET 6 and above -->
11-
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0'">
12-
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
5+
<PropertyGroup Condition="'$(_NET_6_OR_GREATER)' == 'true'">
136
<IsTrimmable>true</IsTrimmable>
7+
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
8+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
149
</PropertyGroup>
1510

16-
<!--
17-
The following target has been ported from TerraFX.Interop.Windows.
18-
See: https://github.com/terrafx/terrafx.interop.windows.
19-
Using [module: SkipLocalsInit] suppresses the .init flag for local variables for the entire module.
20-
This doesn't affect the correctness of methods in this assembly, as none of them are relying on the
21-
JIT ensuring that all local memory is zeroed out to work. Doing this can provide some minor
22-
performance benefits, depending on the workload.
23-
-->
24-
<PropertyGroup>
25-
<GeneratedSkipLocalsInitFile Condition="'$(GeneratedSkipLocalsInitFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs</GeneratedSkipLocalsInitFile>
26-
<GeneratedSkipLocalsInitFileLines>
27-
<![CDATA[//------------------------------------------------------------------------------
28-
// <auto-generated>
29-
// This code was generated by a tool.
30-
//
31-
// Changes to this file may cause incorrect behavior and will be lost if
32-
// the code is regenerated.
33-
// </auto-generated>
34-
//------------------------------------------------------------------------------
35-
36-
[module: global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]]]>
37-
</GeneratedSkipLocalsInitFileLines>
38-
</PropertyGroup>
39-
40-
<Target Name="GenerateSkipLocalsInit"
41-
BeforeTargets="BeforeCompile;CoreCompile"
42-
DependsOnTargets="PrepareForBuild"
43-
Condition="'$(Language)' == 'C#'"
44-
Inputs="$(MSBuildAllProjects)"
45-
Outputs="$(GeneratedSkipLocalsInitFile)">
46-
47-
<!-- Write the file with the attribute -->
48-
<WriteLinesToFile Lines="$(GeneratedSkipLocalsInitFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" File="$(GeneratedSkipLocalsInitFile)" />
11+
<ItemGroup>
12+
<Compile Include="$(BuildToolsDirectory)AssemblyInfo.Shared.cs" LinkBase="Properties" Visible="False" />
13+
</ItemGroup>
4914

50-
<!-- Include the generated file in the list of files to compile -->
51-
<ItemGroup>
52-
<Compile Include="$(GeneratedSkipLocalsInitFile)" />
53-
</ItemGroup>
54-
</Target>
15+
<ItemGroup>
16+
<InternalsVisibleTo Update="@(InternalsVisibleTo)" PublicKey="$(AssemblySignPublicKey)" Condition="@(InternalsVisibleTo->Count()) != 0" />
17+
</ItemGroup>
5518

5619
</Project>

tests/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<Import Project="..\Directory.Build.props" />
3+
<Import Project="..\$(MSBuildThisFile)" />
44

55
<PropertyGroup>
66
<IsPackable>false</IsPackable>

tests/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<Import Project="..\Directory.Build.targets" />
3+
<Import Project="..\$(MSBuildThisFile)" />
44

55
<!-- MSTest v2 -->
66
<ItemGroup Condition="'$(IsTestProject)' == 'true'">

0 commit comments

Comments
 (0)