Here is one that I came up with that is pretty generic:
<?xml version="1.0" encoding="utf-8" ?>
<project xmlns="http://nant.sf.net/release/0.86-beta1/nant.xsd";
name="Company.Portal.Domain" default="build">
  <property name="debug" value="false" />
  <property name="optimize" value="true"/>
  <property name="bin_name" value="${project::get-name()}.dll" />
  <property name="nant.settings.currentframework" value="net-2.0"/>
  <property name="output_bin" value="build\${bin_name} "/>
  <property name="build_path" value="..\build\" />
  <property name="build_bin" value="${build_path}${bin_name}"/>
  <target name="clean" description="Cleans the build folder which forces a
rebuild.">
    <delete dir="build"  if="${directory::exists('build')}" />
  </target>
  <target name="debug" description="Specifies assembly to be compiled with
debug symbols.">
    <property name="debug" value="true" overwrite="true" />
    <call target="build"/>
    <copy file="build\${project::get-name()}.pdb" todir="${build_path}"
overwrite="true" />
  </target>
  <target name="build" description="Compiles assembly.">
    <mkdir dir="build" if="${not directory::exists('build')}" />
    <csc target="library" output="${output_bin}" debug="${debug}"
optimize="${optimize}" >
      <sources>
        <include name="**\*.cs" />
      </sources>
      <references>
        <include name="..\lib\*.dll" />
        <include name="${build_path}*.dll"/>
        <exclude name="${build_bin}"/>
      </references>
      <resources dynamicprefix="true" prefix="${project::get-name()}">
        <include name="**\*.hbm.xml" />
      </resources>
    </csc>
    <mkdir dir="${build_path}" if="${not directory::exists(build_path)}"  />
    <copy file="${output_bin}" todir="${build_path}" overwrite="true" />
    <copy file="${output_bin}" todir="..\bin" overwrite="true" />
  </target>
</project>


And here is a more complex one for an ASP.Net build:

<?xml version="1.0" encoding="utf-8" ?>
<project xmlns="http://nant.sf.net/release/0.86-beta1/nant.xsd";
name="Company.Portal.Web" default="build">

  <property name="debug" value="false" />
  <property name="optimize" value="true"/>
  <property name="bin_name" value="${project::get-name()}.dll" />
  <property name="output_bin" value="build\${bin_name} "/>
  <property name="build_path" value="..\build\" />
  <property name="build_bin" value="${build_path}${bin_name}"/>
  <property name="nant.settings.currentframework" value="net-2.0"/>
  <property name="web_path" value="..\web\"/>
  <property name="web_bin_path" value="${web_path}bin"/>

  <target name="clean" description="Cleans the build folder which forces a
rebuild.">
    <delete dir="build"  if="${directory::exists('build')}" />
    <delete dir="${web_path}"  if="${directory::exists(web_path)}"
failonerror="false" />
  </target>

  <target name="debug" description="Specifies assembly to be compiled with
debug symbols.">
    <property name="debug" value="true" overwrite="true" />
    <call target="build"/>
    <copy file="build\${project::get-name()}.pdb" todir="${build_path}"
overwrite="true" />
  </target>

  <target name="build" description="Compiles assembly.">
    <mkdir dir="build" if="${not directory::exists('build')}" />
    <csc target="library" output="${output_bin}" debug="${debug}"
optimize="${optimize}" >
      <sources>
        <include name="**\*.cs" />
        <include name="**\*.resx" />
      </sources>
      <references>
        <include name="..\lib\*.dll" />
        <include name="${build_path}*.dll"/>
        <exclude name="${build_bin}"/>
      </references>
      <resources dynamicprefix="true" prefix="${project::get-name()}">
        <include name="Web.xml" />
      </resources>
    </csc>

    <copy file="${output_bin}" todir="${build_path}" overwrite="true" />
    <copy file="${output_bin}" todir="..\bin" overwrite="true" />
    <!-- Setup Web Site -->
    <mkdir dir="${build_path}" if="${not directory::exists(build_path)}"  />
    <mkdir dir="${web_path}" if="${not directory::exists(web_path)}"  />
    <mkdir dir="${web_bin_path}" if="${not directory::exists(web_bin_path)}"
 />
    <copy todir="${web_bin_path}" overwrite="true">
      <fileset basedir="${build_path}">
        <include name="*.dll"/>
      </fileset>
    </copy>
    <copy todir="${web_bin_path}" overwrite="true">
      <fileset basedir="..\lib\">
        <include name="*.dll"/>
      </fileset>
    </copy>
    <copy todir="${web_path}" overwrite="true">
      <fileset>
        <include name="**.aspx"/>
        <include name="**.master"/>
        <include name="**.config"/>
        <include name="Config\**"/>
        <include name="IMG\**"/>
        <include name="App_Themes\**"/>
      </fileset>
    </copy>
  </target>
</project>


On Tue, Dec 9, 2008 at 4:15 PM, Bob Archer <[EMAIL PROTECTED]> wrote:

> This book is a must have for newbees and covers exactly what you are
> asking about.
>
> http://www.amazon.com/Expert-NET-Delivery-Using-CruiseControl-NET/dp/B00
> 1D7COTO/ref=sr_1_1?ie=UTF8&s=digital-text&qid=1228860888&sr=1-1<http://www.amazon.com/Expert-NET-Delivery-Using-CruiseControl-NET/dp/B001D7COTO/ref=sr_1_1?ie=UTF8&s=digital-text&qid=1228860888&sr=1-1>
>
> BOb
>
>
> -----Original Message-----
> From: LLCard [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 09, 2008 4:38 PM
> To: nant-users@lists.sourceforge.net
> Subject: [NAnt-users] Beginner Questions
>
>
> Hi Folks,
>
> I am just beginning to start using NAnt and CruiseControl.Net that I
> have
> set up on my home machine with an SVN repository using Apache.  I have a
> couple easy builds already working and can see them in CCTray.  I have
> added
> 2 projects to the ccnet.config file that point to 2 different build
> files in
> a build root folder.  My thoughts were to keep all build files at this
> build
> root level.  This is kool stuff.
>
> What I am hoping to do is find some examples of how others have made
> their
> build scripts resuable.  I cant seem to find examples out there so I am
> hoping there are some folks on here that would be willing to share their
> ccnet.config files and build files so I can look and use as examples or
> point me to a place where I can find this kind of information.
>
>
> Thanks
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Beginner-Questions-tp20882623p20882623.html
> Sent from the NAnt - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------
> ------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to
> help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
> com/<http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/>
> _______________________________________________
> NAnt-users mailing list
> NAnt-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> NAnt-users mailing list
> NAnt-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to