<?xml version="1.0"?>

<project name="Bank" default="test">
	
	<!-- compile the test task and add it then use it -->
	<!-- this currently will only work in the global section of the build file -->
	<csc target="library" output="Bank.Test.dll">
		<sources>			
			<includes name="AssemblyInfo.cs"/>
			<includes name="Bank.cs"/>
			<includes name="BankTest.cs"/>
		</sources>	
		<references basedir="${nant.location}">
			<includes name="NAnt.Core.dll"/>
			<includes name="nunit.framework.dll"/>
		</references>
	
	</csc>

	<!-- 
		The test task is referenced in the newly created Bank.dll but can 
		only be referenced in a target.

		This should change in the future but its probally not that common to 
		build your task AND	use it in the SAME build file.
	-->
	
	<target name="test">
		<!-- call our new task, converts the message attribute to all caps and displays it -->
		<!--copy todir="${nant.location}" file="Bank.Test.dll"/-->
		<!--nant target="Bank"/-->
		<nunit2>
		 	<test assemblyname="Bank.Tests.dll" outfile="results.xml"/>
	     </nunit2> 	
	</target>
	
	<target name="Bank">
		
	</target>

	<target name="clean">
		<echo message="Cannot clean because we are refering to Bank.Test.dll"/>
		<echo message="Just delete the Bank.dll in this folder"/>
		<echo message="This will change once we can have taskdef tasks nested in targets"/>
	</target>
</project>