Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Date, Fix T4 code to match current source in T4 templates #233

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
fetch-depth: 0
lfs: true

- name: Install .NET 6
- name: Install .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
dotnet-version: |
6.0.x
7.0.x

- uses: nuget/setup-nuget@v1
name: Setup NuGet
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ jobs:
fetch-depth: 0
lfs: true

- name: Install .NET 6
- name: Install .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
include-prerelease: true
dotnet-version: |
6.0.x
7.0.x

- uses: nuget/setup-nuget@v1
name: Setup NuGet
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\"/>
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
Expand All @@ -51,7 +52,6 @@
<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
Expand Down
37 changes: 18 additions & 19 deletions src/ReactiveMarbles.PropertyChanged.Benchmarks/BindBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
// Copyright (c) 2019-2023 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
// <auto-generated />

using System;

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;

using ReactiveMarbles.PropertyChanged.Benchmarks.Moqs;

using New = ReactiveMarbles.PropertyChanged.BindExtensions;
using Old = ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions;
using UI = ReactiveUI.PropertyBindingMixins;
using Old = ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions;
using New = ReactiveMarbles.PropertyChanged.BindExtensions;

namespace ReactiveMarbles.PropertyChanged.Benchmarks
{
/// <summary>
/// Benchmarks for binding.
/// </summary>
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[SimpleJob(RuntimeMoniker.Net60)]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
Expand Down Expand Up @@ -59,11 +58,11 @@ public void Depth3Setup()
public void PerformMutations(int depth)
{
// We loop through the changes, alternating mutations to the source and destination at every depth.
int d2 = depth * 2;
for (int i = 0; i < Changes; ++i)
var d2 = depth * 2;
for (var i = 0; i < Changes; ++i)
{
int a = i % d2;
TestClass t = (a % 2) > 0 ? _to : _from;
var a = i % d2;
var t = (a % 2) > 0 ? _to : _from;
t.Mutate(a / 2);
}
}
Expand All @@ -72,71 +71,71 @@ public void PerformMutations(int depth)
[Benchmark(Baseline = true)]
public void BindAndChange_Depth1_UI()
{
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Value, x => x.Value);
using var binding = UI.Bind(_from, _to, x => x.Value, x => x.Value);
PerformMutations(1);
}

[BenchmarkCategory("Bind and Change Depth 1")]
[Benchmark]
public void BindAndChange_Depth1_Old()
{
using IDisposable binding = Old.Bind(_from, _to, x => x.Value, x => x.Value);
using var binding = Old.Bind(_from, _to, x => x.Value, x => x.Value);
PerformMutations(1);
}

[BenchmarkCategory("Bind and Change Depth 1")]
[Benchmark]
public void BindAndChange_Depth1_New()
{
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Value, x => x.Value);
using var binding = New.BindTwoWay(_from, _to, x => x.Value, x => x.Value);
PerformMutations(1);
}

[BenchmarkCategory("Bind and Change Depth 2")]
[Benchmark(Baseline = true)]
public void BindAndChange_Depth2_UI()
{
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
using var binding = UI.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
PerformMutations(2);
}

[BenchmarkCategory("Bind and Change Depth 2")]
[Benchmark]
public void BindAndChange_Depth2_Old()
{
using IDisposable binding = Old.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
using var binding = Old.Bind(_from, _to, x => x.Child.Value, x => x.Child.Value);
PerformMutations(2);
}

[BenchmarkCategory("Bind and Change Depth 2")]
[Benchmark]
public void BindAndChange_Depth2_New()
{
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Child.Value, x => x.Child.Value);
using var binding = New.BindTwoWay(_from, _to, x => x.Child.Value, x => x.Child.Value);
PerformMutations(2);
}

[BenchmarkCategory("Bind and Change Depth 3")]
[Benchmark(Baseline = true)]
public void BindAndChange_Depth3_UI()
{
using ReactiveUI.IReactiveBinding<TestClass, (object view, bool isViewModel)> binding = UI.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
using var binding = UI.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
PerformMutations(3);
}

[BenchmarkCategory("Bind and Change Depth 3")]
[Benchmark]
public void BindAndChange_Depth3_Old()
{
using IDisposable binding = Old.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
using var binding = Old.Bind(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
PerformMutations(3);
}

[BenchmarkCategory("Bind and Change Depth 3")]
[Benchmark]
public void BindAndChange_Depth3_New()
{
using IDisposable binding = New.BindTwoWay(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
using var binding = New.BindTwoWay(_from, _to, x => x.Child.Child.Value, x => x.Child.Child.Value);
PerformMutations(3);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<#@ assembly name="System.Collections.dll" #>
<#@ import namespace="System.Linq" #>
<#@ output extension=".cs" #>
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
// Copyright (c) 2019-<#=DateTime.Now.Year#> ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
// <auto-generated />

using System;
using BenchmarkDotNet.Attributes;
Expand All @@ -19,7 +20,7 @@ var participants = new (string Alias, string MethodName, string FullClassName)[]
{
("UI", "Bind", "ReactiveUI.PropertyBindingMixins"),
("Old", "Bind", "ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.BindExtensions"),
("New", "Bind", "ReactiveMarbles.PropertyChanged.BindExtensions"),
("New", "BindTwoWay", "ReactiveMarbles.PropertyChanged.BindExtensions"),
};
var depths = new[] { 1, 2, 3 };
const string BindAndChange = "BindAndChange";
Expand All @@ -37,7 +38,7 @@ namespace ReactiveMarbles.PropertyChanged.Benchmarks
/// <summary>
/// Benchmarks for binding.
/// </summary>
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[SimpleJob(RuntimeMoniker.Net60)]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.3" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Include="reactiveui" Version="18.*" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// Copyright (c) 2019-2021 ReactiveUI Association Incorporated. All rights reserved.
// Copyright (c) 2019-2023 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
// <auto-generated />

using System;

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;

using ReactiveMarbles.PropertyChanged.Benchmarks.Moqs;

using SourceGen = NotifyPropertyExtensions;
using SourceGen = ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions;

namespace ReactiveMarbles.PropertyChanged.Benchmarks
{
/// <summary>
/// Benchmarks for the property changed.
/// </summary>
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[SimpleJob(RuntimeMoniker.Net60)]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
Expand Down Expand Up @@ -54,7 +53,7 @@ public void Depth3Setup()
public void PerformMutations(int depth)
{
// We loop through the changes, creating mutations at every depth.
for (int i = 0; i < Changes; ++i)
for (var i = 0; i < Changes; ++i)
{
_from.Mutate(i % depth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<#@ assembly name="System.Collections.dll" #>
<#@ import namespace="System.Linq" #>
<#@ output extension=".cs" #>
// Copyright (c) 2019-2020 ReactiveUI Association Incorporated. All rights reserved.
// Copyright (c) 2019-<#=DateTime.Now.Year#> ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
// <auto-generated />

using System;
using BenchmarkDotNet.Attributes;
Expand All @@ -20,7 +21,7 @@ var participants = new (string Alias, string MethodName, string FullClassName)[]
////("UI", "WhenAnyValue", "ReactiveUI.WhenAnyMixin"),
////("Old", "WhenChanged", "ReactiveMarbles.PropertyChanged.Benchmarks.Legacy.NotifyPropertyChangedExtensions"),
////("New", "WhenChanged", "ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions"),
("SourceGen", "WhenChanged", "NotifyPropertyChangedExtensions"),
("SourceGen", "WhenChanged", "ReactiveMarbles.PropertyChanged.NotifyPropertyChangedExtensions"),
};
var depths = new[] { 1, 2, 3 };
const string SubscribeAndChange = "SubscribeAndChange";
Expand All @@ -38,7 +39,7 @@ namespace ReactiveMarbles.PropertyChanged.Benchmarks
/// <summary>
/// Benchmarks for the property changed.
/// </summary>
[SimpleJob(RuntimeMoniker.NetCoreApp31)]
[SimpleJob(RuntimeMoniker.Net60)]
[MemoryDiagnoser]
[MarkdownExporterAttribute.GitHub]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.3" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.11.0" allowedVersions="[3.11.0]" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.11.0" allowedVersions="[3.11.0]" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" allowedVersions="[3.11.0]" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveMarbles.PropertyChanged.SourceGenerator.Builders\ReactiveMarbles.PropertyChanged.SourceGenerator.Builders.csproj" />
<ProjectReference Include="..\ReactiveMarbles.PropertyChanged.SourceGenerator\ReactiveMarbles.PropertyChanged.SourceGenerator.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReactiveMarbles.PropertyChanged.SourceGenerator.Builders\ReactiveMarbles.PropertyChanged.SourceGenerator.Builders.csproj" />
<ProjectReference Include="..\ReactiveMarbles.PropertyChanged.SourceGenerator\ReactiveMarbles.PropertyChanged.SourceGenerator.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="WhenChangedBenchmarks.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>WhenChangedBenchmarks.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Update="WhenChangedBenchmarks.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>WhenChangedBenchmarks.cs</LastGenOutput>
</None>
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

<ItemGroup>
<Compile Update="WhenAnyBenchmarks.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>WhenAnyBenchmarks.tt</DependentUpon>
</Compile>
<Compile Update="WhenChangedBenchmarks.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>WhenChangedBenchmarks.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="WhenAnyBenchmarks.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>WhenAnyBenchmarks.tt</DependentUpon>
</Compile>
<Compile Update="WhenChangedBenchmarks.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>WhenChangedBenchmarks.tt</DependentUpon>
</Compile>
</ItemGroup>

</Project>
Loading