feat: add Cake build to produce powershell module (#2)
- Add Cake build project - Change to CPM - Package bumps for security bumps - Reorganise solution structure to group harness projects
This commit is contained in:
parent
274d279732
commit
ecb0a20cbb
27 changed files with 267 additions and 58 deletions
55
build/Program.cs
Normal file
55
build/Program.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using Cake.Common;
|
||||
using Cake.Common.IO;
|
||||
using Cake.Common.IO.Paths;
|
||||
using Cake.Core;
|
||||
using Cake.Frosting;
|
||||
using Cake.Powershell;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return new CakeHost()
|
||||
.UseContext<BuildContext>()
|
||||
.Run(args);
|
||||
}
|
||||
}
|
||||
|
||||
public class BuildContext : FrostingContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Base source directory
|
||||
/// </summary>
|
||||
public ConvertableDirectoryPath BaseSourceLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Powershell module project folder
|
||||
/// </summary>
|
||||
public ConvertableDirectoryPath PowershellModuleProjectDirectory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Powershell module csproj location
|
||||
/// </summary>
|
||||
public ConvertableFilePath PowershellModuleCsproj { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Output directory for built DLLs and powershell module manifest files
|
||||
/// </summary>
|
||||
public ConvertableDirectoryPath PowershellModuleOutputDir { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Path to powershell script that creates the module manifest files
|
||||
/// </summary>
|
||||
public ConvertableFilePath CreateModuleManifestScript { get; set; }
|
||||
|
||||
public BuildContext(ICakeContext context)
|
||||
: base(context)
|
||||
{
|
||||
BaseSourceLocation = context.Directory("../src");
|
||||
PowershellModuleProjectDirectory = BaseSourceLocation + context.Directory("PowershellModule");
|
||||
PowershellModuleCsproj = PowershellModuleProjectDirectory + context.File("PowershellModule.csproj");
|
||||
PowershellModuleOutputDir = context.Directory("../") + context.Directory("output") + context.Directory("PowershellModule");
|
||||
var buildScriptDirectory = context.Directory("./Scripts");
|
||||
CreateModuleManifestScript = buildScriptDirectory + context.File("CreateModuleManifest.ps1");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue