Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 30, 2024
1 parent 5451fe3 commit 0587d20
Show file tree
Hide file tree
Showing 47 changed files with 43 additions and 179 deletions.
2 changes: 0 additions & 2 deletions Fody/AssemblyPathValidator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.IO;

public partial class Processor
{
public virtual void ValidateAssemblyPath()
Expand Down
4 changes: 0 additions & 4 deletions Fody/BuildLogger.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using Fody;
using Microsoft.Build.Framework;

public class BuildLogger :
MarshalByRefObject,
ILogger
Expand Down
9 changes: 1 addition & 8 deletions Fody/ConfigFileFinder/ConfigFileFinder.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

public static class ConfigFileFinder
public static class ConfigFileFinder
{
const string FodyWeaversConfigFileName = "FodyWeavers.xml";
static readonly XNamespace schemaNamespace = XNamespace.Get("http://www.w3.org/2001/XMLSchema");
Expand Down
4 changes: 1 addition & 3 deletions Fody/ConfigFileFinder/WeaverConfigFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Xml.Linq;

public class WeaverConfigFile
public class WeaverConfigFile
{
public readonly bool AllowExtraEntries;
public readonly string? FilePath;
Expand Down
4 changes: 0 additions & 4 deletions Fody/DomainAssemblyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Linq;
using System.Reflection;

public static class DomainAssemblyResolver
{
public static void Connect() =>
Expand Down
2 changes: 0 additions & 2 deletions Fody/ExceptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

public static class ExceptionExtensions
{
public static void LogException(this ILogger logger, Exception exception)
Expand Down
3 changes: 0 additions & 3 deletions Fody/ExtractConstants.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Collections.Generic;
using System.Linq;

static class ExtractConstants
{
internal static List<string> GetConstants(this string? input)
Expand Down
15 changes: 15 additions & 0 deletions Fody/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Global using directives

global using System;
global using System.Diagnostics;
global using System.Diagnostics.CodeAnalysis;
global using System.Reflection;
global using System.Text.RegularExpressions;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Xml;
global using System.Xml.Linq;
global using Fody;
global using Microsoft.Build.Framework;
global using Microsoft.Build.Utilities;
5 changes: 0 additions & 5 deletions Fody/Processor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

public partial class Processor
{
public string AssemblyFilePath = null!;
Expand Down
2 changes: 0 additions & 2 deletions Fody/ProjectPathFinder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.IO;

public partial class Processor
{
public virtual void ValidateProjectPath()
Expand Down
2 changes: 0 additions & 2 deletions Fody/SolutionDirectoryFinder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.IO;

public class SolutionDirectoryFinder
{
public static string Find(string? solutionDir, string? nCrunchOriginalSolutionDir, string projectDirectory)
Expand Down
2 changes: 0 additions & 2 deletions Fody/SolutionPathValidator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.IO;

public partial class Processor
{
public virtual void ValidateSolutionPath()
Expand Down
7 changes: 0 additions & 7 deletions Fody/UpdateReferenceCopyLocalTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Fody;

public class UpdateCopyLocalTask : Task
Expand Down
9 changes: 1 addition & 8 deletions Fody/Verify/Verifier.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Fody;

public class Verifier
public class Verifier
{
public ILogger Logger = null!;
public string SolutionDirectory = null!;
Expand Down
3 changes: 0 additions & 3 deletions Fody/Verify/VerifyTask.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Fody;

public class VerifyTask :
Expand Down
4 changes: 0 additions & 4 deletions Fody/WeaversHistory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;

public static class WeaversHistory
{
public static Dictionary<string, DateTime> TimeStamps = new(StringComparer.OrdinalIgnoreCase);
Expand Down
11 changes: 2 additions & 9 deletions Fody/WeavingException.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
using System;

class WeavingException : Exception
{
public WeavingException(string message)
: base(message)
{
}
}
class WeavingException(string message) :
Exception(message);
7 changes: 0 additions & 7 deletions Fody/WeavingTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Fody;

public class WeavingTask :
Expand Down
5 changes: 0 additions & 5 deletions Fody/XmlExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

public static class XmlExtensions
{
public static void StripNamespace(this XDocument document)
Expand Down
8 changes: 1 addition & 7 deletions FodyHelpers/BaseModuleWeaver.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Xml.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Fody;
namespace Fody;

/// <summary>
/// Base class for module weavers.
Expand Down
4 changes: 0 additions & 4 deletions FodyHelpers/CecilExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Fody;

public static class CecilExtensions
Expand Down
2 changes: 0 additions & 2 deletions FodyHelpers/ConfigReader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Xml;
using System.Xml.Linq;
using Fody;

static class ConfigReader
{
Expand Down
14 changes: 13 additions & 1 deletion FodyHelpers/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Global using directives

global using System;
global using System.CodeDom.Compiler;
global using System.Diagnostics;
global using System.IO;
global using System.CodeDom.Compiler;
global using System.Collections.Generic;
global using System.Linq;
global using Fody;
global using Mono.Cecil;
global using Mono.Cecil.Cil;
global using System.Text.RegularExpressions;
global using System.Diagnostics.CodeAnalysis;
global using System.Reflection;
global using System.Text;
global using System.Xml.Linq;
3 changes: 0 additions & 3 deletions FodyHelpers/Guard.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.IO;

namespace Fody;

[Obsolete("Not for public use")]
Expand Down
4 changes: 1 addition & 3 deletions FodyHelpers/MessageImportance.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace Fody;
namespace Fody;

/// <summary>
/// Abstraction for the MSBuild MessageImportance.
Expand Down
6 changes: 0 additions & 6 deletions FodyHelpers/ReferenceCleaner.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Fody;
using Mono.Cecil;

static class ReferenceCleaner
{
public static void CleanReferences(ModuleDefinition module, BaseModuleWeaver weaver, List<string> referenceCopyLocalPaths, List<string> runtimeCopyLocalPaths, Action<string> log)
Expand Down
2 changes: 0 additions & 2 deletions FodyHelpers/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Text;

static class StringExtensions
{
public static string ReplaceCaseless(this string str, string oldValue, string newValue)
Expand Down
3 changes: 0 additions & 3 deletions FodyHelpers/Testing/Ildasm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Diagnostics;
using System.Text;

namespace Fody;

/// <summary>
Expand Down
9 changes: 1 addition & 8 deletions FodyHelpers/Testing/PeVerifier.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;

namespace Fody;
namespace Fody;

/// <summary>
/// Verifies assemblies using peverify.exe.
Expand Down
8 changes: 1 addition & 7 deletions FodyHelpers/Testing/SdkToolFinder.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;

static class SdkToolFinder
static class SdkToolFinder
{
static string windowsSdkDirectory;

Expand Down
2 changes: 0 additions & 2 deletions FodyHelpers/Testing/SequencePointMessage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Mono.Cecil.Cil;

namespace Fody;

/// <summary>
Expand Down
11 changes: 2 additions & 9 deletions FodyHelpers/Testing/SymbolReaderProvider.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using System.IO;
using Mono.Cecil;
using Mono.Cecil.Cil;

class SymbolReaderProvider : ISymbolReaderProvider
class SymbolReaderProvider : ISymbolReaderProvider
{
DefaultSymbolReaderProvider inner;

public SymbolReaderProvider() =>
inner = new(false);
DefaultSymbolReaderProvider inner = new(false);

public ISymbolReader? GetSymbolReader(ModuleDefinition module, string fileName)
{
Expand Down
6 changes: 0 additions & 6 deletions FodyHelpers/Testing/TestAssemblyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using Mono.Cecil;

namespace Fody;

/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions FodyHelpers/Testing/TestResult.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System.Collections.Generic;
using System.Reflection;
using Mono.Cecil.Cil;

namespace Fody;

/// <summary>
Expand Down
7 changes: 0 additions & 7 deletions FodyHelpers/Testing/WeaverTestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Fody;

/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions FodyHelpers/TryFindTypeFunc.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Mono.Cecil;

namespace Fody;
namespace Fody;

[Obsolete("No longer required as BaseModuleWeaver.TryFindType has been replace with BaseModuleWeaver.TryFindTypeDefinition", false)]
public delegate bool TryFindTypeFunc(string typeName, out TypeDefinition? type);
5 changes: 0 additions & 5 deletions FodyHelpers/TypeCache.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Mono.Cecil;

namespace Fody;

/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions FodyHelpers/TypeSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Mono.Cecil;

namespace Fody;
namespace Fody;

/// <summary>
/// Replacement for <see cref="ModuleDefinition.TypeSystem"/>.
Expand Down
2 changes: 0 additions & 2 deletions FodyHelpers/WeavingException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Mono.Cecil.Cil;

namespace Fody;

public class WeavingException :
Expand Down
4 changes: 1 addition & 3 deletions FodyIsolated/AssemblyExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Reflection;

static class AssemblyExtensions
static class AssemblyExtensions
{
public static string GetVersion(this Assembly assembly)
{
Expand Down
2 changes: 0 additions & 2 deletions FodyIsolated/AssemblyLoader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Reflection;

public partial class InnerWeaver
{
static Dictionary<string, Assembly> assemblies = new(StringComparer.OrdinalIgnoreCase);
Expand Down
1 change: 0 additions & 1 deletion FodyIsolated/DelegateBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq.Expressions;
using System.Reflection;

public static class DelegateBuilder
{
Expand Down
1 change: 0 additions & 1 deletion FodyIsolated/ExceptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Reflection;
using System.Text;

public static class ExceptionExtensions
Expand Down
2 changes: 0 additions & 2 deletions FodyIsolated/FodyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Reflection;

public static class FodyVersion
{
public static readonly Version Version = typeof(FodyVersion).Assembly.GetName().Version;
Expand Down

0 comments on commit 0587d20

Please sign in to comment.