Skip to content

Commit b9fe201

Browse files
committed
Refactor projects and its files
Consolidate common MSBuild logic Update Package title and description
1 parent 0d2e89a commit b9fe201

File tree

27 files changed

+276
-284
lines changed

27 files changed

+276
-284
lines changed

Directory.Build.props

Lines changed: 36 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,70 @@
11
<Project>
22

33
<PropertyGroup>
4-
<Authors>Microsoft.Toolkit</Authors>
5-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
6-
<NoPackageAnalysis>true</NoPackageAnalysis>
7-
<PackageIconUrl>https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png</PackageIconUrl>
8-
<PackageIcon>images\nuget.png</PackageIcon>
9-
<PackageProjectUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit</PackageProjectUrl>
10-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11-
<PackageReleaseNotes>https://github.com/windows-toolkit/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

8+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.props" />
9+
2410
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
2511
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2612
</PropertyGroup>
2713

2814
<Choose>
29-
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
15+
<When Condition="$(IsCoreProject)">
3016
<PropertyGroup>
3117
<GenerateDocumentationFile>true</GenerateDocumentationFile>
18+
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
19+
<GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout>
20+
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
3221
</PropertyGroup>
3322
</When>
23+
<Otherwise>
24+
<PropertyGroup>
25+
<IsPackable>false</IsPackable>
26+
</PropertyGroup>
27+
</Otherwise>
3428
</Choose>
3529

3630
<Choose>
37-
<When Condition="('$(IsUwpProject)' == 'true') and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
31+
<When Condition="$(IsUwpProject)">
3832
<PropertyGroup>
39-
<GenerateLibraryLayout>true</GenerateLibraryLayout>
33+
<!-- Code 8002 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. -->
34+
<NoWarn>$(NoWarn);8002</NoWarn>
4035
</PropertyGroup>
36+
<ItemGroup>
37+
<EmbeddedResource Include="**\*.rd.xml" />
38+
<Page Include="**\*.xaml" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
39+
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
40+
</ItemGroup>
4141
</When>
4242
</Choose>
4343

4444
<Choose>
45-
<When Condition="'$(Configuration)' == 'Debug' and '$(IsDesignProject)' != 'true'">
46-
<!-- Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios -->
45+
<When Condition="!$(IsDesignProject)">
46+
<!--
47+
Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios.
48+
ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that.
49+
-->
4750
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
4851
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
4952
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
5053
</PropertyGroup>
54+
<ItemGroup>
55+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
56+
</ItemGroup>
5157
</When>
5258
</Choose>
5359

60+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.props" Condition="$(IsDesignProject)" />
61+
62+
<ItemGroup>
63+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
64+
</ItemGroup>
65+
5466
<Choose>
55-
<When Condition="'$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true'">
67+
<When Condition="!$(IsSampleProject) and '$(SourceLinkEnabled)' != 'false'">
5668
<PropertyGroup>
5769
<!-- Declare that the Repository URL can be published to NuSpec -->
5870
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -68,45 +80,4 @@
6880
</When>
6981
</Choose>
7082

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

Directory.Build.targets

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

33
<PropertyGroup>
4-
<UseUWP Condition="$(TargetFramework.Contains(`uap10.0`)) or '$(TargetFramework)' == 'net461'">true</UseUWP>
4+
<!-- Exclude Notifications project from this since it sets different min versions than what we want for notifications -->
5+
<UseUWP Condition="($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'net461') and '$(MSBuildProjectName)' != 'Microsoft.Toolkit.Uwp.Notifications'">true</UseUWP>
56
</PropertyGroup>
67

78
<Choose>
89
<!-- 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'">
10+
<When Condition="!($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native' or '$(IsSampleProject)' == 'true') or '$(MSBuildProjectName)' == 'Microsoft.Toolkit.Uwp.Notifications'">
1011
<PropertyGroup>
1112
<SignAssembly>true</SignAssembly>
1213
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
1314
</PropertyGroup>
1415
</When>
1516
</Choose>
1617

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'"/>
18+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Uwp.Build.targets" Condition="'$(UseUWP)' == 'true'" />
19+
20+
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Workarounds.Xaml.targets" Condition="'$(IsCoreProject)' == 'true' and '$(GenerateDocumentationFile)' == 'true'" />
1921

