Skip to content

Commit 49bf713

Browse files
authored
Update Make attributes internal to avoid conflicts (#60)
Make attributes internal to avoid conflicts
1 parent 1d5a316 commit 49bf713

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/ReactiveUI.SourceGenerators/Core/Helpers/AttributeDefinitions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace ReactiveUI.SourceGenerators;
3131
/// <seealso cref="System.Attribute" />
3232
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "1.1.0.0")]
3333
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
34-
public sealed class ReactiveObjectAttribute : Attribute;
34+
internal sealed class ReactiveObjectAttribute : Attribute;
3535
#nullable restore
3636
#pragma warning restore
3737
""";
@@ -56,7 +56,7 @@ namespace ReactiveUI.SourceGenerators;
5656
/// <seealso cref="Attribute" />
5757
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")]
5858
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
59-
public sealed class ReactiveCommandAttribute : Attribute
59+
internal sealed class ReactiveCommandAttribute : Attribute
6060
{
6161
/// <summary>
6262
/// Gets the can execute method or property.
@@ -90,7 +90,7 @@ namespace ReactiveUI.SourceGenerators;
9090
/// <seealso cref="Attribute" />
9191
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
9292
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
93-
public sealed class ReactiveAttribute : Attribute;
93+
internal sealed class ReactiveAttribute : Attribute;
9494
#nullable restore
9595
#pragma warning restore
9696
""";
@@ -115,7 +115,7 @@ namespace ReactiveUI.SourceGenerators;
115115
/// <seealso cref="Attribute" />
116116
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
117117
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
118-
public sealed class ObservableAsPropertyAttribute : Attribute
118+
internal sealed class ObservableAsPropertyAttribute : Attribute
119119
{
120120
/// <summary>
121121
/// Gets the name of the property.
@@ -153,7 +153,7 @@ namespace ReactiveUI.SourceGenerators;
153153
/// <param name="viewModelType">Type of the view model.</param>
154154
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "1.1.0.0")]
155155
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
156-
public sealed class IViewForAttribute(string? viewModelType) : Attribute;
156+
internal sealed class IViewForAttribute(string? viewModelType) : Attribute;
157157
#nullable restore
158158
#pragma warning restore
159159
""";
@@ -182,7 +182,7 @@ namespace ReactiveUI.SourceGenerators.WinForms;
182182
/// <param name="viewModelType">Type of the view model.</param>
183183
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ViewModelControlHostGenerator", "1.1.0.0")]
184184
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
185-
public sealed class ViewModelControlHostAttribute(string? baseType) : Attribute;
185+
internal sealed class ViewModelControlHostAttribute(string? baseType) : Attribute;
186186
#nullable restore
187187
#pragma warning restore
188188
""";
@@ -211,7 +211,7 @@ namespace ReactiveUI.SourceGenerators.WinForms;
211211
/// <param name="viewModelType">Type of the view model.</param>
212212
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.RoutedControlHostGenerator", "1.1.0.0")]
213213
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
214-
public sealed class RoutedControlHostAttribute(string? baseType) : Attribute;
214+
internal sealed class RoutedControlHostAttribute(string? baseType) : Attribute;
215215
#nullable restore
216216
#pragma warning restore
217217
""";

src/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
<PrivateAssets>all</PrivateAssets>
3838
<IncludeAssets>build; analyzers</IncludeAssets>
3939
</PackageReference>
40-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
41-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
42-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" />
40+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" PrivateAssets="all" />
41+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
42+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
4343
</ItemGroup>
4444

4545
<!-- This ensures the library will be packaged as a source generator when we use `dotnet pack` -->

0 commit comments

Comments
 (0)