forked from daveaglick/Scripty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptyAliases.cs
More file actions
30 lines (29 loc) · 1.24 KB
/
Copy pathScriptyAliases.cs
File metadata and controls
30 lines (29 loc) · 1.24 KB
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
using System;
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.IO;
namespace Cake.Scripty
{
/// <summary>
/// <para>Alias to evaluate C# scripts using Scripty</para>
/// <code>#tool "nuget:?package=Scripty"</code>
/// </summary>
[CakeAliasCategory("Scripty")]
public static class ScriptyAliases
{
/// <summary>
/// Gets a <see cref="ScriptyRunner"/> to evaluate scripts for the given project
/// </summary>
/// <param name="context">The Cake context</param>
/// <param name="projectFilePath">Path to the project file to use</param>
/// <param name="settings">The settings for the tool</param>
/// <returns>A <see cref="ScriptyRunner"/> to evaluate scripts</returns>
[CakeMethodAlias]
public static ScriptyRunner Scripty(this ICakeContext context, FilePath projectFilePath, ScriptySettings settings = null)
{
if (context == null) throw new ArgumentNullException(nameof(context));
if (context == null) throw new ArgumentNullException(nameof(projectFilePath));
return new ScriptyRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, projectFilePath, settings);
}
}
}