
@if {%1} == {} (
@echo please specify assembly directory
goto End
)

@if {%2} == {} (
@echo please specify output name
goto End
)

REM ********** Set path for .net framework2.0, sandcastle,hhc,hxcomp****************************

if exist output rmdir output /s /q
if exist chm rmdir chm /s /q

REM ********** generate reflection data files for .net framework2.0****************************
REM msbuild fxReflection.proj /Property:NetfxVer=2.0 /Property:PresentationStyle=vs2005

REM ********** Call MRefBuilder ****************************

call .\Sandcastle\ProductionTools\mrefbuilder.exe %1\*.dll /dep:.\Dependencies\*.dll /out:reflection.org

REM ********** Apply Transforms ****************************

call .\Sandcastle\ProductionTools\XslTransform /xsl:".\Sandcastle\ProductionTransforms\ApplyVSDocModel.xsl" reflection.org /xsl:".\Sandcastle\ProductionTransforms\AddFriendlyFilenames.xsl" /out:reflection.xml /arg:IncludeAllMembersTopic=true /arg:IncludeInheritedOverloadTopics=true

call .\Sandcastle\ProductionTools\XslTransform /xsl:".\Sandcastle\ProductionTransforms\ReflectionToManifest.xsl"  reflection.xml /out:manifest.xml

call ".\Sandcastle\Presentation\vs2005\copyOutput.bat"

REM ********** Call BuildAssembler ****************************
call .\Sandcastle\ProductionTools\BuildAssembler /config:".\sandcastle.config" manifest.xml

REM **************Generate an intermediate Toc file that simulates the Whidbey TOC format.

call .\Sandcastle\ProductionTools\XslTransform /xsl:".\Sandcastle\ProductionTransforms\createvstoc.xsl" reflection.xml /out:toc.xml 

REM ************ Generate CHM help project ******************************

if not exist chm mkdir chm
if not exist chm\html mkdir chm\html
if not exist chm\icons mkdir chm\icons
if not exist chm\scripts mkdir chm\scripts
if not exist chm\styles mkdir chm\styles
if not exist chm\media mkdir chm\media

xcopy output\icons\* chm\icons\ /y /r
xcopy output\media\* chm\media\ /y /r
xcopy output\scripts\* chm\scripts\ /y /r
xcopy output\styles\* chm\styles\ /y /r

call .\Sandcastle\ProductionTools\ChmBuilder.exe /project:%2 /html:Output\html /lcid:1033 /toc:Toc.xml /out:Chm

call .\Sandcastle\ProductionTools\DBCSFix.exe /d:Chm /l:1033 

call ".\hhc.exe" chm\%2.hhp

xcopy /Y .\chm\%2.chm .\
