Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH93: loads additional cake files in the root folder #94

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/TaskRunner/TaskRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,22 @@ private ITaskRunnerNode LoadHierarchy(string configPath)
ITaskRunnerNode root = new TaskRunnerNode("Cake");

// Build
var buildDev = CreateTask(cwd, $"Default ({configFileName})", "Runs 'cake build.cake'", configFileName);
var tasks = TaskParser.LoadTasks(configPath);
var commands =
tasks.Select(
t =>
CreateTask(cwd, t.Key, $"Runs {configFileName} with the \"{t.Key}\" target",
buildDev.Command.Args + $" {t.Value}"));
var nodes = commands as IList<TaskRunnerNode> ?? commands.ToList();
buildDev.Children.AddRange(nodes);
root.Children.Add(buildDev);
CakePackage.Dte.ShowStatusBarText($"Loaded {nodes.Count} tasks from {configFileName}");
string[] filePaths = Directory.GetFiles(cwd, "*.cake");
foreach (var filePath in filePaths)
{
var file = Path.GetFileName(filePath);
var buildDev = CreateTask(cwd, $"{file}", $"Runs 'cake {file}'", file);
var tasks = TaskParser.LoadTasks(filePath);
var commands =
tasks.Select(
t =>
CreateTask(cwd, t.Key, $"Runs {file} with the \"{t.Key}\" target",
buildDev.Command.Args + $" {t.Value}"));
var nodes = commands as IList<TaskRunnerNode> ?? commands.ToList();
buildDev.Children.AddRange(nodes);
root.Children.Add(buildDev);
CakePackage.Dte.ShowStatusBarText($"Loaded {nodes.Count} tasks from {file}");
}
return root;
}

Expand Down