Skip to content

Commit 3ad9062

Browse files
committed
Refactor Core project files
Organize Package tags Update Package descriptions Remove redundant MSBuild logic Consolidate common MSBuild logic
1 parent 4ec02d5 commit 3ad9062

File tree

39 files changed

+337
-322
lines changed

39 files changed

+337
-322
lines changed

Directory.Build.props

Lines changed: 30 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,64 @@
11
<Project>
22

33
<PropertyGroup>
4-
<Authors>Microsoft.Toolkit</Authors>
5-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
6-
<NoPackageAnalysis>true</NoPackageAnalysis>
7-
<PackageIconUrl>https://raw.githubusercontent.com/CommunityToolkit/WindowsCommunityToolkit/main/build/nuget.png</PackageIconUrl>
8-
<PackageIcon>images\nuget.png</PackageIcon>
9-
<PackageProjectUrl>https://github.com/CommunityToolkit/WindowsCommunityToolkit</PackageProjectUrl>
10-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11-
<PackageReleaseNotes>https://github.com/CommunityToolkit/WindowsCommunityToolkit/releases</PackageReleaseNotes>
12-
<Copyright>(c) .NET Foundation and Contributors. All rights reserved.</Copyright>
13-
<DefaultLanguage>en-US</DefaultLanguage>
14-
<IsDesignProject>$(MSBuildProjectName.Contains('.Design'))</IsDesignProject>
15-
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
16-
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
17-
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
18-
<TargetPlatformBaseVersion>10.0</TargetPlatformBaseVersion>
19-
<TargetPlatformRevision>19041</TargetPlatformRevision>
20-
<TargetPlatformMinRevision>17763</TargetPlatformMinRevision>
21-
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
4+
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
5+
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
226
</PropertyGroup>
237

24-
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
25-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
26-
</PropertyGroup>
8+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.props" />
279

2810
<Choose>
29-
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
11+
<When Condition="$(IsCoreProject)">
3012
<PropertyGroup>
3113
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
15+
<GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout>
16+
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
3217
</PropertyGroup>
3318
</When>
3419
<Otherwise>
3520
<PropertyGroup>
3621
<IsPackable>false</IsPackable>
22+
<IsPublishable>false</IsPublishable>
3723
</PropertyGroup>
3824
</Otherwise>
3925
</Choose>
4026

4127
<Choose>
42-
<When Condition="('$(IsUwpProject)' == 'true') and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
28+
<When Condition="$(IsUwpProject)">
4329
<PropertyGroup>
44-
<GenerateLibraryLayout>true</GenerateLibraryLayout>
30+
<!-- Code CS8002 is a warning for strong named -> non-strong-named reference. This is valid for platforms other than .NET Framework (and is needed for the UWP targets. -->
31+
<NoWarn>$(NoWarn);CS8002</NoWarn>
32+
<!-- For including default @(Page) and @(Resource) items via 'MSBuild.Sdk.Extras' Sdk package. Also provides up to date check and file nesting -->
33+
<ExtrasEnableDefaultXamlItems>true</ExtrasEnableDefaultXamlItems>
4534
</PropertyGroup>
4635
</When>
4736
</Choose>
4837

4938
<Choose>
50-
<When Condition="'$(Configuration)' == 'Debug' and '$(IsDesignProject)' != 'true'">
51-
<!-- Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios -->
52-
<PropertyGroup>
39+
<When Condition="!$(IsDesignProject)">
40+
<!--
41+
Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios.
42+
ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that.
43+
-->
44+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
5345
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
5446
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
5547
</PropertyGroup>
48+
<ItemGroup>
49+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
50+
</ItemGroup>
5651
</When>
5752
</Choose>
5853

54+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.props" Condition="$(IsDesignProject)" />
55+
56+
<ItemGroup>
57+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
58+
</ItemGroup>
59+
5960
<Choose>
60-
<When Condition="'$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true'">
61+
<When Condition="!$(IsSampleProject) and '$(SourceLinkEnabled)' != 'false'">
6162
<PropertyGroup>
6263
<!-- Declare that the Repository URL can be published to NuSpec -->
6364
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -67,51 +68,9 @@
6768
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
6869
</PropertyGroup>
6970
<ItemGroup>
70-
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All" />
7171
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
7272
</ItemGroup>
7373
</When>
7474
</Choose>
7575

76-
<Choose>
77-
<When Condition="'$(IsDesignProject)' != 'true'">
78-
<ItemGroup>
79-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
80-
</ItemGroup>
81-
</When>
82-
</Choose>
83-
84-
<Choose>
85-
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
86-
<ItemGroup>
87-
<EmbeddedResource Include="**\*.rd.xml" />
88-
<Page Include="**\*.xaml" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
89-
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
90-
</ItemGroup>
91-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
92-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
93-
</PropertyGroup>
94-
</When>
95-
</Choose>
96-
97-
<PropertyGroup Condition="'$(IsUwpProject)' == 'true'">
98-
<!-- 8002 is a strong named -> non-strong-named reference -->
99-
<!-- This is valid for platforms other than .NET Framework (and is needed for the UWP targets -->
100-
<NoWarn>$(NoWarn);8002</NoWarn>
101-
</PropertyGroup>
102-
103-
<ItemGroup>
104-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
105-
</ItemGroup>
106-
107-
<ItemGroup>
108-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json">
109-
<Link>stylecop.json</Link>
110-
</AdditionalFiles>
111-
<None Include="$(MSBuildThisFileDirectory)License.md" Pack="true" PackagePath="\" />
112-
<None Include="$(MSBuildThisFileDirectory)build\nuget.png" Pack="true" PackagePath="images\" />
113-
</ItemGroup>
114-
115-
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.VisualStudio.Design.props" Condition="'$(IsDesignProject)' == 'true'" />
116-
117-
</Project>
76+
</Project>

Directory.Build.targets

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
<Project>
22

3+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.targets" />
4+
35
<PropertyGroup>
4-
<UseUWP Condition="$(TargetFramework.Contains(`uap10.0`)) or '$(TargetFramework)' == 'net461'">true</UseUWP>
6+
<!-- Exclude Notifications project from this since it sets different min versions than what we want for notifications -->
7+
<UseUWP Condition="($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'net461') and '$(MSBuildProjectName)' != 'Microsoft.Toolkit.Uwp.Notifications'">true</UseUWP>
8+
<UseUWP Condition="'$(UseUWP)' == ''">false</UseUWP>
59
</PropertyGroup>
610

711
<Choose>
812
<!-- We'll include signing the Notifications library since we need the DLL signature to match for interop from class libraries to main projects -->
9-
<When Condition="(!$(TargetFramework.Contains(`uap10.0`)) and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true') or $(MSBuildProjectName) == 'Microsoft.Toolkit.Uwp.Notifications'">
13+
<When Condition="!($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native' or $(IsSampleProject)) or '$(MSBuildProjectName)' == 'Microsoft.Toolkit.Uwp.Notifications'">
1014
<PropertyGroup>
1115
<SignAssembly>true</SignAssembly>
1216
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
1317
</PropertyGroup>
1418
</When>
1519
</Choose>
1620

17-
<!--Exclude Notifications project from this since it sets different min versions than what we want for notifications-->
18-
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.Uwp.Build.targets" Condition="'$(UseUWP)' == 'true' and $(MSBuildProjectName) != 'Microsoft.Toolkit.Uwp.Notifications'" />
21+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.UWP.Build.targets" Condition="$(UseUWP)" />
22+
23+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Workarounds.Xaml.targets" Condition="$(IsCoreProject)" />
1924

2025
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
2126
<ItemGroup>

Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
4+
<Nullable>Enable</Nullable>
65
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7-
<Nullable>enable</Nullable>
6+
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
810
<Title>Windows Community Toolkit Diagnostics .NET Standard</Title>
911
<Description>
1012
This package includes .NET Standard code only helpers such as:
1113
- Guard: Helper methods to verify conditions when running code.
1214
- ThrowHelper: Helper methods to efficiently throw exceptions.
1315
</Description>
14-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;extensions;helpers</PackageTags>
16+
<PackageTags>Diagnostics;Guard;ThrowHelper;TypeInfo;Extensions;Helpers</PackageTags>
1517
</PropertyGroup>
1618

1719
<Choose>

Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
6-
<Nullable>enable</Nullable>
4+
<Nullable>Enable</Nullable>
75
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
810
<Title>Windows Community Toolkit High Performance .NET Standard</Title>
911
<Description>
1012
This package includes high performance .NET Standard helpers such as:
@@ -22,7 +24,7 @@
2224
- Ref&lt;T&gt;: a stack-only struct that can store a reference to a value of a specified type.
2325
- NullableRef&lt;T&gt;: a stack-only struct similar to Ref&lt;T&gt;, which also supports nullable references.
2426
</Description>
25-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;core;standard;unsafe;span;memory;string;array;stream;buffer;extensions;helpers;parallel;performance</PackageTags>
27+
<PackageTags>Parallel;Performance;Unsafe;Span;Memory;String;StringPool;Array;Stream;Buffer;Extensions;Helpers</PackageTags>
2628
</PropertyGroup>
2729

2830
<Choose>

Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
6-
<Nullable>enable</Nullable>
4+
<Nullable>Enable</Nullable>
75
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
810
<Title>Windows Community Toolkit MVVM Toolkit</Title>
911
<Description>
1012
This package includes a .NET Standard MVVM library with helpers such as:
@@ -17,7 +19,7 @@
1719
- StrongReferenceMessenger: a high-performance messaging system that trades weak references for speed.
1820
- Ioc: a helper class to configure dependency injection service containers.
1921
</Description>
20-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;WinUI;WPF;Xamarin;Forms;Uno;Platform;MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;observable;Ioc;dependency injection;services;extensions;helpers</PackageTags>
22+
<PackageTags>MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;Observable;IOC;DI;Dependency Injection;Object Messaging;Extensions;Helpers</PackageTags>
2123
</PropertyGroup>
2224

2325
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->

Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
58
<Title>Windows Community Toolkit Devices</Title>
69
<Description>This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers.</Description>
7-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Devices;Bluetooth;LE;BluetoothLE;BLE;Networking</PackageTags>
10+
<PackageTags>Devices;Bluetooth;LE;BluetoothLE;BLE;Networking</PackageTags>
811
</PropertyGroup>
912

1013
<ItemGroup>

Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
58
<Title>Windows Community Toolkit Developer Tools</Title>
6-
<Description>This library provides XAML user controls and services to help developers build their app. It is part of the Windows Community Toolkit.
9+
<Description>This library provides XAML user controls and services to help developers build their app. It is a part of the Windows Community Toolkit.
710

811
-AligmentGrid : Displays a Grid that helps align the controls.
912
-FocusTrackerControl : The FocusTracker Control is a feature that can be used to display information about the current focused XAML element.
1013
-Themes : Provides the source path of the resource dictionaries for the FocusTracker.
1114
</Description>
12-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Controls;XAML;Developer;Tools;Accessibility;Alignment;Grid;AlignmentGrid</PackageTags>
15+
<PackageTags>Controls;XAML;Developer;Tools;Accessibility;Alignment;Grid;AlignmentGrid</PackageTags>
1316
</PropertyGroup>
1417

1518
<ItemGroup>
1619
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
1720
</ItemGroup>
1821

19-
<!-- https://weblogs.asp.net/rweigelt/disable-warnings-in-generated-c-files-of-uwp-app -->
20-
<Target Name="PragmaWarningDisablePrefixer" AfterTargets="MarkupCompilePass2">
21-
<ItemGroup>
22-
<GeneratedCSFiles Include="**\*.g.cs;**\*.g.i.cs" />
23-
</ItemGroup>
24-
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
25-
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
26-
</Target>
27-
2822
</Project>
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFramework>uap10.0.17134</TargetFramework>
5-
<Title>Windows Community Toolkit Eye Gaze Library</Title>
6-
<Description>A library to integrate gaze interactions using eye trackers into UWP applications</Description>
7-
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Gaze;Eye;Tracker;EyeTracker</PackageTags>
4+
<TargetFrameworks>uap10.0.17134</TargetFrameworks>
5+
<RootNamespace>Microsoft.Toolkit.Uwp.Input</RootNamespace>
86
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
97
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
108
</PropertyGroup>
119

10+
<PropertyGroup>
11+
<Title>Windows Community Toolkit Eye Gaze Library</Title>
12+
<Description>A library to integrate gaze interactions using eye trackers into UWP applications</Description>
13+
<PackageTags>Input;Gaze;Eye;Tracker;EyeTracker</PackageTags>
14+
</PropertyGroup>
15+
1216
</Project>

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.19041'">
1010
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
11-
<DefaultTargetPlatformMinVersion>16299</DefaultTargetPlatformMinVersion>
1211
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
1312
</PropertyGroup>
1413

@@ -26,7 +25,6 @@
2625
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
2726
<PackageTargetFallback>uap10.0</PackageTargetFallback>
2827
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
29-
<DefaultTargetPlatformMinVersion>10240</DefaultTargetPlatformMinVersion>
3028
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
3129
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
3230
<CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>

Microsoft.Toolkit.Uwp.Notifications/Properties/Microsoft.Toolkit.Uwp.Notifications.rd.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
2-
This file enable reflections for Toolkit.Notifications and all of its public/private members,
3-
enabling the library to work in .NET Native even if developers modified their default rd.xml.
2+
This file enables reflection for 'Uwp.Notifications' and all of its public/private members.
3+
Thus, making the library to work in .NET Native, even if developers modified their default rd.xml.
44
See issue https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/3093 for more details.
55
-->
66
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">

0 commit comments

Comments
 (0)