When I recently got back into .NET development, I quickly found myself wanting something like Rake
I found myself creating a command-line application with lots of arguments for running different trivial little tasks that I didn’t want to do manually over and over again …
I asked some of my .NET friends what tool they recommended and, to my surprise, many of them recommended Rake!
Apparently, a lot of .NET shops use Rake for tasks. There’s even an awesome set of Rake tasks specifically created for .NET called Albacore.
I want C# dammit!
As awesome as Rake is, when I’m doing .NET development, I want to write my tasks in .NET! And I definitely don’t want to ask the other developers on my team to start using Ruby for their tasks.
I also wanted to be able to unit-test my tasks, call them easily from my C# applications, etc.
So I whipped up a little Rake port and called it TaskMan!
1 public class Whatever { 2 3 [Task("Initializes our environment")] 4 public static void Environment() { 5 Console.WriteLine("Loading environment"); // This would do real stuff ... 6 } 7 8 [Task("Seeds the database with test data", Before = "environment")] 9 public static void Seed() { 10 Console.WriteLine("Seeding database"); // This would do real stuff ... 11 } 12 }
1 $ TaskMan 2 Tasks: 3 environment Initializes our environment 4 seed Seeds the database with test data 5 6 $ TaskMan seed 7 Loading environment 8 Seeding database