Skip to content

Instantly share code, notes, and snippets.

@siennathesane
Last active June 17, 2019 05:53
Show Gist options
  • Save siennathesane/fbfd448e58239271fac976573d887182 to your computer and use it in GitHub Desktop.
Save siennathesane/fbfd448e58239271fac976573d887182 to your computer and use it in GitHub Desktop.
#addin "nuget:?package=Cake.FileHelpers&version=3.2.0"
var target = Argument<string>("target");
var globalOutputDir = new DirectoryPath("./build");
var taskHelp = new Dictionary<string,string>() {
{
"Project.DevServer", "Compiles the Project Development Server, which can be easily used for quick and dirty local development."
},
{
"Constants.Vault", "Generates the necessary constants for building, and then resets the files. Not for direct use as it will generate the files then immediate reset them."
}
};
Task("Constants.Vault")
.Description("Prepares the constants for the build environment.")
.Does(() => {});
Task("Project.DevServer")
.IsDependentOn("Constants.Vault")
.Description("Builds the development server.")
.Does(() => {});
Task("Welcome")
.Does(() => {
Information("Welcome to the Project Build Environment.\n");
Information("Below is a list of built targets available. Read the details before compiling, it may matter. To build a given target, just call `build.ps1 -Target <T>`.\nHappy coding.\n");
var max = 0;
foreach(var helpMsg in taskHelp) {
if (helpMsg.Value.Length > max) {
max = helpMsg.Value.Length;
}
}
var sb = new StringBuilder("", max);
for (var i = 0; i < max + 43; i++) { sb.Append("="); }
var target = "Build Target";
var desc = "Description";
Information($"{target,-40} {desc,0}");
Information($"{sb.ToString()}");
foreach(var helpMsg in taskHelp) {
Information($"{helpMsg.Key,-40} - {helpMsg.Value,0}");
}
Environment.Exit(0);
});
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment