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

Modernize #343

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf

[*.{csproj,props}]
indent_style = space
tab_width = 2
indent_size = 2

[*.cs]

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.user
*.userosscache
*.sln.docstates
.idea/**/

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
34 changes: 34 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Jot" Version="2.1.17" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="XamlFlair.WPF" Version="1.2.13" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.13.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.146" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="DynamicData" Version="9.1.2" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="nunit" Version="4.2.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="Cake.Codecov" Version="3.0.0" />
<PackageVersion Include="Cake.Frosting" Version="5.0.0" />
<PackageVersion Include="Cake.GitVersioning" Version="3.6.146" />
<PackageVersion Include="Cake.Incubator" Version="8.0.0" />
<PackageVersion Include="Codecov" Version="1.13.0" />
<PackageVersion Include="GitVersion.CommandLine" Version="5.12.0" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.12.0" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.18.3" />
<PackageVersion Include="ReportGenerator" Version="5.4.1" />
</ItemGroup>
</Project>
42 changes: 21 additions & 21 deletions cake/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PackAsTool>true</PackAsTool>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<PackAsTool>true</PackAsTool>

<!-- Make sure start same folder .NET Core CLI and Visual Studio -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<!-- Make sure start same folder .NET Core CLI and Visual Studio -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Codecov" Version="1.0.1" />
<PackageReference Include="Cake.Frosting" Version="4.0.0" />
<PackageReference Include="Cake.GitVersioning" Version="3.6.133" />
<PackageReference Include="Cake.Incubator" Version="8.0.0" />
<PackageReference Include="Codecov" Version="1.13.0" />
<PackageReference Include="GitVersion.CommandLine" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeCoverage" Version="17.8.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.16.3" />
<PackageReference Include="ReportGenerator" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Codecov" />
<PackageReference Include="Cake.Frosting" />
<PackageReference Include="Cake.GitVersioning" />
<PackageReference Include="Cake.Incubator" />
<PackageReference Include="Codecov" />
<PackageReference Include="GitVersion.CommandLine">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeCoverage" />
<PackageReference Include="NUnit.ConsoleRunner" />
<PackageReference Include="ReportGenerator" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public static int Main(string[] args)
{
return new CakeHost()
.InstallTool(new Uri("nuget:?package=Codecov&version=1.13.0"))
.InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.16.3"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=5.2.0"))
.InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.18.3"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=5.4.1"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.12.0"))
.InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=17.8.0"))
.InstallTool(new Uri("nuget:?package=nuget.commandline&version=6.8.0"))
.InstallTool(new Uri("nuget:?package=nuget.commandline&version=6.12.1"))
.InstallTool(new Uri("nuget:?package=dotnet-coverage&version=17.13.1"))
.UseContext<BuildContext>()
.UseLifetime<BuildLifetime>()
.UseWorkingDirectory("..")
Expand Down
6 changes: 3 additions & 3 deletions cake/Tasks/CoberturaReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public sealed class CoberturaReport : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.MergeReports("./Results/coverage/**/*.xml", ReportGeneratorReportType.Cobertura, "cobertura");
context.MergeReports("./results/coverage/**/*.xml", ReportGeneratorReportType.Cobertura, "cobertura");
}

public override bool ShouldRun(BuildContext context)
{
return base.ShouldRun(context)
&& context.GetFiles("./Results/coverage/**/*.xml").Count > 0;
var files = context.GetFiles("./results/coverage/**/*.xml");
return files.Count > 0;
}
}
}
16 changes: 10 additions & 6 deletions cake/Tasks/ConvertCoverage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,31 @@ public sealed class ConvertCoverage : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
var dotnetExe = context.Tools.Resolve("dotnet.exe");
var codeCoverageExe = context.Tools.Resolve("dotnet-coverage.dll");

foreach (var file in context.GetFiles($"{context.ResultsPath.FullPath}/coverage/**/*.coverage"))
{
var codeCoverageExe = context.Tools.Resolve("CodeCoverage.exe");
var result = System.IO.Path.ChangeExtension(file.FullPath, ".xml");

var settings = new ProcessSettings()
.UseWorkingDirectory(context.ResultsPath)
.WithArguments(builder => builder
.Append("analyze")
.AppendSwitchQuoted(@"-output", ":", result)
.AppendQuoted(codeCoverageExe.FullPath)
.Append("merge")
.Append("--remove-input-files")
.AppendSwitchQuoted(@"--output", " ", result)
.AppendSwitch("--output-format", "xml")
.Append(file.FullPath)
);

context.StartProcess(codeCoverageExe, settings);
context.StartProcess(dotnetExe.FullPath, settings);
}
}

