-
Notifications
You must be signed in to change notification settings - Fork 324
/
Copy pathCommunityToolkit.Mvvm.csproj
131 lines (114 loc) · 9.11 KB
/
CommunityToolkit.Mvvm.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net8.0-windows10.0.17763.0</TargetFrameworks>
</PropertyGroup>
<!--
Windows-only properties (supporting AOT in WinRT scenarios requires actually using the Windows TFM,
because we need the source generators in CsWinRT to generate the supporting interop code for AOT).
-->
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
<WindowsSdkPackageVersion>10.0.17763.53</WindowsSdkPackageVersion>
<!--
We're only referencing CsWinRT for the source generators, we don't need to read any WinRT metadata.
CsWinRT is in projection mode by default, so we want to disable it (or it'd need the Windows SDK).
-->
<CsWinRTGenerateProjection>false</CsWinRTGenerateProjection>
<!-- We'll never have any IIDs to patch in this library -->
<CsWinRTIIDOptimizerOptOut>true</CsWinRTIIDOptimizerOptOut>
<!-- Enable AOT warnings for types implementing projected WinRT interfaces mapped to built-in types (eg. 'INotifyPropertyChanged') -->
<CsWinRTAotWarningLevel>2</CsWinRTAotWarningLevel>
</PropertyGroup>
<PropertyGroup>
<Title>.NET Community Toolkit - MVVM</Title>
<Description>
This package includes a .NET MVVM library with helpers such as:
- ObservableObject: a base class for objects implementing the INotifyPropertyChanged interface.
- ObservableRecipient: a base class for observable objects with support for the IMessenger service.
- ObservableValidator: a base class for objects implementing the INotifyDataErrorInfo interface.
- RelayCommand: a simple delegate command implementing the ICommand interface.
- AsyncRelayCommand: a delegate command supporting asynchronous operations and cancellation.
- WeakReferenceMessenger: a messaging system to exchange messages through different loosely-coupled objects.
- StrongReferenceMessenger: a high-performance messaging system that trades weak references for speed.
- Ioc: a helper class to configure dependency injection service containers.
</Description>
<PackageTags>MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;Observable;IOC;DI;Dependency Injection;Object Messaging;Extensions;Helpers</PackageTags>
</PropertyGroup>
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
</ItemGroup>
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
</ItemGroup>
<!-- Include the ILLink file (to properly trim configuration switches in publish builds) -->
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<EmbeddedResource Include="Properties\ILLink.Substitutions.xml" LogicalName="ILLink.Substitutions.xml" />
</ItemGroup>
<!-- Reference CsWinRT when targeting Windows, to get the latest source generators -->
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))">
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" PrivateAssets="all" />
</ItemGroup>
<!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version), and the code fixer -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<!-- Add the [InternalsVisibleTo] attribute for the test project -->
<ItemGroup>
<InternalsVisibleTo Include="CommunityToolkit.Mvvm.Internals.UnitTests, PublicKey=$(AssemblySignPublicKey)" />
</ItemGroup>
<!-- Necessary polyfills -->
<PropertyGroup>
<PolySharpIncludeGeneratedTypes>
System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute;
System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute;
System.Diagnostics.CodeAnalysis.MemberNotNullAttribute;
System.Diagnostics.CodeAnalysis.NotNullAttribute;
System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute;
System.Diagnostics.CodeAnalysis.NotNullWhenAttribute;
System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute;
System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute;
System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute;
System.Runtime.CompilerServices.CallerArgumentExpressionAttribute;
System.Runtime.CompilerServices.IsExternalInit;
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
</PolySharpIncludeGeneratedTypes>
</PropertyGroup>
<ItemGroup Label="Package">
<!-- Include the custom .targets files (shared across TFMs) -->
<None Include="CommunityToolkit.Mvvm.FeatureSwitches.targets" PackagePath="build" Pack="true" />
<None Include="CommunityToolkit.Mvvm.SourceGenerators.targets" PackagePath="build" Pack="true" />
<None Include="CommunityToolkit.Mvvm.Windows.targets" PackagePath="build" Pack="true" />
<None Include="CommunityToolkit.Mvvm.WindowsSdk.targets" PackagePath="build" Pack="true" />
<None Include="CommunityToolkit.Mvvm.targets" PackagePath="build" Pack="true" />
<None Include="CommunityToolkit.Mvvm.FeatureSwitches.targets" PackagePath="buildTransitive" Pack="true" />
<None Include="CommunityToolkit.Mvvm.SourceGenerators.targets" PackagePath="buildTransitive" Pack="true" />
<None Include="CommunityToolkit.Mvvm.Windows.targets" PackagePath="buildTransitive" Pack="true" />
<None Include="CommunityToolkit.Mvvm.WindowsSdk.targets" PackagePath="buildTransitive" Pack="true" />
<None Include="CommunityToolkit.Mvvm.targets" PackagePath="buildTransitive" Pack="true" />
<!--
Pack the source generator to the right package folders (each matching the target Roslyn version).
Roslyn will automatically load the highest version compatible with Roslyn's version in the SDK.
Also pack the code fixer along with each target analyzer, the multi-targeting take care of it.
Note: the code fixer is not currently multi-targeting, as there are no Roslyn APIs it needs from
versions later than 4.0.1. As such, we can just use a single project (without the shared project
and two multi-targeted ones), and pack the resulting assembly twice along with the generators.
Even though the fixer only references the 4.0.1 generator target, both versions export the same
APIs that the code fixer project needs, and Roslyn versions are also forward compatible.
-->
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.12\cs" Pack="true" Visible="false" />
<None Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
<None Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
<None Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath="analyzers\dotnet\roslyn4.12\cs" Pack="true" Visible="false" />
</ItemGroup>
</Project>