I’m new to Nant, so I might be doing something completely wrong.

 

I have a build directory and I want to copy a bunch of files out of there and into a staging directory. I’m trying to do this with nant 0.8.4, the copy task. and it’s associated ‘flatten’ attribute. All to no avail, the copy task recreates the structure of the source directory.

 

I had a look through the archives and saw that this feature was added, but I can’t seem to get it to work. And helpers? I tried using the latest nightly build of nant 0.8.5 and it didn’t have any affect.

 

This is partial content of the build file.

 

      <target name="stage.pdfdocs" depends="alltargets.pdfdocs">

            <!-- copy files to the staging directory -->

            <copy flatten="true" todir="${stage.dir}" overwrite="true" >

                  <fileset basedir="${build.dir}">               

                        <includes name="${pdfdocs.target.name}"/>

                        <includes name="**\interop.app1.dll "/>

                        <includes name="**\Interop.app2.dll"/>

                  </fileset>       

            </copy>

           

            <copy flatten="true" todir="${stage.resources.dir}" overwrite="true">

                  <fileset basedir="${build.dir}">

                        <includes name="**\*.*"/>

                        <excludes name="${pdfdocs.target.name}"/>

                  </fileset>

            </copy>    

      </target>

 

 

Where the properties stage.dir and stage.resources.dir gets set up earlier in the build file:

            <ifnot propertyexists="stage.dir"> 

                  <property name="stage.dir" value="Stage"/>

            </ifnot>

            <ifnot propertyexists="stage.resources.dir">   

                  <property name="stage.resources.dir" value="${stage.dir}\Resources"/>

            </ifnot>

 

 

 

 

______________________________________________

 

Lachlan Yates

Software Engineer

 

Phone: 1300 559 451

Email: [EMAIL PROTECTED]

Web: http://www.businessprophet.com.au

 

Business Prophet Pty Ltd   ABN: 27 099 825 199

Suite 204, 343 George Street Sydney NSW 2000

(Entry via 16-20 Barrack Street)

Ph: 1300 559 451 Intl: +(61) 2 8270 8500  Fax: +(61) 2 8569 0925

 

This email message (and attachments) may contain information that is confidential to Business Prophet Pty Ltd. If you are not the intended recipient you cannot use, distribute or copy the message or attachments. In such a case, please notify the sender by return email immediately and erase all copies of the message and attachments. Opinions, conclusions and other information in this message and attachments that do not relate to the official business of Business Prophet Pty Ltd are neither given nor endorsed by it.

 

Reply via email to