Skip to content

Instantly share code, notes, and snippets.

@mzorec
Created August 21, 2019 06:53
Show Gist options
  • Save mzorec/c2e0d0572ed023f1d3ebbe72cb5903fc to your computer and use it in GitHub Desktop.
Save mzorec/c2e0d0572ed023f1d3ebbe72cb5903fc to your computer and use it in GitHub Desktop.
BuildScript interactive mode demo
using FlubuCore.Context;
using FlubuCore.Scripting;
namespace FlubuCore
{
/// <summary>
/// Build script template.
/// </summary>
public class BuildScript : DefaultBuildScript
{
[FromArg("DeployEnviroment", "Enviroment where the application will be deployed.")]
public string DeployEnvironment { get; set; }
protected override void ConfigureBuildProperties(IBuildPropertiesContext context)
{
context.Properties.Set(BuildProps.ProductId, "Todo");
context.Properties.Set(BuildProps.ProductName, "Todo"); ;
context.Properties.Set(BuildProps.SolutionFileName, "..\\Todo.sln");
}
protected override void ConfigureTargets(ITaskContext session)
{
session.CreateTarget("run.tests")
.SetDescription("Run's all tests in solution")
.Do(Example, "Running run.tests target...");
session.CreateTarget("deploy")
.SetDescription("Deploys application to specified environment. ")
.Do(Example, "Running deploy target...");
}
public void Example(ITaskContext context, string msg)
{
context.LogInfo(msg);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment