Title: Message
Well, it looks like file::up-to-date falls quite short of the functionality that uptodatefile provided.
 
The file::up-to-date function should probably be extended to create:
file::up-to-date-to-fileset(srcFile, targetFileSetRefId)
file::fileset-up-to-date(srcFileSetRefId, targetFile)
file::fileset-up-to-date-to-fileset(srcFileSetRefId, targetFileSetRefId)
 
Then your code would change similar to:
 
<fileset id="compareset">
    <xsl:for-each select="...">
        <!-- Same xsl tree from <comparefiles> element previously -->
    </xsl:for-each>
</fileset>
<property name="build.required" value="false" if="${file::up-to-date-to-fileset(assembly.name + '.version', 'compareset')}" />
 
 
If NAnt functions support overloading, and named filesets could be referenced directly in functions, then the file::up-to-date function could just be overloaded:
file::up-to-date(string srcFile, string targetFile)
file::up-to-date(string srcFile, FileSet targetFileSet)
file::up-to-date(FileSet srcFileSet, string targetFile)
file::up-to-date(FileSet srcFileSet, FileSet targetFileSet)
 
and the test would become something like if="${file::up-to-date(assembly.name + '.version', @compareset)}".  I haven't looked at the source code for how functions and their arguments are parsed, so I don't know how hard this last would be (Or even if it's already implemented!)
 
It's probably worth putting in a RFE at http://sourceforge.net/tracker/?group_id=31650&atid=402871 to extend the file::up-to-date function unless someone mentions that it's already been done.  Until then, I guess you get to live with a deprecation warning :-)
 
 
All the best,
 
-- Troy

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bonnett, Evan A
Sent: Wednesday, 23 June 2004 1:41 AM
To: [EMAIL PROTECTED]
Cc: 'Cromwell, Ryan F.'
Subject: [Nant-users] XSLT Generated Build File and deprecated uptodatefile attribute

All,
 
I've included an <if> here that is using the deprecated uptodatefile.  NAnt warns that the attribute is deprecated and to use the ${file::uptodate(comparefile, uptodatefile)} function.
 
In this code below, it will set the ${build.required} property to false if all files are up to date.  Is there an easy (and clean) way to accomplish this using the file::uptodate() function?
 
<if uptodatefile=".\${{assembly.name}}.version" debug="true" verbose="true" failonerror="false">
    <comparefiles>
     <!-- References -->
     <xsl:for-each select="./References/Reference">
      <xsl:choose>
       <xsl:when test="substring(@AssemblyName,1,6) = 'System'"> <!-- static assembly reference -->
        <includes name="[EMAIL PROTECTED]" />
       </xsl:when>
       <!--Static References-->
       <xsl:when test="@AssemblyName">
        <!--We need to resolve this better.  We haven't copied these into the latest dir yet.
        <includes name="[EMAIL PROTECTED]" />-->
       </xsl:when>
       <!-- Project references -->
       <xsl:when test="@Project">
        <!-- It is currently assumed that assembly names and root folder names are equal.-->
        <includes name="[EMAIL PROTECTED]@Name}.version" />
       </xsl:when>
       <!-- COM object reference -->
       <xsl:when test="@Guid">
        <!-- This path doesn't exist yet
        <includes name="[EMAIL PROTECTED]" />
        -->
       </xsl:when>
      </xsl:choose>
     </xsl:for-each>
     
     <!--Code and Embedded Resources-->
     <xsl:for-each select="../Files/Include/[EMAIL PROTECTED]'Compile' or @BuildAction='EmbeddedResource' or @BuildAction='Content']">
      <includes name="[EMAIL PROTECTED]" />
     </xsl:for-each>
     
     <!-- The project file may have changed -->
     <includes name="${{project.path}}" />
     
     <!-- The force.rebuild file allows us to force a rebuild even if there isn't a need to -->
     <includes name="${{project.src}}\force.rebuild" />
    </comparefiles>
    
    <property name="build.required" value="false" />
   </if>
 
Thanks,

Evan A. Bonnett
Reynolds and Reynolds, IT
ERA Integrated Desking Development
937-485-8577
58577



Disclaimer Message:

This message contains confidential information and is intended only for the individual(s) named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please immediately delete it and all copies of it from your system, destroy any hard copies of it, and notify the sender. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. To the maximum extent permitted by law, Immersive Technologies Pty. Ltd. does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.

Reply via email to