You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docPublish.xml 2.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project DefaultTargets="build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <PropertyGroup>
  4. <WorkDir>C:\projects\CAP\</WorkDir>
  5. <webDir>C:\website\CAP\</webDir>
  6. <webName>dotnetcore.github.io</webName>
  7. <domainName>docs.dotnet-china.org</domainName>
  8. <baiduCode>Bh1NXh3smd</baiduCode>
  9. <webrepUrl>https://github.com/dotnetcore/dotnetcore.github.io</webrepUrl>
  10. <docfxPath>"$(WorkDir)docfx.json"</docfxPath>
  11. <templatePath>"$(WorkDir)_exported_templates\default"</templatePath>
  12. <sitePath>"$(WorkDir)_site"</sitePath>
  13. <sourcePath>$(WorkDir)</sourcePath>
  14. <pubsitePath>"$(webDir)$(webName)"</pubsitePath>
  15. <pdfresourcePath>"$(WorkDir)pdfresource"</pdfresourcePath>
  16. <SubDirName>cap</SubDirName>
  17. <ProjectDir>$(webDir)$(webName)\$(SubDirName)\</ProjectDir>
  18. </PropertyGroup>
  19. <Target Name="build">
  20. <CallTarget Targets="buildwebsite"/>
  21. <!-- <CallTarget Targets="buildPdf"/> -->
  22. <CallTarget Targets="pubish2githubIo"/>
  23. </Target>
  24. <Target Name="buildwebsite">
  25. <Message Text="Start to build website"></Message>
  26. <Exec Command="docfx build $(docfxPath) -t $(templatePath) " WorkingDirectory="$(WorkDir)" ></Exec>
  27. <Message Text="Build website successfully."></Message>
  28. <Message Text="Start to fix website files"></Message>
  29. <Exec Command="FixSite.exe $(sitePath) "></Exec>
  30. <Message Text="Fix website files"></Message>
  31. </Target>
  32. <Target Name="pubish2githubIo">
  33. <Exec Command="git clone --progress $(webrepUrl) " WorkingDirectory="$(webDir)" />
  34. <!-- <Exec Command="git rm * -r" WorkingDirectory="$(webDir)$(webName)" ></Exec> -->
  35. <RemoveDir Directories="$(ProjectDir)" />
  36. <MakeDir Directories="$(ProjectDir)"/>
  37. <Delete Files="$(ProjectDir)" />
  38. <Exec Command="xcopy.exe $(sitePath) $(ProjectDir) /e" />
  39. <!-- <Exec Command="echo $(domainName) > CNAME" WorkingDirectory="$(webDir)$(webName)" ></Exec>
  40. <Exec Command="echo $(baiduCode) > baidu_verify_Bh1NXh3smd.html" WorkingDirectory="$(webDir)$(webName)" ></Exec> -->
  41. <Exec Command="git add -A" WorkingDirectory="$(webDir)$(webName)" ></Exec>
  42. <Exec Command="git commit -m &quot;submit new website&quot;" WorkingDirectory="$(webDir)$(webName)" ></Exec>
  43. <Exec Command="git push --progress -u origin master " WorkingDirectory="$(webDir)$(webName)" ></Exec>
  44. </Target>
  45. <!-- <Target Name="buildPdf">
  46. <Exec Command="xcopy.exe $(pdfresourcePath) $(sourcePath) /e /s" />
  47. <Exec Command="docfx.exe pdf docfxpdf.json" WorkingDirectory="$(sourcePath)" />
  48. <Exec Command="move $(sourcePath)\_site-pdf\aspnetcore.pdf $(sourcePath)\_site\aspnet_core_doc_cn.pdf"/>
  49. </Target> -->
  50. </Project>