Skip to content

Commit

Permalink
Merge pull request #140 from Insire/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Insire authored Apr 10, 2021
2 parents 6973b4f + 4702f49 commit 67a38dd
Show file tree
Hide file tree
Showing 54 changed files with 328 additions and 267 deletions.
52 changes: 26 additions & 26 deletions MvvmScarletToolkit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Abstract
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Wpf", "src\MvvmScarletToolkit.Wpf\MvvmScarletToolkit.Wpf.csproj", "{1B547A43-3DB6-48FD-AF9A-EC649B5C584F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Tests", "src\MvvmScarletToolkit.Tests\MvvmScarletToolkit.Tests.csproj", "{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Xamarin.Forms", "src\MvvmScarletToolkit.Xamarin.Forms\MvvmScarletToolkit.Xamarin.Forms.csproj", "{CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E302CFE9-12CC-4732-9CAF-3F2377667DBC}"
Expand All @@ -44,6 +42,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmScarletToolkit.Xamarin.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmScarletToolkit.Xamarin.Forms.Samples.UWP", "src\MvvmScarletToolkit.Xamarin.Forms.Samples.UWP\MvvmScarletToolkit.Xamarin.Forms.Samples.UWP.csproj", "{2F1A97EB-D918-49BB-8A6C-81A1EFA16611}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Wpf.Tests", "src\MvvmScarletToolkit.Wpf.Tests\MvvmScarletToolkit.Wpf.Tests.csproj", "{A9CE017F-B4C9-40DC-A092-DC5067956994}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -228,30 +228,6 @@ Global
{1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x64.Build.0 = Release|Any CPU
{1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x86.ActiveCfg = Release|Any CPU
{1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x86.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|ARM.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhone.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x64.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x64.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x86.ActiveCfg = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x86.Build.0 = Debug|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|Any CPU.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|ARM.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|ARM.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhone.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhone.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x64.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x64.Build.0 = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x86.ActiveCfg = Release|Any CPU
{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x86.Build.0 = Release|Any CPU
{CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|ARM.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -376,6 +352,30 @@ Global
{2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.ActiveCfg = Release|x86
{2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.Build.0 = Release|x86
{2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.Deploy.0 = Release|x86
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|ARM.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhone.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x64.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x64.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x86.ActiveCfg = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x86.Build.0 = Debug|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|Any CPU.Build.0 = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|ARM.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|ARM.Build.0 = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhone.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhone.Build.0 = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x64.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x64.Build.0 = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x86.ActiveCfg = Release|Any CPU
{A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion build.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
DOTNET_VERSION=3.1.402
DOTNET_VERSION=5.0.202
8 changes: 4 additions & 4 deletions cake/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Codecov" Version="1.0.0" />
<PackageReference Include="Cake.Codecov" Version="1.0.1" />
<PackageReference Include="Cake.Frosting" Version="1.1.0" />
<PackageReference Include="Cake.GitVersioning" Version="3.4.165-alpha" />
<PackageReference Include="Cake.GitVersioning" Version="3.4.194" />
<PackageReference Include="Cake.Incubator" Version="6.0.0" />
<PackageReference Include="Codecov" Version="1.13.0" />
<PackageReference Include="GitVersion.CommandLine" Version="5.6.6">
<PackageReference Include="GitVersion.CommandLine" Version="5.6.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeCoverage" Version="16.9.1" />
<PackageReference Include="Microsoft.CodeCoverage" Version="16.9.4" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.12.0" />
<PackageReference Include="ReportGenerator" Version="4.8.7" />
</ItemGroup>
Expand Down
44 changes: 44 additions & 0 deletions cake/BuildContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Cake.Common;
using Cake.Core;
using Cake.Core.IO;
using Cake.Frosting;
using Nerdbank.GitVersioning;

public class BuildContext : FrostingContext
{
public const string Platform = "AnyCPU";
public const string BuildConfiguration = "Release";

public const string SolutionPath = "./MvvmScarletToolkit.sln";
public const string AssemblyInfoPath = "./src/SharedAssemblyInfo.cs";
public const string PackagePath = "./packages";
public const string ResultsPath = "./results";
public const string CoberturaResultsPath = "./results/reports/cobertura";
public const string LocalNugetDirectoryPath = @"D:\Drop\NuGet";

public DirectoryPath ReportsFolder { get; }
public FilePath CoberturaResultFile { get; }

public VersionOracle GitVersion { get; internal set; }
public string Branch { get; internal set; }

public bool IsPublicRelease { get; internal set; }

public string[] NugetPackageProjects { get; }

public BuildContext(ICakeContext context)
: base(context)
{
ReportsFolder = new DirectoryPath(ResultsPath).Combine("reports").MakeAbsolute(context.Environment.WorkingDirectory);
CoberturaResultFile = new DirectoryPath(CoberturaResultsPath).CombineWithFilePath("Cobertura.xml").MakeAbsolute(context.Environment.WorkingDirectory);

NugetPackageProjects = new[]
{
@".\src\MvvmScarletToolkit\MvvmScarletToolkit.csproj",
@".\src\MvvmScarletToolkit.Wpf\MvvmScarletToolkit.Wpf.csproj",
@".\src\MvvmScarletToolkit.Xamarin.Forms\MvvmScarletToolkit.Xamarin.Forms.csproj",
};

IsPublicRelease = context.EnvironmentVariable("PublicRelease", false);
}
}
43 changes: 43 additions & 0 deletions cake/BuildLifetime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.Tools.GitVersion;
using Cake.Core;
using Cake.Frosting;
using Cake.GitVersioning;

public sealed class BuildLifetime : FrostingLifetime<BuildContext>
{
public override void Setup(BuildContext context)
{
context.GitVersion = context.GitVersioningGetVersion();
context.Branch = context.GitVersion().BranchName;

context.Information("Branch: {0}", context.Branch);

if (context.IsPublicRelease && context.Branch == "master")
{
context.Information("Building a {0} release.", "public");
}
else
{
context.Information("Building a {0}release.", "pre-");
}

context.Information("Provider: {0}", context.BuildSystem().Provider);
context.Information("Platform: {0} ({1})", context.Environment.Platform.Family, context.Environment.Platform.Is64Bit ? "x64" : "x86");

context.Information("NUGETORG_APIKEY was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("NUGETORG_APIKEY")) ? "not" : "");
context.Information("GITHUB_APIKEY was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("GITHUB_APIKEY")) ? "not" : "");
context.Information("CODECOV_TOKEN was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("CODECOV_TOKEN")) ? "not" : "");

context.Information("reportsFolder: {0}", context.ReportsFolder.FullPath);
context.Information("coberturaResultFile: {0}", context.CoberturaResultFile.FullPath);

context.Information("dotnet tool: {0}", context.Tools.Resolve("dotnet.exe"));
}

public override void Teardown(BuildContext context, ITeardownContext info)
{
}
}
66 changes: 0 additions & 66 deletions cake/Context.cs

This file was deleted.

17 changes: 9 additions & 8 deletions cake/Program.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
using Cake.Frosting;
using System;

public class Program
public static class Program
{
public static int Main(string[] args)
{
return new CakeHost()
.UseContext<Context>()
.UseWorkingDirectory("..")
.InstallTool(new Uri("nuget:?package=Codecov&version=1.12.3"))
.InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.11.1"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.4"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.0"))
.InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=16.8.3"))
.InstallTool(new Uri("nuget:?package=Codecov&version=1.13.0"))
.InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.12.0"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.7"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.8"))
.InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=16.9.4"))
.InstallTool(new Uri("nuget:?package=nuget.commandline&version=5.8.1"))
.UseContext<BuildContext>()
.UseLifetime<BuildLifetime>()
.UseWorkingDirectory("..")
.Run(args);
}
}
14 changes: 6 additions & 8 deletions cake/Tasks/BuildAndPack.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
using Build;
using Cake.Common;
using Cake.Core;
using Cake.Core.IO;
using Cake.Frosting;
using Cake.GitVersioning;
using System.Linq;

public sealed class BuildAndPack : FrostingTask<Context>
public sealed class BuildAndPack : FrostingTask<BuildContext>
{
public override void Run(Context context)
public override void Run(BuildContext context)
{
foreach (var project in context.NugetPackageProjects)
{
var semver = context.GitVersioningGetVersion().SemVer2;
var semver = context.GitVersion.SemVer2;
var settings = new ProcessSettings()
.UseWorkingDirectory(".")
.WithArguments(builder => builder
.Append("pack")
.AppendQuoted("./MvvmScarletToolkit.slnf")
.Append($"-c {Context.BuildConfiguration}")
.Append($"--output \"{Context.PackagePath}\"")
.Append($"-p:PackageVersion={context.GitVersioningGetVersion().SemVer2}")
.Append($"-c {BuildContext.BuildConfiguration}")
.Append($"--output \"{BuildContext.PackagePath}\"")
.Append($"-p:PackageVersion={context.GitVersion.SemVer2}")
.Append($"-p:PublicRelease={context.IsPublicRelease}") // Nerdbank.GitVersioning - omit git commit ID
// Creating symbol packages
Expand Down
5 changes: 2 additions & 3 deletions cake/Tasks/CleanSolution.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Build;
using Cake.Frosting;

public sealed class CleanSolution : FrostingTask<Context>
public sealed class CleanSolution : FrostingTask<BuildContext>
{
public override void Run(Context context)
public override void Run(BuildContext context)
{
context.Clean(true, true, true, true);
}
Expand Down
5 changes: 2 additions & 3 deletions cake/Tasks/CleanSolutionAgain.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Cake.Frosting;
using Build;

public sealed class CleanSolutionAgain : FrostingTask<Context>
public sealed class CleanSolutionAgain : FrostingTask<BuildContext>
{
public override void Run(Context context)
public override void Run(BuildContext context)
{
context.Clean(true, true, true, false);
}
Expand Down
7 changes: 3 additions & 4 deletions cake/Tasks/CoberturaReport.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using Build;
using Cake.Common.IO;
using Cake.Common.Tools.ReportGenerator;
using Cake.Core;
using Cake.Core.IO;
using Cake.Frosting;

[Dependency(typeof(ConvertCoverage))]
public sealed class CoberturaReport : FrostingTask<Context>
public sealed class CoberturaReport : FrostingTask<BuildContext>
{
public override void Run(Context context)
public override void Run(BuildContext context)
{
context.MergeReports("./Results/coverage/**/*.xml", ReportGeneratorReportType.Cobertura, "cobertura");
}

public override bool ShouldRun(Context context)
public override bool ShouldRun(BuildContext context)
{
return base.ShouldRun(context)
&& context.GetFiles("./Results/coverage/**/*.xml").Count > 0;
Expand Down
Loading

0 comments on commit 67a38dd

Please sign in to comment.