<?xml version="1.0" ?>
<!--

Rebuilding Solutions using Nant and "solutions.build":

1) Move Spring.Calculator.snk -> $root/Spring.Calculator.snk

2) Create virtual directories in IIS

   /Spring.Calculator.2003 -> $root\examples\Spring\Spring.Calculator\src\Spring.Calculator.Web.2003
   /SpringAir.2003 -> $root\examples\Spring\SpringAir\src\SpringAir.Web.2003

3) Place solutions.build into $root/Solutions.build

4) execute "nant -f:solutions.build"

5) SpringAir.2003 unfort. doesn't work with this script :-(( - You need to check it manually (I'm working on it...)

-->
<project name="Spring.NET Examples" default="RebuildAllSolutions">

  <property name="root.dir" value="${project::get-base-directory()}\.." overwrite="false" />
  <property name="buildconfiguration" value="Debug" />

  <target name="RebuildAllSolutions" description="Rebuild all Solutions">
    <foreach item="File" property="filename">
      <in>
        <items basedir="${root.dir}">
          <include name="*.sln" />
          <include name="examples/**/*.sln" />
          <exclude name="examples/**/Spring.EmsQuickStart/*" />
          <exclude name="examples/**/Spring.Examples.Pool/*" />
          <exclude name="examples/**/SpringAir/*" />
          <exclude name="examples/**/Spring.WebQuickStart/*" />
        </items>
      </in>
      <do>
        <property name="solutionfile" value="${filename}" />
        <property name="solutionconfiguration" value="${buildconfiguration}" />
        <call target="RebuildSolution" />
      </do>
    </foreach>
  </target>

  <target name="Clean">
    <foreach item="Folder" property="dirname">
      <in>
        <items basedir="${root.dir}">
          <include name="examples/**/obj" />
          <include name="examples/**/PreCompiledWeb" />
          <include name="build/VS.NET.*" />
        </items>
      </in>
      <do>
        <delete dir="${dirname}" failonerror="false"/>
        <sleep seconds="2"/>
        <delete dir="${dirname}" />
      </do>
    </foreach>
    <delete>
      <fileset basedir="${root.dir}">
        <include name="examples/**/bin/**/*.*" />
        <exclude name="examples/**/bin/*.refresh" />
      </fileset>
    </delete>
  </target>
  
  <target name="RebuildSolution" description="rebuilds a given solution file">
    <echo message="Rebuilding Solution ${solutionfile}" />
    <exec program="${msbuild.exe}" verbose="true">
      <arg value="${solutionfile}"/>
      <arg line="/v:m" />
      <arg line="/t:Restore" />
      <arg line="/m" />
      <arg line="/nr:false" />
    </exec>
    <exec program="${msbuild.exe}" verbose="true">
      <arg value="${solutionfile}"/>
      <arg line="/v:m" />
      <arg line="/m" />
      <arg line="/nr:false" />
      <arg line="/property:Configuration=${solutionconfiguration}"/>
      <!--Specifying mandatory property in SDK 7-->
      <arg line='/property:Platform="Any CPU"'/>
    </exec>
  </target> 
  
</project>
