I've seen a few references to copying nant-contrib dlls
into the NAnt bin folder, and I'm curious why this is the (unoficially?)
suggested method for including nant-contrib tasks.
Surely a better method would be to unzip
NantContrib.zip and put it somewhere close to, but not over-the-top-of, NAnt
itself, and then using the <loadtasks path=""> element to dynamically load
the contrib tasks in build files that require them? If you set an
environment variable NANTCONTRIB_HOME on all computers that you are using, then
you could just use the following:
<loadtasks
path="${environment::get-variable('NANTCONTRIB_HOME') + '/bin'}"
/>
With the above, you could
run different versions of nant-contrib side-by-side, by changing the value of
NANTCONTRIB_HOME before running your scripts... you could use this to test a new
version of nant-contrib before deploying it, for instance.
As I see it, this has several
benefits:
* You can upgrade NAnt without having to remember
to copy the nant-contrib files back! * The startup time for
NAnt scripts not using contrib tasks would be faster, since they don't need to
scan extra assemblies (minor)* It just *feels* wrong to be copying files into the
distribution of a separate product.
All at the expense of one extra line in (some of) your build
scripts.
If anyone has any comments, I'm happy to discuss
this.
-- Troy
|