Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Kasyanov committed May 8, 2021
2 parents e40cbf6 + 3329b6c commit 944af72
Show file tree
Hide file tree
Showing 119 changed files with 1,250 additions and 144 deletions.
9 changes: 0 additions & 9 deletions Eve-O-Preview/packages.config

This file was deleted.

158 changes: 106 additions & 52 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/PartnerBadge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions build/Build.csproj
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>
14 changes: 14 additions & 0 deletions build/Configuration.cs
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
}
}
13 changes: 13 additions & 0 deletions build/Context.cs
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)
{
}
}
}
59 changes: 59 additions & 0 deletions build/Lifetime.cs
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);
}
}
}
22 changes: 22 additions & 0 deletions build/Program.cs
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("..");
}
}
}
26 changes: 26 additions & 0 deletions build/Tasks/Build.cs
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;
}
});
}
}
}
9 changes: 9 additions & 0 deletions build/Tasks/Default.cs
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>
{
}
}
22 changes: 22 additions & 0 deletions build/Tasks/Documentation.cs
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();
});
}
}
}
17 changes: 17 additions & 0 deletions build/Tasks/Restore.cs
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 });
}
}
}
20 changes: 20 additions & 0 deletions build/Tasks/Zip.cs
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" });
}
}
}
Loading

0 comments on commit 944af72

Please sign in to comment.