Should the following nant config work? What I'm trying to to is generalize the build process to be used by muliple projects. Each project will have a dependencies.txt file that will list the dll on which this project is dependent. I can't make this work without explicitly identifying the references in the  includes like the example following.
 
Is it that foreach won't work inside a csc/references tag?
 
Thanks,
Bill
 
--------------------------------
Doesn't work:
 
 <target name="build" depends="init,dependencies">
  <csc target="library" output="${dll.dir}/${dllname}" debug="${debug}" unsafe="${isUnSafe}">
   <sources>
    <includes name="*.cs"/>
   </sources>
   <references>
    <foreach item="Line" in="dependencies.txt" delim="," property="dir,dll">
     <includes name="${dll.dir}/{dll}"/>
    </foreach>   
   </references>
  </csc>
 </target>
 
--------------------------------
Works:
 
 <target name="build" depends="init,dependencies">
  <csc target="library" output="${dll.dir}/${dllname}" debug="${debug}" unsafe="${isUnSafe}">
   <sources>
    <includes name="*.cs"/>
   </sources>
   <references>
     <includes name="../Data/Data.dll"/>
     <includes name="../Config/Config.dll"/>
   </references>
  </csc>
 </target>
 
 
--------------------------
On the other hand, this target works fine in the same directory:
 
 <target name="dependencies">
   <foreach item="Line" in="dependencies.txt" delim="," property="dir,dll">
    <echo message="compiling dependency ${dir}/${dll}"/>
   </foreach>
 </target>


NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.

Reply via email to