Check out my latest product, BuildFactory

Running NAnt on Mac OS X
For longer than bleep. has been an actual company, I've been masquerading as a Mac developer, while in reality, C# has been paying most of my bills for the better part of a year. I currently develop C# on Mac OS X, and Red Hat Enterprise Linux, so I am somewhat atypical in the realm of C# (primarily .NET) developers.Currently in my main C# project (some client work), I'm using Xcode integrated with a system of GNU/Make Makefiles, while not the most portable solution, it fit the bill when I originally started writing code (this project has been started from scratch). It is counter-intuitive however to have a build system in place that is not portable, with code that is. I became more convinced of this after attending Leo Simons' session at ApacheCon this past friday entitled "Really Big Builds." The Apache Software Foundation probably has one of the largest code bases in the open source world, most of it Java, but they still use a wide variety of build tools. The tools employed for building projects ranging from Cocoon to Tomcat are equally as varied, tools such as Ant, Maven and of course, good old shell scripts. How is this relevant to me? Portability of course, it is quite obvious that these guys have a good bit of experience in supporting numerous platforms, to where I can metaphorically stand on the shoulders of giants, and gain from their experience.
This brings me of course to NAnt. NAnt is in practice, and design, equitable to Ant, except built in C#, and targetted more at .NET/Mono projects. After a bit of research this past saturday, I discovered two things, NAnt is distributed in the Mono.framework distributed by the Mono Project, the second thing was that...NAnt has been dysfunctional at best in the Mac OS X release of Mono. I'll spare you the trivial details as to why it wasn't working (pkg-config nonsense), but instead link you to the appropriate bug report (#79671) in Mono's bugzilla, and display the fix for the error.
NAnt is run by a small shell script distributed by the Mono Project, this tiny shell script just needs to be modified to ensure that invocations of "nant" execute appropriately:
export
PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig
/Library/Frameworks/Mono.framework/Versions/1.1.18/bin/mono
/Library/Frameworks/Mono.framework/Versions/1.1.18/lib/NAnt/NAnt.exe "$@"
PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig
/Library/Frameworks/Mono.framework/Versions/1.1.18/bin/mono
/Library/Frameworks/Mono.framework/Versions/1.1.18/lib/NAnt/NAnt.exe "$@"
[tags: nant, csharp, mono, macosx, apachecon]
Replies
Blogged it and linked back
Write reply
This item is closed, it's not possible to add new comments to it or to vote on it


