Skip to content

Commit bd46bcd

Browse files
authored
Merge branch 'master' into master
2 parents 803ae55 + 8756f29 commit bd46bcd

File tree

293 files changed

+8503
-3082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+8503
-3082
lines changed

Directory.Build.props

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@
77
<PackageIconUrl>https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png</PackageIconUrl>
88
<PackageProjectUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit</PackageProjectUrl>
99
<PackageLicenseUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/license.md</PackageLicenseUrl>
10-
<PackageReleaseNotes>v3.0 release https://github.com/windows-toolkit/WindowsCommunityToolkit/releases</PackageReleaseNotes>
10+
<PackageReleaseNotes>https://github.com/windows-toolkit/WindowsCommunityToolkit/releases</PackageReleaseNotes>
1111
<Copyright>(c) .NET Foundation and Contributors. All rights reserved.</Copyright>
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<IsDesignProject>$(MSBuildProjectName.Contains('.Design'))</IsDesignProject>
1414
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
1515
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
1616
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
17-
<DefaultTargetPlatformVersion>17763</DefaultTargetPlatformVersion>
17+
<DefaultTargetPlatformVersion>18362</DefaultTargetPlatformVersion>
1818
<DefaultTargetPlatformMinVersion>16299</DefaultTargetPlatformMinVersion>
1919
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
2020
</PropertyGroup>
2121

22-
<PropertyGroup>
23-
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true' and '$(IsTestSampleProject)' != 'true'" >true</SignAssembly>
24-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
22+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
23+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2524
</PropertyGroup>
2625

2726
<Choose>
@@ -41,7 +40,17 @@
4140
</Choose>
4241

4342
<Choose>
44-
<When Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
43+
<When Condition="'$(Configuration)' == 'Debug' and '$(IsDesignProject)' != 'true'">
44+
<!-- Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios -->
45+
<PropertyGroup>
46+
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
47+
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
48+
</PropertyGroup>
49+
</When>
50+
</Choose>
51+
52+
<Choose>
53+
<When Condition="'$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true'">
4554
<PropertyGroup>
4655
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
4756
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -51,8 +60,8 @@
5160
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
5261
</PropertyGroup>
5362
<ItemGroup>
54-
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
55-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
63+
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All"/>
64+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
5665
</ItemGroup>
5766
</When>
5867
</Choose>
@@ -86,7 +95,7 @@
8695
</PropertyGroup>
8796

8897
<ItemGroup>
89-
<PackageReference Include="Nerdbank.GitVersioning" Version=" 2.1.65" PrivateAssets="all" />
98+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="all" />
9099
</ItemGroup>
91100

92101
<ItemGroup>

Directory.Build.targets

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<PropertyGroup>
66
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
77
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
8-
<DebugType>Full</DebugType>
8+
</PropertyGroup>
9+
10+
<PropertyGroup Condition="'$(DebugType)' == ''">
11+
<DebugType>Portable</DebugType>
912
</PropertyGroup>
1013

1114
<ItemGroup>
@@ -18,6 +21,15 @@
1821
</ItemGroup>
1922
</When>
2023
</Choose>
24+
25+
<Choose>
26+
<When Condition="'$(TargetFramework.Contains(`uap10.0`))' == 'false' and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
27+
<PropertyGroup>
28+
<SignAssembly>true</SignAssembly>
29+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
30+
</PropertyGroup>
31+
</When>
32+
</Choose>
2133

2234
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
2335
<ItemGroup>

GazeInputTest/GazeInputTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AssemblyName>GazeInputTest</AssemblyName>
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14-
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
1515
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
@@ -150,7 +150,7 @@
150150
</ItemGroup>
151151
<ItemGroup>
152152
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
153-
<Version>6.2.9</Version>
153+
<Version>6.2.10</Version>
154154
</PackageReference>
155155
<PackageReference Include="StyleCop.Analyzers">
156156
<Version>1.0.2</Version>

Microsoft.Toolkit.HighPerformance/Enumerables/ReadOnlySpanEnumerable{T}.cs

