<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTarget="Build">
	<ItemGroup>
		<NDocFiles Include="ndoc\bin\*"/>
		<WixFiles Include="wix\*"/>
		<WixCaFiles Include="wix\ca\*"/>
		<WixDocFiles Include="wix\doc\*"/>
		<WixLibFiles Include="wix\doc\*"/>
		<MbUnitFiles Include="MbUnit\*"/>
		<HelpToolFiles Include="Help\*"/>
		<!-- <ToolProject Include="GacUtil2\GacUtil2.csproj" /> -->
		<ToolFiles Include="GacUtil2\GacUtil2.exe"/>
		<ToolFiles Include="GacUtil2\GacUtil2.exe.config"/>
	</ItemGroup>
	
	<Target Name="Build">
		<Copy SourceFiles="@(NDocFiles)" DestinationFolder="..\..\bin\Tools\NDoc"/>
		<!--
		<Copy SourceFiles="@(WixFiles)" DestinationFolder="..\..\bin\Tools\Wix"/>
		<Copy SourceFiles="@(WixCaFiles)" DestinationFolder="..\..\bin\Tools\Wix\ca"/>
		<Copy SourceFiles="@(WixDocFiles)" DestinationFolder="..\..\bin\Tools\Wix\doc"/>
		<Copy SourceFiles="@(WixLibFiles)" DestinationFolder="..\..\bin\Tools\Wix\lib"/>
		-->
		<Copy SourceFiles="@(MbUnitFiles)" DestinationFolder="..\..\bin\Tools\MbUnit"/>
		<Copy SourceFiles="@(ToolFiles)" DestinationFolder="..\..\bin\Tools"/>
		
		<!--
		<MSBuild Projects="@(ToolProject)" Targets="Build">
			<Output TaskParameter="TargetOutputs" ItemName="CompiledToolFiles" />
		</MSBuild>
		<Copy SourceFiles="@(CompiledToolFiles)" DestinationFolder="..\..\bin\Tools"/>
		-->
		
		<!--
		<CreateProperty Condition = "!Exists('..\..\bin\setup\help\register.bat')" Value="yes">
			<Output TaskParameter="Value" PropertyName="NeedToRunRegister" />
		</CreateProperty>
		<Copy SourceFiles="@(HelpToolFiles)" DestinationFolder="..\..\bin\setup\help"/>
		<Exec Command="register.bat" WorkingDirectory = "..\..\bin\setup\help" Timeout = "60000" IgnoreExitCode = "true" Condition = "'$(NeedToRunRegister)' == 'yes'" />
		-->
	</Target>
	
	<Target Name="Rebuild" DependsOnTargets="Clean;Build"/>
	
	<ItemGroup>
		<PrepareReleaseProject Include="SVNChangeLogToXml\SVNChangeLogToXml.csproj" />
	</ItemGroup>
	
	<Target Name="PrepareRelease">
		<MSBuild Projects="@(PrepareReleaseProject)" Targets="Build"/>
		<Exec Command="SVNChangelogToXml.exe --REVISION" WorkingDirectory = "SVNChangeLogToXml\bin\Release" Timeout = "60000" IgnoreExitCode = "false"/>
		<RemoveDir Directories="SVNChangeLogToXml\bin" />
		<RemoveDir Directories="SVNChangeLogToXml\obj" />
	</Target>
	
	<ItemGroup>
		<CleanupFiles Include="..\..\bin\*"/>
        <CleanupDirectories Include="..\..\bin\UnitTests"/>
		<CleanupDirectories Include="..\..\bin\Tools"/>
		<CleanupDirectories Include="..\..\bin\setup\help"/>
		<CleanupDirectories Include="..\..\AddIns\Addins"/>
		
		<!--<SpecialObjCleanupDirectories Include="..\**\obj\*.FileList.txt"/>-->
	</ItemGroup>
	
	<Target Name="Clean">
		<Exec Command="unregister.bat" WorkingDirectory="..\..\bin\setup\help" IgnoreExitCode = "true" Condition = "Exists('..\..\bin\setup\help\unregister.bat')"/>
		<RemoveDir Directories="@(SpecialObjCleanupDirectories->'%(RelativeDir)')" />
		<RemoveDir Directories="@(CleanupDirectories)" />
		<Delete Files="@(CleanupFiles)" />
	</Target>
</Project>
