echo on

REM **************** Create GameTalk API Help Files ******************

mkdir .\Comments
mkdir .\Dependencies	
mkdir .\GameTalkApiDlls	
mkdir .\FileTalkApiDlls

REM Copy over all dependency dlls
xcopy /Y ..\..\tools\GameTalk\bin\Release\*.dll .\Dependencies
xcopy /Y ..\..\tools\GameTalk\bin\Release\*.xml .\Comments
xcopy /Y ..\..\tools\FileTalk\bin\Release\*.dll .\Dependencies
xcopy /Y ..\..\tools\FileTalk\bin\Release\*.xml .\Comments

REM Copy over dlls for the GameTalk Api documentation
xcopy /Y ..\..\tools\GameTalk\bin\Release\GameTalk.dll .\GameTalkApiDlls

REM Copy over dlls for the GameTalkMessage Api documentation
xcopy /Y ..\..\tools\GameTalk\bin\Release\GameTalkMessages.dll .\GameTalkApiDlls

REM Copy over dlls for the FileTalk Api documentation
xcopy /Y ..\..\tools\FileTalk\bin\Release\FileTalk.dll .\FileTalkApiDlls

REM Make sure source assemblies exist before creating docs
if exist .\Dependencies\GameTalk.dll (

	REM Create the help files
	call build_Sandcastle.bat .\GameTalkApiDlls GameTalkApi
	call build_Sandcastle.bat .\FileTalkApiDlls FileTalkApi
) ELSE (
	ECHO *** Error: source assemblies do not exist, failed to to create api documentation ***
)


REM Remove all temporary files\directories
rmdir /S /Q .\Comments
rmdir /S /Q .\Dependencies
rmdir /S /Q .\GameTalkApiDlls
rmdir /S /Q .\FileTalkApiDlls
rmdir /S /Q .\chm
rmdir /S /Q .\output
rmdir /S /Q .\intellisense

del toc.xml
del reflection.xml
del reflection.org
del manifest.xml