Lines changed: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,94 +15,72 @@ namespace Microsoft.Toolkit.HighPerformance.Enumerables
1515
/// </summary>
1616
/// <typeparam name="T">The type of items to enumerate.</typeparam>
1717
[EditorBrowsable(EditorBrowsableState.Never)]
18-
public readonly ref struct ReadOnlySpanEnumerable<T>
18+
public ref struct ReadOnlySpanEnumerable<T>
1919
{
2020
/// <summary>
21-
/// The source <see cref="ReadOnlySpan{T}"/> instance
21+
/// The source <see cref="ReadOnlySpan{T}"/> instance.
2222
/// </summary>
2323
private readonly ReadOnlySpan<T> span;
2424

25+
/// <summary>
26+
/// The current index within <see cref="span"/>.
27+
/// </summary>
28+
private int index;
29+
2530
/// <summary>
2631
/// Initializes a new instance of the <see cref="ReadOnlySpanEnumerable{T}"/> struct.
2732
/// </summary>
28-
/// <param name="span">The source <see cref="ReadOnlySpan{T}"/> to enumerate.</param>
33+
/// <param name="span">The source <see cref="ReadOnlySpan{T}"/> instance.</param>
2934
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3035
public ReadOnlySpanEnumerable(ReadOnlySpan<T> span)
3136
{
3237
this.span = span;
38+
this.index = -1;
3339
}
3440

3541
/// <summary>
3642
/// Implements the duck-typed <see cref="IEnumerable{T}.GetEnumerator"/> method.
3743
/// </summary>
38-
/// <returns>An <see cref="Enumerator"/> instance targeting the current <see cref="ReadOnlySpan{T}"/> value.</returns>
44+
/// <returns>An <see cref="ReadOnlySpanEnumerable{T}"/> instance targeting the current <see cref="ReadOnlySpan{T}"/> value.</returns>
3945
[MethodImpl(MethodImplOptions.AggressiveInlining)]
40-
public Enumerator GetEnumerator() => new Enumerator(this.span);
46+
public ReadOnlySpanEnumerable<T> GetEnumerator() => this;
4147

4248
/// <summary>
43-
/// An enumerator for a source <see cref="ReadOnlySpan{T}"/> instance.
49+
/// Implements the duck-typed <see cref="System.Collections.IEnumerator.MoveNext"/> method.
4450
/// </summary>
45-
[EditorBrowsable(EditorBrowsableState.Never)]
46-
public ref struct Enumerator
51+
/// <returns><see langword="true"/> whether a new element is available, <see langword="false"/> otherwise</returns>
52+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
53+
public bool MoveNext()
4754
{
48-
/// <summary>
49-
/// The source <see cref="ReadOnlySpan{T}"/> instance.
50-
/// </summary>
51-
private readonly ReadOnlySpan<T> span;
52-
53-
/// <summary>
54-
/// The current index within <see cref="span"/>.
55-
/// </summary>
56-
private int index;
57-
58-
/// <summary>
59-
/// Initializes a new instance of the <see cref="Enumerator"/> struct.
60-
/// </summary>
61-
/// <param name="span">The source <see cref="ReadOnlySpan{T}"/> instance.</param>
62-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
63-
public Enumerator(ReadOnlySpan<T> span)
64-
{
65-
this.span = span;
66-
this.index = -1;
67-
}
55+
int newIndex = this.index + 1;
6856

69-
/// <summary>
70-
/// Implements the duck-typed <see cref="System.Collections.IEnumerator.MoveNext"/> method.
71-
/// </summary>
72-
/// <returns><see langword="true"/> whether a new element is available, <see langword="false"/> otherwise</returns>
73-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
74-
public bool MoveNext()
57+
if (newIndex < this.span.Length)
7558
{
76-
int newIndex = this.index + 1;
59+
this.index = newIndex;
7760

78-
if (newIndex < this.span.Length)
79-
{
80-
this.index = newIndex;
81-
82-
return true;
83-
}
84-
85-
return false;
61+
return true;
8662
}
8763

88-
/// <summary>
89-
/// Gets the duck-typed <see cref="IEnumerator{T}.Current"/> property.
90-
/// </summary>
91-
public Item Current
64+
return false;
65+
}
66+
67+
/// <summary>
68+
/// Gets the duck-typed <see cref="IEnumerator{T}.Current"/> property.
69+
/// </summary>
70+
public Item Current
71+
{
72+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
73+
get
9274
{
93-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
94-
get
95-
{
9675
#if SPAN_RUNTIME_SUPPORT
97-
ref T r0 = ref MemoryMarshal.GetReference(this.span);
98-
ref T ri = ref Unsafe.Add(ref r0, this.index);
76+
ref T r0 = ref MemoryMarshal.GetReference(this.span);
77+
ref T ri = ref Unsafe.Add(ref r0, this.index);
9978

100-
// See comment in SpanEnumerable<T> about this
101-
return new Item(ref ri, this.index);
79+
// See comment in SpanEnumerable<T> about this
80+
return new Item(ref ri, this.index);
10281
#else
103-
return new Item(this.span, this.index);
82+
return new Item(this.span, this.index);
10483
#endif
105-
}
10684
}
10785
}
10886

0 commit comments

Comments
 (0)