Created
August 21, 2019 06:53
-
-
Save mzorec/c2e0d0572ed023f1d3ebbe72cb5903fc to your computer and use it in GitHub Desktop.
BuildScript interactive mode demo
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
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