[docs] [build] Added the MS XML docs as part of the outputs

This commit is contained in:
Matthew Leibowitz 2016-02-29 19:41:34 +02:00
Родитель 4fa751314a
Коммит e8c6373fb9
1 изменённых файлов: 27 добавлений и 12 удалений

Просмотреть файл

@ -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<FilePath> ((solution) =>
{
NuGetRestore (solution, new NuGetRestoreSettings {
@ -128,22 +144,18 @@ var RunTests = new Action<FilePath> ((testAssembly) =>
var RunMdocUpdate = new Action<FilePath, DirectoryPath> ((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<DirectoryPath, FilePath> ((docsRoot, output) =>
{
StartProcess (MDocPath, new ProcessSettings {
Arguments = string.Format ("export-msxdoc --out=\"{0}\" \"{1}\"", output, docsRoot),
});
});
var ProcessSolutionProjects = new Action<FilePath, Action<string, FilePath>> ((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");
});
////////////////////////////////////////////////////////////////////////////////////////////////////