Skip to content

Commit ba197d4

Browse files
authored
Fix Global Usings One Per Project (#3648)
Issues with a single file where invalid usings exist. <!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Fix **What is the current behavior?** <!-- You can also link to an open issue here. --> A single GlobalUsing file is used **What is the new behavior?** <!-- If this is a feature change --> Multiple GlobalUsing files are used to remove the issue where usings are included that are invalid for some projects **What might this PR break?** none expected **Please check if the PR fulfills these requirements** - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**:
1 parent 0a61f2a commit ba197d4

File tree

113 files changed

+331
-221
lines changed

Some content is hidden

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

113 files changed

+331
-221
lines changed

src/Directory.build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath="\" />
7171
</ItemGroup>
7272

73-
<ItemGroup Condition="$(MSBuildProjectName.Contains('Fody')) != 'true'">
74-
<Compile Include="$(MSBuildThisFileDirectory)GlobalUsings.cs" />
75-
</ItemGroup>
76-
7773
<ItemGroup>
7874
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
7975
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::Splat;
7+
global using global::System;
8+
global using global::System.Collections.Generic;
9+
global using global::System.ComponentModel;
10+
global using global::System.Diagnostics.CodeAnalysis;
11+
global using global::System.Linq;
12+
global using global::System.Reactive;
13+
global using global::System.Reactive.Linq;
14+
global using global::System.Reactive.Subjects;
15+
global using global::System.Reactive.Threading.Tasks;
16+
global using global::System.Threading.Tasks;

src/ReactiveUI.AndroidSupport/ReactiveAppCompatActivity.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.App;
107
using Android.Content;
118
using Android.Runtime;
@@ -194,4 +191,4 @@ protected override void Dispose(bool disposing)
194191

195192
base.Dispose(disposing);
196193
}
197-
}
194+
}

src/ReactiveUI.AndroidSupport/ReactiveDialogFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
namespace ReactiveUI.AndroidSupport;
107

118
/// <summary>

src/ReactiveUI.AndroidSupport/ReactiveFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
namespace ReactiveUI.AndroidSupport;
107

118
/// <summary>

src/ReactiveUI.AndroidSupport/ReactiveFragmentActivity.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.App;
107
using Android.Content;
118
using Android.Support.V4.App;

src/ReactiveUI.AndroidSupport/ReactivePagerAdapter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System.Collections.Specialized;
7-
using System.Diagnostics.CodeAnalysis;
87

98
using Android.Support.V4.View;
109
using Android.Views;

src/ReactiveUI.AndroidSupport/ReactivePreferenceFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.Runtime;
107
using Android.Support.V7.Preferences;
118

src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewAdapter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System.Collections.Specialized;
7-
using System.Diagnostics.CodeAnalysis;
87

98
using Android.Support.V7.Widget;
109
using Android.Views;

src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewViewHolder.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
86
using System.Reflection;
97
using System.Runtime.Serialization;
108

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::Splat;
7+
global using global::System;
8+
global using global::System.Collections.Generic;
9+
global using global::System.ComponentModel;
10+
global using global::System.Diagnostics.CodeAnalysis;
11+
global using global::System.Linq;
12+
global using global::System.Reactive;
13+
global using global::System.Reactive.Linq;
14+
global using global::System.Reactive.Subjects;
15+
global using global::System.Reactive.Threading.Tasks;
16+
global using global::System.Threading.Tasks;

src/ReactiveUI.AndroidX/ReactiveAppCompatActivity.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.App;
107
using Android.Content;
118
using Android.Runtime;
@@ -196,4 +193,4 @@ protected override void Dispose(bool disposing)
196193

197194
base.Dispose(disposing);
198195
}
199-
}
196+
}

src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
namespace ReactiveUI.AndroidX;
107

118
/// <summary>

src/ReactiveUI.AndroidX/ReactiveFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
namespace ReactiveUI.AndroidX;
107

118
/// <summary>

src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.App;
107
using Android.Content;
118

src/ReactiveUI.AndroidX/ReactivePagerAdapter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System.Collections.Specialized;
7-
using System.Diagnostics.CodeAnalysis;
87

98
using Android.Views;
109

src/ReactiveUI.AndroidX/ReactivePreferenceFragment.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
8-
96
using Android.Runtime;
107

118
using AndroidX.Preference;

src/ReactiveUI.AndroidX/ReactiveRecyclerViewAdapter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System.Collections.Specialized;
7-
using System.Diagnostics.CodeAnalysis;
87

