2

I'm on a .NET project, and I would like to migrate build script from MsBuild to Rake. I don't want to force developers (or build agent machines) to have to install anything, I want it to be self contained. If possible I'd prefer to use IronRuby.

Is it possible to just drop everything in /tools/rake and /tools/IronRuby and have it just work, the way everyone does with NAnt?

I would appreciate any pointers to tutorials on this or blogposts. I'm a complete noob when it comes to Ruby, rake and these gem things.

Krzysztof Kozmic
  • 27,267
  • 12
  • 73
  • 115
  • I think its possible now. Ben Schierman was doing it during his automated build talk at Houston Techfest '09. I'm trying to figure it out now too. Will update this post with new info. – George Mauer Oct 02 '09 at 15:02
  • Thanks George. Looking forward to it. – Krzysztof Kozmic Oct 03 '09 at 06:38
  • I got build 0.9.1.0 - 2009-09-28 and irake doesn't work - breaks if you run it with the simplest of RakeFile.rb files – George Mauer Oct 04 '09 at 17:50
  • @Jimmy, I am sure that the fault is my own. Here is a screencast of me trying to run irake with no rake file - it gives me a gems activation error http://screencast.com/t/Y1vkkMlC I thought everything you need to run it was included? – George Mauer Oct 08 '09 at 14:54
  • @george IronRuby passes all the Rake unit tests, so I'd be curious to see your rake file – Jimmy Schementi Oct 08 '09 at 07:31

3 Answers3

2

Yes it is possible, but you pay the cost of bringing the IronRuby runtime with you. That's about 2300 files to deploy so you'd need to pack 7zip with your lib to unpack IronRuby.

I did something similar where I wanted to pack LessCss with IronRuby in one managed wrapper. Turned out to be a totally impracticable solution:

http://www.tigraine.at/2009/08/24/introducing-ironlessnet-your-duct-tape-solution-to-lesscss-in-aspnet/

greetings Daniel

Tigraine
  • 23,358
  • 11
  • 65
  • 110
  • Interesting. I kindof expected (hoped) it would be like NAnt - drop a few assemblies and you're done... Maybe PSake is not such a bad idea after all then... – Krzysztof Kozmic Sep 18 '09 at 11:00
  • I'm no expert on this either, so maybe there is a way. But I don't really see one without packing the whole IR thing.. And once you extract it FileSystem operations get really wonky (never copy that folder!). I'd expect (since Win7 also packs Powershell) that the majority of users will have Powershell installed.. – Tigraine Sep 18 '09 at 11:23
  • So far all our dev machines are Win XP... Anyway, I'll chech the PSake out, and maybe I'll just have all devs install it... Thanks – Krzysztof Kozmic Sep 18 '09 at 11:35
  • What is the difference between installing PowerShell and installing Ruby/Iron ruby? The dev/build machines will still need them installing. – Owen Nov 05 '09 at 11:29
  • The difference is how easy it is to install. Ruby has become quite easy to install, but is far from the dumb click setup.exe and be done solution.. Also, Win7 machines all have Powershell 2.0 pre-installed so moving forward powershell needs no setup at all on modern machines. – Tigraine Nov 08 '09 at 19:34
  • The author is probably aware, but there's now dotLESS which should obviate the need to use LessCss and IronRuby: https://github.com/dotless/dotless – Josh Kodroff Apr 08 '11 at 15:19
  • Oh wait... the author is the owner of the dotLESS project, so I'm quite sure he's aware. – Josh Kodroff Apr 08 '11 at 15:19
  • @Josh Kodroff Yes .. when we initially set out to write dotless my first thought was: "Let's not reinvent the wheel if we can just run the ruby version on the CLR.. " turned out to be totally impractical so we started work on the dotless project :) – Tigraine Aug 10 '11 at 21:08
2

I have a project that will allow you to run IronRuby applications out of a zip file, so you can easily X-Copy deploy the IronRuby standard library along with any gems you may need. Theoretically you could even embed such a zip file in a .dll as a resource, but I'm not sure what you'd get out of that. I created this so that I could embed IronRuby automation in my desktop front end in a straightforward way without adding any extra complication to the deployment phase, but it would probably work just as well for your scenario, maybe with a little tweaking.

http://github.com/PlasticLizard/Bracket

Nathan
  • 12,290
  • 3
  • 29
  • 28