diff --git a/Moq.sln b/Moq.sln index 32c66465d..5ce04bbd6 100644 --- a/Moq.sln +++ b/Moq.sln @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution CONTRIBUTING.md = CONTRIBUTING.md src\Directory.props = src\Directory.props License.txt = License.txt + .github\workflows\publish.yml = .github\workflows\publish.yml readme.md = readme.md EndProjectSection EndProject @@ -21,6 +22,8 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Moq.Tests.VisualBasic", "sr EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Moq.Tests.FSharpTypes", "src\Moq.Tests.FSharpTypes\Moq.Tests.FSharpTypes.fsproj", "{2D9EE4E0-8433-4F9C-A330-C4D74B956E0B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moq.CodeAnalysis", "src\Moq.CodeAnalysis\Moq.CodeAnalysis.csproj", "{FB06ED30-2AFD-44AF-A378-99C8B13BF29D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,6 +64,14 @@ Global {2D9EE4E0-8433-4F9C-A330-C4D74B956E0B}.Release|Any CPU.Build.0 = Release|Any CPU {2D9EE4E0-8433-4F9C-A330-C4D74B956E0B}.Release|x86.ActiveCfg = Release|Any CPU {2D9EE4E0-8433-4F9C-A330-C4D74B956E0B}.Release|x86.Build.0 = Release|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Debug|x86.Build.0 = Debug|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Release|Any CPU.Build.0 = Release|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Release|x86.ActiveCfg = Release|Any CPU + {FB06ED30-2AFD-44AF-A378-99C8B13BF29D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Moq.CodeAnalysis/Moq.CodeAnalysis.csproj b/src/Moq.CodeAnalysis/Moq.CodeAnalysis.csproj new file mode 100644 index 000000000..c9a0b3c98 --- /dev/null +++ b/src/Moq.CodeAnalysis/Moq.CodeAnalysis.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + analyzers/dotnet/roslyn4.0 + false + true + + + + + + + + + + \ No newline at end of file diff --git a/src/Moq.CodeAnalysis/Properties/Resources.es.resx b/src/Moq.CodeAnalysis/Properties/Resources.es.resx new file mode 100644 index 000000000..16d828456 --- /dev/null +++ b/src/Moq.CodeAnalysis/Properties/Resources.es.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Gracias desde Argentina con 💟! + + + Tu patrocinio ayudará al desarrollo de un Moq incluso mejor para todos! + + \ No newline at end of file diff --git a/src/Moq.CodeAnalysis/Properties/Resources.resx b/src/Moq.CodeAnalysis/Properties/Resources.resx new file mode 100644 index 000000000..5d50b54dd --- /dev/null +++ b/src/Moq.CodeAnalysis/Properties/Resources.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Thank you from Argentina with 💟! + + + Your sponsorship will help fund the development of an even greater Moq for all! + + \ No newline at end of file diff --git a/src/Moq.CodeAnalysis/SponsorLinker.cs b/src/Moq.CodeAnalysis/SponsorLinker.cs new file mode 100644 index 000000000..b7edf245d --- /dev/null +++ b/src/Moq.CodeAnalysis/SponsorLinker.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Immutable; +using System.Linq; +using Devlooped; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace Moq; + +[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic, LanguageNames.FSharp)] +class SponsorLinker : SponsorLink +{ + static readonly SponsorLinkSettings settings; + + static SponsorLinker() + { + settings = SponsorLinkSettings.Create("devlooped", "Moq", + version: new Version(ThisAssembly.Info.Version).ToString(3), + diagnosticsIdPrefix: "MOQ" +#if DEBUG + , quietDays: 0 +#endif + ); + + settings.SupportedDiagnostics = settings.SupportedDiagnostics + .Select(x => x.IsKind(DiagnosticKind.UserNotSponsoring) ? + x.With(messageFormat: Properties.Resources.UserNotSponsoring_Message) : + x) + .Select(x => x.IsKind(DiagnosticKind.Thanks) ? + x.With(messageFormat: Properties.Resources.Thanks_Message) : + x) + .ToImmutableArray(); + } + + public SponsorLinker() : base(settings) { } +} \ No newline at end of file diff --git a/src/Moq/Moq.csproj b/src/Moq/Moq.csproj index cef6a6caa..77f00ed2f 100644 --- a/src/Moq/Moq.csproj +++ b/src/Moq/Moq.csproj @@ -110,4 +110,8 @@ + + + +