98
using AndroidX.RecyclerView.Widget;
109

src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
86
using System.Reflection;
97
using System.Runtime.Serialization;
108

src/ReactiveUI.Blazor/GlobalUsings.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::System;
7+
global using global::System.Collections.Generic;
8+
global using global::System.ComponentModel;
9+
global using global::System.Diagnostics.CodeAnalysis;
10+
global using global::System.Linq;
11+
global using global::System.Reactive;
12+
global using global::System.Reactive.Concurrency;
13+
global using global::System.Reactive.Disposables;
14+
global using global::System.Reactive.Linq;
15+
global using global::System.Reactive.Subjects;

src/ReactiveUI.Blazor/ReactiveComponentBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
86
using System.Runtime.CompilerServices;
97

108
using Microsoft.AspNetCore.Components;
@@ -134,4 +132,4 @@ protected virtual void Dispose(bool disposing)
134132
_disposedValue = true;
135133
}
136134
}
137-
}
135+
}

src/ReactiveUI.Blazor/ReactiveInjectableComponentBase.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
7-
using System.Diagnostics.CodeAnalysis;
86
using System.Runtime.CompilerServices;
97

108
using Microsoft.AspNetCore.Components;

src/ReactiveUI.Blazor/ReactiveLayoutComponentBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.ComponentModel;
76
using System.Runtime.CompilerServices;
87

98
using Microsoft.AspNetCore.Components;

src/ReactiveUI.Blend/GlobalUsings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::System;
7+
global using global::System.Reactive.Linq;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::Splat;
7+
global using global::System;

src/ReactiveUI.Maui/GlobalUsings.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::Splat;
7+
global using global::System;
8+
global using global::System.ComponentModel;
9+
global using global::System.Linq;
10+
global using global::System.Linq.Expressions;
11+
global using global::System.Reactive;
12+
global using global::System.Reactive.Concurrency;
13+
global using global::System.Reactive.Disposables;
14+
global using global::System.Reactive.Linq;
15+
global using global::System.Reactive.Subjects;
16+
global using global::System.Threading;
17+
global using global::System.Threading.Tasks;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::Splat;
7+
global using global::System.Collections.Generic;
8+
global using global::System.Linq;
9+
global using global::System.Reactive.Linq;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::System;
7+
global using global::System.Collections.Generic;
8+
global using global::System.Reactive;
9+
global using global::System.Reactive.Linq;
10+
global using global::System.Reactive.Subjects;
11+
global using global::System.Threading.Tasks;

src/ReactiveUI.Testing.Tests/TestFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.Diagnostics.CodeAnalysis;
7-
86
namespace ReactiveUI.Testing.Tests
97
{
108
/// <summary>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2023 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
global using global::System;
7+
global using global::System.Collections.Generic;
8+
global using global::System.Reactive;
9+
global using global::System.Reactive.Concurrency;
10+
global using global::System.Reactive.Disposables;
11+
global using global::System.Threading;
12+
global using global::System.Threading.Tasks;

src/ReactiveUI.Tests/API/ApiApprovalTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using System.Diagnostics.CodeAnalysis;
7-
86
using VerifyXunit;
97

10-
using Xunit;
11-
128
namespace ReactiveUI.Tests.API
139
{
1410
/// <summary>

src/ReactiveUI.Tests/Activation/ActivatingViewModelTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using Xunit;
7-
86
namespace ReactiveUI.Tests
97
{
108
/// <summary>

src/ReactiveUI.Tests/Activation/ActivatingViewTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
using Xunit;
7-
86
namespace ReactiveUI.Tests
97
{
108
/// <summary>

src/ReactiveUI.Tests/Activation/CanActivateViewFetcherTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
using ReactiveUI.Tests.Winforms;
99

10-
using Xunit;
11-
1210
namespace ReactiveUI.Tests
1311
{
1412
/// <summary>

src/ReactiveUI.Tests/Activation/ViewModelActivatorTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
using DynamicData;
77

8-
using Xunit;
9-
108
namespace ReactiveUI.Tests
119
{
1210
/// <summary>

src/ReactiveUI.Tests/AutoPersist/AutoPersistCollectionTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
using ReactiveUI.Testing;
1111

12-
using Xunit;
13-
1412
namespace ReactiveUI.Tests
1513
{
1614
/// <summary>

0 commit comments

Comments
 (0)