Thanks Richard. Here's the modified solution I'm using (doesn't require the 
extra rebuild.required property):

    <uptodate property="project.uptodate">
        <sourcefiles>
            <include name="**/*.cs"/>
            <include name="${project::get-buildfile-path()}"/>
        </sourcefiles>
        <targetfiles>
            <include name="${build.output_dir}\${build.output_file}"/>
        </targetfiles>
    </uptodate>

    <target name="build">
        <mkdir dir="${build.output_dir}"/>
        <csc target="library" output="${build.output_dir}\${build.output_file}" 
debug="${build.debug}" define="${build.defines}" filealign="4096" 
rebuild="${project.uptodate=='False'}">
            <sources>
                <include name="**/*.cs"/>
            </sources>
            <references>
                <include name="${nant.dir}/bin/NAnt.Core.dll" />
            </references>
        </csc>
    </target>

This will work fine for csc tasks in particular; I guess to make it generalized 
for any task I could surround the task with an <if> task? Hope this helps 
someone else.
________________________________________
From: Foster, Richard - PAL [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 09, 2005 10:44 AM
To: Parag Chandra; nant-users@lists.sourceforge.net
Subject: RE: [Nant-users] How can I create a dependency on the .build file 
itself?

Parag,
 
No doubt someone else has already responded... in which case I hope you haven't 
been swamped by the response!
 
You might want to use the uptodate task to set a property which then causes a 
rebuild. (NOTE: Since the uptodate task sets the property to false when we want 
to force a rebuild an extra step was needed. A logical "not" operation would be 
really helpful here, but doesn't appear to exist.)
 
    <target name="build" description="Build the SlickEdit.Build.Tasks.dll">
        <mkdir dir="${build.output_dir}"/>
        <uptodate property="uptodate">
            <sourcefiles>
                <include name="MyNAntExtensions.build" />
            </sourcefiles>
            <targetfiles>
                <include name="${build.output_dir}\${build.output_file}" />
            </targetfiles>
        </uptodate>
        <property name="rebuild.required" value="false" />
        <property name="rebuild.required" value="true" unless="${uptodate}"/>
        <csc target="library" output="${build.output_dir}\${build.output_file}" 
debug="${build.debug}" define="${build.defines}" filealign="4096" 
rebuild="${rebuild.required}>
            <sources>
                <include name="**/*.cs"/>
            </sources>
            <references>
                <include name="${nant.dir}/bin/NAnt.Core.dll" />
            </references>
        </csc>
    </target>
 
Hope this helps,
 
Regards,
Richard

________________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Parag Chandra
Sent: Wednesday, March 09, 2005 09:26
To: nant-users@lists.sourceforge.net
Subject: [Nant-users] How can I create a dependency on the .build file itself?
Hello,

I have a target defined in a MyNAntExtensions.build file, like this:

    <target name="build" description="Build the SlickEdit.Build.Tasks.dll">
        <mkdir dir="${build.output_dir}"/>
        <csc target="library" output="${build.output_dir}\${build.output_file}" 
debug="${build.debug}" define="${build.defines}" filealign="4096">
            <sources>
                <include name="**/*.cs"/>
            </sources>
            <references>
                <include name="${nant.dir}/bin/NAnt.Core.dll" />
            </references>
        </csc>
    </target>

The target runs whenever any of the .cs source files have changed, like I would 
expect. I would also like the target to run whenever the .build file itself has 
changed. Can someone please tell me how I could accomplish this? Thanks.

-Parag Chandra


-------------------------------------------------------
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_ide95&alloc_id396&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to