public override bool ShouldRun(BuildContext context)
{
return base.ShouldRun(context)
&& context.Tools.Resolve("CodeCoverage.exe") != null;
return context.Tools.Resolve("dotnet-coverage.dll") != null;
}
}
}
4 changes: 1 addition & 3 deletions cake/Tasks/Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ namespace Build
[IsDependentOn(typeof(PushNuget))]
[IsDependentOn(typeof(PushGithub))]
[IsDependentOn(typeof(PushLocally))]
public sealed class Default : FrostingTask<BuildContext>
{
}
public sealed class Default : FrostingTask<BuildContext>;
}
6 changes: 3 additions & 3 deletions cake/Tasks/HtmlReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public sealed class HtmlReport : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.MergeReports("./Results/coverage/**/*.xml", ReportGeneratorReportType.Html, "html");
context.MergeReports("./results/coverage/**/*.xml", ReportGeneratorReportType.Html, "html");
}

public override bool ShouldRun(BuildContext context)
{
return base.ShouldRun(context)
&& context.GetFiles("./Results/coverage/**/*.xml").Count > 0;
var files = context.GetFiles("./results/coverage/**/*.xml");
return files.Count > 0;
}
}
}
4 changes: 1 addition & 3 deletions cake/Tasks/TestAndUploadReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ namespace Build
{
[IsDependentOn(typeof(HtmlReport))]
[IsDependentOn(typeof(UploadCodecovReport))]
public sealed class TestAndUploadReport : FrostingTask<BuildContext>
{
}
public sealed class TestAndUploadReport : FrostingTask<BuildContext>;
}
5 changes: 0 additions & 5 deletions cake/Tasks/UploadCodecovReport.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Cake.Codecov;
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Core;
using Cake.Frosting;

namespace Build
Expand All @@ -15,10 +12,8 @@ public override void Run(BuildContext context)
{
var settings = new CodecovSettings()
{
Required = true,
Verbose = true,
WorkingDirectory = context.CoberturaResultsPath,
DisableNetwork = true,
Files = new[] { context.CoberturaResultFile.FullPath },
Token = context.EnvironmentVariable("CODECOV_TOKEN"),
};
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.300",
"version": "9.0.101",
"rollForward": "disable"
}
}
17 changes: 12 additions & 5 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
4 changes: 2 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<PropertyGroup>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<LangVersion>12.0</LangVersion>
<LangVersion>13</LangVersion>
<CodeAnalysisRuleSet>..\..\MvvmScarletToolkit.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup Condition=" '$(Configuration)'=='Debug' ">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.3">
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<Description>MvvmScarletToolkit.Abstractions is part of the MvvmScarletToolkit framework, containing interfaces and extensions used by the rest of the framework.</Description>
<PackageTags>MvvmScarletToolkit,MVVM,C#,Toolkit,Scarlet,Library,.NET,OSS,OpenSource</PackageTags>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<Description>MvvmScarletToolkit.Abstractions is part of the MvvmScarletToolkit framework, containing interfaces and extensions used by the rest of the framework.</Description>
<PackageTags>MvvmScarletToolkit,MVVM,C#,Toolkit,Scarlet,Library,.NET,OSS,OpenSource</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
42 changes: 21 additions & 21 deletions src/MvvmScarletToolkit.Commands/MvvmScarletToolkit.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<Description>MvvmScarletToolkit.Commands is part of the MvvmScarletToolkit framework, containing asynchrnous and synchronous implementations of the ICommand interface for .NET.</Description>
<PackageTags>MvvmScarletToolkit,MVVM,C#,Toolkit,Scarlet,Library,.NET,OSS,OpenSource</PackageTags>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<Description>MvvmScarletToolkit.Commands is part of the MvvmScarletToolkit framework, containing asynchrnous and synchronous implementations of the ICommand interface for .NET.</Description>
<PackageTags>MvvmScarletToolkit,MVVM,C#,Toolkit,Scarlet,Library,.NET,OSS,OpenSource</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" />

<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MvvmScarletToolkit.Abstractions\MvvmScarletToolkit.Abstractions.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvvmScarletToolkit.Abstractions\MvvmScarletToolkit.Abstractions.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
<OutputType>Library</OutputType>
<UseWPF>true</UseWPF>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0-windows;net9.0-windows</TargetFrameworks>
<OutputType>Library</OutputType>
<UseWPF>true</UseWPF>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DynamicData" Version="8.4.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="System.Drawing.Common" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DynamicData" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" />
<PackageReference Include="System.Drawing.Common" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MvvmScarletToolkit.Observables\MvvmScarletToolkit.Observables.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvvmScarletToolkit.Observables\MvvmScarletToolkit.Observables.csproj" />
</ItemGroup>
</Project>
Loading
Loading