Troy Laurin wrote:


Anyway, I might have a play with it over the next few weeks, and if I don't find any nasty side-effects with targets or other elements, then I'll submit it as a patch post-0.85.


PS- no offense, but some of the code to initialise the project and process the build file could use some refactoring :-)

none taken. That code has been reworked a number of times and is better than it was. However any refactoring patches would be more than welcome.

    In the meantime, a simple approach that works today is to
    duplicate the
    task invocation with if/unless attributes, and use a property to
    indicate which to do:
      In the setup targets:
        <property name="generateDocs" value="true" /> <!-- or false -->

In the build targets:
<csc target="exe" output="..." doc="..." if="${generateDocs}" />
<csc target="exe" output="..." unless="${generateDocs}" />


    It's annoyingly verbose, but I use this idiom frequently.


I think most people use it, because it's currently the only way to do it :-)
It gets exponentially more annoying the larger the element needing repetition is, though. (IMHO) Allowing dynamic attributes seems like a much more scalable and maintainable solution for the build script author.


somthing like this could be a good solution. Another possibility is to have a way to set an attributes value such that its equivalent to it not being set - somthing like null for attributes. For example;
<target name="notdoc">
<property name="docFile" value="${property::null-value()}"
</target>


<csc target="exe" output="..." doc="${docFile}/>

Ian




------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to