Grab a nightly build and use the brand new <setenv> task. It should do
exactly what you're after.
and the fact that .net 1.1 doesn't support setting vars is an omission
rather than security feature as .net 2.0 supports it.

as for why nant is better than batch :

- better error handling
- portability - probably not a big issue form the sounds of it.
- logging
- auto send of email on failure
- better flow control
- compiler tasks are smarter about when to re-compile or not - improving
build speed

There was a dr dobbs article a little while ago on using Ant for batch
processing tasks - personally I think NAnt is well suited for this kind
of thing as well as general build tasks. There is no getting around the
verbosity though - although using somthing like NAntPad might be a help.

Ian

Merrill Cornish wrote:

Someone in our group is trying to decide whether it would be worthwhile for him 
to convert a number of build batch files into NAnt 0.85.  He' grumbling about 
how much NAnt he has to write to dulicate the work now done by the batch files. 
 He's right, of course.  Since NAnt is XML based, almost anthing else will be 
more concise than a NAnt script.

What really worries/annoys him is NAnt's handling of environment variables.

The compile step in the current batch files typically require a group of 
environment variables to be set for things like include paths, lib paths, and 
so on.  In the batch file, all you have to do is several SET statements, 
followed by one or more compile steps.  Each compile step then sees the 
original group of environment  variables you set up.  For some compile steps, 
the evironment variables need to be changed, but  that's just a few more SET 
statements in the batch file.  Deleting an environment variable need by one 
step, but not the next, is also just a SET (to nothing).

In NAnt, setting up all of those environment variables seems to be a real pain. 
 As I understand, one of .NET's security features is that its API does not 
allow environment or registry variable to be set (although there are ways 
around that limitation at the programming level).

As far as I can tell, he would have to

* Set NAnt properties to the environment variable values from the current batch 
files.

* Use the <exec> task for each compile step.

* For each <exec>, use its <environment> nested element to specify the names of 
the environment variables the compile step needs, referencing the properties to get the 
values (rather than hard coding them into each call).

Among other things, this means that where one batch file SET statement would serve 
for any number of following compile steps, he would have to re-specify the whole set 
of enviroment variables for each <exec>.

So far, he's not really impressed with NAnt as a substitute for the current 
batch files.


My questions for any of you are:

*  Is there a better way in NAnt to getting the environment variables set for each 
<exec>?

*  What arguments can I use to show that despite its verbosity, NAnt is the 
better way to go anyway?

Merrill




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users





------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to