Willem,
Another way to do this would be to use named filesets. As below

<fileset id="GTK">
<includes name="./src/main.cs"/>        
<includes name="./src/GTKScrollBox.cs"/>
<includes name="./src/GTKImageBox.cs"/>
</fileset>

<fileset id="SWF">
<includes name="./src/main.cs"/>
<includes name="./src/SWFScrollBox.cs"/>
<includes name="./src/SWFImageBox.cs"/>
</fileset>
...
<if propertytrue="SWF">
<property name="sources" value="SWF" />
</if>
<csc target="library" output="${targetdir}/${project.name}.dll" debug="${debug}" >


           <sources refid="${sources}">
            </sources>

</csc>

right now now there is no way to add to a fileset once its been defined or conditionally add includes the way you are trying to do.


Ian


I would like to include source files, depending on property values:
I have two properties, one is named "SWF" and another is named "GTK"
Before I call the compile target, I set either one of them to true.
When I run a project, I get a message that only one file [main.cs] was included, and because main.cs requires the files in either of the others to be included, the compile fails.
Can I define a filesets to include files based on a property value? - if so, How?


Thanks.
        <property name="SWF"     value="true" />
        <call target="compile" force="true"/>             <!-- called from my default 
target  -->

<target name="compile" description="compiles the source code">
<csc target="library" output="${targetdir}/${project.name}.dll" debug="${debug}" >


           <sources>
           <if propertytrue="SWF">      <!-- Include only if compiling for Windows Forms  
-->
                   <includes name="./src/SWFScrollBox.cs"/>
                        <includes name="./src/SWFImageBox.cs"/>
           </if>
              <if propertytrue="GTK">   <!-- Include only if compiling for GTK#  -->
                       <includes name="./src/GTKScrollBox.cs"/>
                       <includes name="./src/GTKImageBox.cs"/>
           </if>

        <!-- File to be compiled irrespective of "SWF" and "GTK" property values -->
        <includes name="./src/main.cs"/>        
           </sources>
        </csc>    
   </target>


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users






-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to