This repository has been archived by the owner on May 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
119 changed files
with
1,250 additions
and
144 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,32 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<PackAsTool>true</PackAsTool> | ||
|
||
<!-- Make sure start same folder .NET Core CLI and Visual Studio --> | ||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> | ||
<Configurations>Debug;Release;Build</Configurations> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Themes\Github\Theme.css" /> | ||
<None Remove="Themes\Github\Theme.html" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Themes\Github\Theme.css"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="Themes\Github\Theme.html"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Cake.Frosting" Version="1.0.0-rc0002" /> | ||
<PackageReference Include="Cake.MarkdownToPdf" Version="2.5.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,14 @@ | ||
namespace Build | ||
{ | ||
static class Configuration | ||
{ | ||
public const string SolutionName = @"./src/EVE-O-Preview.sln"; | ||
|
||
public const string BinFolder = @"./bin"; | ||
public const string ToolsFolder = @"./tools"; | ||
public const string PublishFolder = @"./publish"; | ||
public const string BuildConfiguration = @"Release"; | ||
|
||
public const string BuildToolPath = @"c:\Developer Tools\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"; // Set to NULL to let Cake to try to use the default MSBuild instance | ||
} | ||
} |
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,13 @@ | ||
using Cake.Core; | ||
using Cake.Frosting; | ||
|
||
namespace Build | ||
{ | ||
public class Context : FrostingContext | ||
{ | ||
public Context(ICakeContext context) | ||
: base(context) | ||
{ | ||
} | ||
} | ||
} |
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,59 @@ | ||
using Cake.Common.Diagnostics; | ||
using Cake.Common.IO; | ||
using Cake.Common.Net; | ||
using Cake.Core; | ||
using Cake.Core.IO; | ||
using Cake.Frosting; | ||
|
||
namespace Build | ||
{ | ||
public sealed class Lifetime : FrostingLifetime<Context> | ||
{ | ||
private const string NuGetUrl = @"https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"; | ||
|
||
private void DeleteDirectory(Context context, string directoryName) | ||
{ | ||
if (!context.DirectoryExists(directoryName)) | ||
{ | ||
return; | ||
} | ||
|
||
context.DeleteDirectory(directoryName, new DeleteDirectorySettings { Force = true, Recursive = true }); | ||
} | ||
|
||
private void DownloadNuGet(Context context) | ||
{ | ||
if (context.FileExists(Configuration.ToolsFolder + "/nuget.exe")) | ||
{ | ||
return; | ||
} | ||
|
||
if (!context.DirectoryExists(Configuration.ToolsFolder)) | ||
{ | ||
context.CreateDirectory(Configuration.ToolsFolder); | ||
} | ||
|
||
var tempFile = context.DownloadFile(NuGetUrl); | ||
context.CopyFile(tempFile, new FilePath(Configuration.ToolsFolder + "/nuget.exe")); | ||
} | ||
|
||
public override void Setup(Context context) | ||
{ | ||
context.Information("Setting things up..."); | ||
|
||
context.Information("Delete bin and publish folders"); | ||
this.DeleteDirectory(context, Configuration.BinFolder); | ||
this.DeleteDirectory(context, Configuration.PublishFolder); | ||
|
||
context.Information("Download NuGet"); | ||
this.DownloadNuGet(context); | ||
|
||
} | ||
|
||
public override void Teardown(Context context, ITeardownContext info) | ||
{ | ||
context.Information("Tearing things down..."); | ||
//this.DeleteDirectory(context, ToolsDirectoryName); | ||
} | ||
} | ||
} |
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,22 @@ | ||
using Cake.Frosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Build | ||
{ | ||
public class Program : IFrostingStartup | ||
{ | ||
public static int Main(string[] args) | ||
=> new CakeHost() | ||
.UseStartup<Program>() | ||
.Run(args); | ||
|
||
public void Configure(IServiceCollection services) | ||
{ | ||
services.UseContext<Context>(); | ||
services.UseLifetime<Lifetime>(); | ||
|
||
//move up from build directory and searching for sln or csproj files | ||
services.UseWorkingDirectory(".."); | ||
} | ||
} | ||
} |
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,26 @@ | ||
using Cake.Common.Diagnostics; | ||
using Cake.Common.Tools.MSBuild; | ||
using Cake.Frosting; | ||
|
||
namespace Build.Tasks | ||
{ | ||
[Dependency(typeof(Restore))] | ||
public sealed class Build : FrostingTask<Context> | ||
{ | ||
public override void Run(Context context) | ||
{ | ||
context.Information("Build started..."); | ||
|
||
context.MSBuild(Configuration.SolutionName, settings => | ||
{ | ||
settings.Configuration = Configuration.BuildConfiguration; | ||
settings.ToolVersion = MSBuildToolVersion.Default; | ||
|
||
if (!string.IsNullOrEmpty(Configuration.BuildToolPath)) | ||
{ | ||
settings.ToolPath = Configuration.BuildToolPath; | ||
} | ||
}); | ||
} | ||
} | ||
} |
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,9 @@ | ||
using Cake.Frosting; | ||
|
||
namespace Build.Tasks | ||
{ | ||
[Dependency(typeof(Zip))] | ||
public sealed class Default : FrostingTask<Context> | ||
{ | ||
} | ||
} |
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,22 @@ | ||
using Cake.Common.Diagnostics; | ||
using Cake.Frosting; | ||
using Cake.MarkdownToPdf; | ||
using Markdig; | ||
|
||
namespace Build.Tasks | ||
{ | ||
public sealed class Documentation : FrostingTask<Context> | ||
{ | ||
public override void Run(Context context) | ||
{ | ||
context.Information("Convert README.MD"); | ||
|
||
context.MarkdownFileToPdf("readme.md", Configuration.BinFolder + "/readme.pdf", settings => | ||
{ | ||
settings.Theme = Themes.Github; | ||
settings.UseAdvancedMarkdownTables(); | ||
settings.MarkdownPipeline.UseGridTables(); | ||
}); | ||
} | ||
} | ||
} |
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,17 @@ | ||
using Cake.Common.Diagnostics; | ||
using Cake.Common.Tools.NuGet; | ||
using Cake.Common.Tools.NuGet.Restore; | ||
using Cake.Frosting; | ||
|
||
namespace Build.Tasks | ||
{ | ||
[Dependency(typeof(Documentation))] | ||
public sealed class Restore : FrostingTask<Context> | ||
{ | ||
public override void Run(Context context) | ||
{ | ||
context.Information("Restore started..."); | ||
context.NuGetRestore(Configuration.SolutionName, new NuGetRestoreSettings { NoCache = true }); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using Cake.Common.IO; | ||
using Cake.Frosting; | ||
|
||
namespace Build.Tasks | ||
{ | ||
[Dependency(typeof(Build))] | ||
public sealed class Zip : FrostingTask<Context> | ||
{ | ||
public override void Run(Context context) | ||
{ | ||
if (!context.DirectoryExists(Configuration.PublishFolder)) | ||
{ | ||
context.CreateDirectory(Configuration.PublishFolder); | ||
} | ||
|
||
context.Zip(Configuration.BinFolder, Configuration.PublishFolder + "/EVE-O Preview.zip", | ||
new[] { Configuration.BinFolder + "/EVE-O Preview.exe", Configuration.BinFolder + "/readme.pdf" }); | ||
} | ||
} | ||
} |
Oops, something went wrong.