2022
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
2123
<ItemGroup>

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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>
8-
<Title>Windows Community Toolkit Diagnostics .NET Standard</Title>
6+
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<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.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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>
8-
<Title>Windows Community Toolkit High Performance .NET Standard</Title>
6+
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<Title>Windows Community Toolkit - High Performance (.NET Standard)</Title>
911
<Description>
1012
This package includes high performance .NET Standard helpers such as:
1113
- Memory2D&lt;T&gt; and Span2D&lt;T&gt;: two types providing fast and allocation-free abstraction over 2D memory areas.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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>
8-
<Title>Windows Community Toolkit MVVM Toolkit</Title>
6+
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<Title>Windows Community Toolkit - MVVM (.NET Standard)</Title>
911
<Description>
1012
This package includes a .NET Standard MVVM library with helpers such as:
1113
- ObservableObject: a base class for objects implementing the INotifyPropertyChanged interface.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
5-
<Title>Windows Community Toolkit Devices</Title>
4+
<TargetFramework>uap10.0.17763</TargetFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<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>
710
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Devices;Bluetooth;LE;BluetoothLE;BLE;Networking</PackageTags>
811
</PropertyGroup>
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
5-
<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.
4+
<TargetFramework>uap10.0.17763</TargetFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Title>Windows Community Toolkit - Developer Tools</Title>
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.
@@ -16,13 +19,4 @@
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>

Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.Uwp.Input.GazeInteraction.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
<PropertyGroup>
44
<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>
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 - Input - Gaze Interaction (w. Eye Tracker)</Title>
12+
<Description>A library to integrate gaze interactions using eye trackers into UWP applications</Description>
13+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Gaze;Eye;Tracker;EyeTracker</PackageTags>
14+
</PropertyGroup>
15+
1216
</Project>

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<metadata>
33
<id>Microsoft.Toolkit.Uwp.Notifications</id>
44
<version>$version$</version>
5-
<title>Windows Community Toolkit Notifications</title>
5+
<title>Windows Community Toolkit - Notifications</title>
66
<authors>Microsoft.Toolkit,dotnetfoundation</authors>
77
<requireLicenseAcceptance>true</requireLicenseAcceptance>
88
<license type="expression">MIT</license>

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/windows-toolkit/WindowsCommunityToolkit/issues/3093 for more details.
55
-->
66
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">

Microsoft.Toolkit.Uwp.UI.Animations/Microsoft.Toolkit.Uwp.UI.Animations.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
5-
<Title>Windows Community Toolkit Animations</Title>
4+
<TargetFramework>uap10.0.17763</TargetFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Title>Windows Community Toolkit - UI Animations</Title>
69
<Description>
7-
This library provides helpers and extensions on top of Windows Composition and XAML storyboards. It is part of the Windows Community Toolkit.
10+
This library provides helpers and extensions on top of Windows Composition and XAML storyboards. It is a part of the Windows Community Toolkit.
811

912
Namespace:
1013
- CompositionAnimations:
@@ -15,7 +18,6 @@
1518
- AnimationExtensions: Blur, Fade, Light, Offset, Rotate, Saturation, Scale
1619
</Description>
1720
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Animations;Composition;Connected;Implicit;XAML</PackageTags>
18-
<LangVersion>9.0</LangVersion>
1921
</PropertyGroup>
2022

2123
<ItemGroup>

Microsoft.Toolkit.Uwp.UI.Behaviors/Microsoft.Toolkit.Uwp.UI.Behaviors.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
<PropertyGroup>
44
<TargetFramework>uap10.0.17763</TargetFramework>
5-
<LangVersion>9.0</LangVersion>
6-
<Title>Windows Community Toolkit UI Behaviors</Title>
5+
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<Title>Windows Community Toolkit - UI Behaviors</Title>
710
<Description>
8-
This library provides UI behaviors built on the XAML behaviors SDK. It is part of the Windows Community Toolkit.
11+
This library provides UI behaviors built on the XAML behaviors SDK. It is a part of the Windows Community Toolkit.
912

1013
Behaviors:
1114
- BehaviorBase: Helper for building Behaviors
@@ -15,8 +18,6 @@
1518
- FadeHeaderBehavior, QuickReturnHeaderBehavior, StickyHeaderBehavior: Helpers for ListViewBase Header Behavior
1619
</Description>
1720
<PackageTags>Windows;Community;Toolkit;WCT;UWP;UI;Behaviors;Interactivity;Interaction;XAML</PackageTags>
18-
19-
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
2021
</PropertyGroup>
2122

2223
<ItemGroup>

0 commit comments

Comments
 (0)