-
Notifications
You must be signed in to change notification settings - Fork 8
/
BuildScript.cs
38 lines (35 loc) · 1.3 KB
/
BuildScript.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using Cake.Common.Build;
using Cake.FileHelpers;
using FlubuCore.Context;
using FlubuCore.Context.FluentInterface.Interfaces;
using FlubuCore.Scripting;
using FlubuCore.Scripting.Attributes;
namespace UsingCakeAddinInFlubuExample
{
/// <summary>
/// Example uses Cake.FileHelpers addin.
/// This is just an example that using Cake addins works. Using this addin in real scenario would be meaningless as you could just use File.ReadAllLines() with FlubuCore.
/// </summary
[NugetPackage("Cake.FileHelpers", "3.1.0")]
[NugetPackage("FlubuCore.CakePlugin", "1.1.0")]
public class BuildScript : DefaultBuildScript
{
protected override void ConfigureBuildProperties(IBuildPropertiesContext context)
{
}
protected override void ConfigureTargets(ITaskContext context)
{
context.CreateTarget("Cake.Addon")
.SetAsDefault()
.Do(CakeAddinExample);
}
private void CakeAddinExample(ITaskContext context)
{
var test = context.CakeTasks().Bitrise().IsRunningOnBitrise;
context.LogInfo($"IsRunning on bitrise: {test}");
var lines = context.CakeTasks().FileReadLines("ExampleFile.txt");
context.LogInfo(lines[0]);
}
}
}