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

Fix(mvux) set name tool generation version #2527

Merged
merged 1 commit into from
Aug 23, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
</PropertyGroup>

<ItemGroup>
<!--We need this version of the BindableGenerationTool for the Tests to run properly-->
<AssemblyAttribute Include="Uno.Extensions.Reactive.Config.BindableGenerationToolAttribute">
<_Parameter1>3</_Parameter1>
<_Parameter1_TypeName>System.Int32</_Parameter1_TypeName>
</AssemblyAttribute>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" /><!--For local usage we use the most recent version-->
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;

namespace Uno.Extensions.Reactive.Config;

Expand All @@ -9,9 +8,21 @@ namespace Uno.Extensions.Reactive.Config;
[AttributeUsage(AttributeTargets.Assembly)]
public class BindableGenerationToolAttribute : Attribute
{
// Latest version is 3, keeping version 2 as default for backward compatibility
private const int DefaultVersion = 2;

/// <summary>
/// Creates a new BindableGenerationTool object.
/// </summary>
/// <param name="version">The version of the tool to use when generating the bindables</param>
public BindableGenerationToolAttribute(int version = DefaultVersion)
{
Version = version;
}

/// <summary>
/// Gets or sets the version of tool that should be used to generate bindables.
/// </summary>
/// <remarks>Set this to 1 to use code gen used in Uno.Extensions.Reactive versions below 2.3</remarks>
public int Version { get; init; } = 3;
public int Version { get; init; }
}
Loading