<?xml version="1.0" encoding="utf-8"?>
<project name="Copy Directory Tree" default="help" basedir="." xmlns="http://nant.sf.net/release/0.85/nant.xsd">
  <property name="out.root" value="${path::combine('.', 'build.out')}" />
  <property name="exe.name" value="tenoritool"/>
  <property name="debug" value="None"/>
  <property name="unit.tests" value="off" readonly="false" overwrite="true"/>
  <property name="define" value=""/>
  <property name="src.root" value="${path::combine('..', 'src')}" />
  <property name="ref.root" value="${path::combine('..', 'lib')}" />
  
  <target name="help">
    <echo message="allowed targets"/>
    <echo message=" help - displays this help"/>
    <echo message=" clean - cleans build output files"/>
    <echo message=" build - builds the executable"/>
    <echo message=" tests - builds the executable including unit tests classes"/>
    <echo message="         (namespace: tenoritool.Tests)"/>
    <echo message=""/>
    <echo message="in case of problems please email to:"/>
    <echo message="gsscoder@ymail.com"/>
  </target>
  
  <target name="clean">
    <delete dir="${out.root}" if="${directory::exists(out.root)}" verbose="true" />
  </target>

  <target name="tests">
    <property name="debug" value="Full"/>
    <property name="define" value="UNIT_TESTS"/>
    <property name="unit.tests" value="on"/>
    <call target="build"/>
  </target>
  
  <target name="build" depends="clean">
    <mkdir dir="${out.root}"/>
    <csc target="exe" output="${out.root}/${exe.name}.exe"
         debug="${debug}" define="${define}" verbose="true">
      <references>
        <include name="System.dll"/>
	<include name="${path::combine(ref.root,'nunit.framework.dll')}" if="${property::get-value('unit.tests')=='on'}"/>
        <include name="${path::combine(ref.root,'Mono.Posix.dll')}" />
      </references>
      <sources basedir="${src.root}">
        <include name="Properties/*.cs"/>
        <include name="Tests/*.cs" if="${property::get-value('unit.tests')=='on'}"/>
        <include name="Core/*.cs"/>
        <include name="TenoriTool.cs"/>
        <include name="CommandLine/*.cs"/>
        <include name="CommandLine/Tests/*.cs" if="${property::get-value('unit.tests')=='on'}"/>
      </sources>
    </csc>
  </target>
  
</project>
