-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from Insire/dev
- Loading branch information
Showing
54 changed files
with
328 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.