Anderson, Kelly wrote:

I want to write a variable to the registry from my NAnt script. There is
a very nice task for reading the registry, why isn't there one for
writing to the registry? Is it too easy to have to resort to a task?

I would like to write what was built last, build numbers and such in the
registry, but I'm not sure what the best way of doing this would be.
As I recall, there were some security issues (or perhaps it was timing issues) around doing registry writes in NAnt. You ought to be able to use a script task to implement it.

But why would you want to put that information into the registry? The registry suffers from enough bloat as is. You'd have to taken into account the possibility of doing builds on a branch concurrently with the main builds. You'd have to deal with cleanup (say if a build was done on a temporary branch). Sharing this information with other systems is not trivial (in the literal sense; I'm not implying it's very difficult). Perhaps the best reason, however, is simply that NAnt makes it easier to use other mechanisms.

Why not just use an XML file? You can use the xmlpeek and xmlpoke tasks to get and set the information. The multiple branch problem goes away, by simply putting separate xml files into the build tree for that branch. The cleanup problem likewise goes away. The information is kept with the build if you ever archive the tree, or even just move it to a different machine. It's trivial to share by making the file available over a network drive. This is certainly the approach I'd take.

Gary




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to