<?xml version="1.0" ?>
<project name="ndoc" default="compile-release" xmlnds="http://tempuri.org/nant-vs.xsd">
	<!-- Global project settings -->
	<property name="project.name" value="ndoc" />
	<property name="project.version" value="1.2" />
	<property name="project.build.config" value="debug" readonly="false" />
	<property name="project.build.package" value="false" readonly="false" />
	<property name="build.dir" value="${nant.project.basedir}/bin"
		readonly="false" />
	<!-- Include helpers -->
	<include buildfile="NDoc.build.include" />
	<include buildfile="NDoc.build.package" />
	<!-- Targets that should always be executed -->
	<call target="set-build-configuration" force="true" />
	<call target="set-runtime-configuration" force="true" />
	<!--

	-->
	<target name="compile-debug" description="Compile for all runtime configurations in debug mode.">
		<echo message="Compiling for all runtime configurations in debug mode." />
		<call target="set-debug-build-configuration" force="true" />
		<call target="compile-build" force="true" />
	</target>
	<!--

	-->
	<target name="compile-release" description="Compile for all runtime configurations in release mode.">
		<echo message="Compiling for all runtime configurations in release mode." />
		<call target="set-release-build-configuration" force="true" />
		<call target="compile-build" force="true" />
	</target>
	<!--

	-->
	<target name="compile-build" description="Compile current build configuration for all runtime configurations">
		<echo message="Compiling all runtime configurations for the ${current.build.config} build configuration." />
		<!-- 
		
		build .NET Framework 1.0 version if both the Framework and SDK are available 
		-->
		<available type="Framework" resource="net-1.0" property="temp.framework.available" />
		<if propertytrue="temp.framework.available">
			<available type="FrameworkSDK" resource="net-1.0" property="temp.frameworksdk.available" />
			<if propertytrue="temp.frameworksdk.available">
				<call target="set-net-1.0-runtime-configuration" force="true" />
				<call target="compile" force="true" />
			</if>
			<ifnot propertytrue="temp.frameworksdk.available">
				<if propertyexists="project.build.package" propertytrue="project.build.package">
					<fail message="The .NET Framework SDK 1.0 is not available." />
				</if>
				<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
					<echo message="The .NET Framework SDK 1.0 is not available. Build skipped." />
				</ifnot>
			</ifnot>
		</if>
		<ifnot propertytrue="temp.framework.available">
			<if propertyexists="project.build.package" propertytrue="project.build.package">
				<fail message="The .NET Framework 1.0 is not available." />
			</if>
			<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
				<echo message="The .NET Framework 1.0 is not available. Build skipped." />
			</ifnot>
		</ifnot>
		<!-- 
		
		build .NET Framework 1.0 version if both Framework and SDK are available 
		-->
		<available type="Framework" resource="net-1.1" property="temp.framework.available" />
		<if propertytrue="temp.framework.available">
			<available type="FrameworkSDK" resource="net-1.1" property="temp.frameworksdk.available" />
			<if propertytrue="temp.frameworksdk.available">
				<call target="set-net-1.1-runtime-configuration" force="true" />
				<call target="compile" force="true" />
			</if>
			<ifnot propertytrue="temp.frameworksdk.available">
				<if propertyexists="project.build.package" propertytrue="project.build.package">
					<fail message="The .NET Framework SDK 1.1 is not available." />
				</if>
				<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
					<echo message="The .NET Framework SDK 1.1 is not available. Build skipped." />
				</ifnot>
			</ifnot>
		</if>
		<ifnot propertytrue="temp.framework.available">
			<if propertyexists="project.build.package" propertytrue="project.build.package">
				<fail message="The .NET Framework 1.1 is not available." />
			</if>
			<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
				<echo message="The .NET Framework 1.1 is not available. Build skipped." />
			</ifnot>
		</ifnot>
		<!-- 
		
		build Mono 1.0 version if both Framework and SDK are available 
		-->
		<available type="Framework" resource="mono-1.0" property="temp.framework.available" />
		<if propertytrue="temp.framework.available">
			<available type="FrameworkSDK" resource="mono-1.0" property="temp.frameworksdk.available" />
			<if propertytrue="temp.frameworksdk.available">
				<call target="set-mono-1.0-runtime-configuration" force="true" />
				<call target="compile" force="true" />
			</if>
			<ifnot propertytrue="temp.frameworksdk.available">
				<if propertyexists="project.build.package" propertytrue="project.build.package">
					<fail message="The Mono SDK 1.0 is not available." />
				</if>
				<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
					<echo message="The Mono SDK 1.0 is not available. Build skipped." />
				</ifnot>
			</ifnot>
		</if>
		<ifnot propertytrue="temp.framework.available">
			<if propertyexists="project.build.package" propertytrue="project.build.package">
				<fail message="Mono 1.0 is not available." />
			</if>
			<ifnot propertyexists="project.build.package" propertytrue="project.build.package">
				<echo message="Mono 1.0 is not available. Build skipped." />
			</ifnot>
		</ifnot>
	</target>
	<!--

	-->
	<target name="compile" description="Builds the current build configuration for the current runtime configuration.">
		<!-- ensure the bin dir has been created, and clean it up if needed -->
		<call target="clean-current-bin-dir" force="true" />
		<!-- copy the ndoc signing key file to the bin dir -->
		<copy file="${nant.project.basedir}/src/ndoc.snk" todir="${current.bin.dir}" />
		<!-- build all projects -->
		<nant buildfile="src/Core/Core.build" target="compile" inheritall="true" />
		<nant buildfile="src/Console/Console.build" target="compile" inheritall="true" />
		<nant buildfile="src/VisualStudio/VisualStudio.build" target="compile" inheritall="true" />
		<nant buildfile="src/Gui/Gui.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/Msdn/Msdn.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/HtmlHelp2/HtmlHelp2.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/JavaDoc/JavaDoc.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/Latex/Latex.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/LinearHtml/LinearHtml.build" target="compile" inheritall="true" />
		<nant buildfile="src/Documenter/Xml/Xml.build" target="compile" inheritall="true" />
		<nant buildfile="src/Test/Test.build" target="compile" inheritall="true" if="${current.runtime.net-1.1}" />
		<!-- remove the ndoc signing key file -->
		<delete file="${current.bin.dir}/ndoc.snk" />
	</target>
	<!--



	those targets are to help debugging ndoc on mono::

	-->
	<target name="mono" description="Builds on mono::">
		<call target="set-mono-1.0-runtime-configuration" force="true" />
		<call target="compile" force="true" />
	</target>
	<!--

	-->
	<target name="mono-core" description="Builds Core on mono::">
		<call target="set-mono-1.0-runtime-configuration" force="true" />
		<call target="clean-current-bin-dir" force="true" />
		<nant buildfile="src/Core/Core.build" target="compile" inheritall="true" />
	</target>
	<!--

	-->
	<target name="mono-msdn" description="Builds the msdn documenter on mono::">
		<call target="set-mono-1.0-runtime-configuration" force="true" />
		<call target="clean-current-bin-dir" force="true" />
		<nant buildfile="src/Documenter/Msdn/Msdn.build" target="compile" inheritall="true" />
	</target>
</project>
