diff --git a/build.cake b/build.cake index 96519e97..7e8b6ccc 100644 --- a/build.cake +++ b/build.cake @@ -14,6 +14,7 @@ var XamarinComponentToolPath = GetToolPath ("../xamarin-component.exe"); var CakeToolPath = GetToolPath ("Cake.exe"); var NUnitConsoleToolPath = GetToolPath ("../NUnit.Console/tools/nunit3-console.exe"); var GenApiToolPath = GetToolPath ("../genapi.exe"); +var MDocPath = GetMDocPath (); DirectoryPath ROOT_PATH = MakeAbsolute(File(".")).GetDirectory(); DirectoryPath DEPOT_PATH = MakeAbsolute(ROOT_PATH.Combine("depot_tools")); @@ -48,6 +49,21 @@ FilePath GetToolPath (FilePath toolPath) throw new FileNotFoundException ("Unable to find tool: " + appRootExe); } +FilePath GetMDocPath () +{ + FilePath mdocPath; + if (IsRunningOnUnix ()) { + mdocPath = "/Library/Frameworks/Mono.framework/Versions/Current/bin/mdoc"; + } else { + DirectoryPath progFiles = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86); + mdocPath = progFiles.CombineWithFilePath ("Mono/bin/mdoc.bat"); + } + if (!FileExists (mdocPath)) { + mdocPath = "mdoc"; + } + return mdocPath; +} + var RunNuGetRestore = new Action ((solution) => { NuGetRestore (solution, new NuGetRestoreSettings { @@ -128,22 +144,18 @@ var RunTests = new Action ((testAssembly) => var RunMdocUpdate = new Action ((assembly, docsRoot) => { - FilePath mdocPath; - if (IsRunningOnUnix ()) { - mdocPath = "/Library/Frameworks/Mono.framework/Versions/Current/bin/mdoc"; - } else { - DirectoryPath progFiles = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86); - mdocPath = progFiles.CombineWithFilePath ("Mono/bin/mdoc.bat"); - } - if (!FileExists (mdocPath)) { - mdocPath = "mdoc"; - } - - StartProcess (mdocPath, new ProcessSettings { + StartProcess (MDocPath, new ProcessSettings { Arguments = string.Format ("update --out=\"{0}\" \"{1}\"", docsRoot, assembly), }); }); +var RunMdocMSXml = new Action ((docsRoot, output) => +{ + StartProcess (MDocPath, new ProcessSettings { + Arguments = string.Format ("export-msxdoc --out=\"{0}\" \"{1}\"", output, docsRoot), + }); +}); + var ProcessSolutionProjects = new Action> ((solutionFilePath, process) => { var solutionFile = MakeAbsolute (solutionFilePath).FullPath; foreach (var line in FileReadLines (solutionFile)) { @@ -520,6 +532,9 @@ Task ("docs") .Does (() => { RunMdocUpdate ("./binding/SkiaSharp.Generic/bin/Release/SkiaSharp.dll", "./docs/en/"); + + if (!DirectoryExists ("./output/xml-docs/")) CreateDirectory ("./output/xml-docs/"); + RunMdocMSXml ("./docs/en/", "./output/xml-docs/SkiaSharp.xml"); }); ////////////////////////////////////////////////////////////////////////////////////////////////////