This commit is contained in:
Wiesław Šoltés 2016-09-01 09:53:38 +02:00 коммит произвёл GitHub
Родитель 4bf4316a7a
Коммит 55a4a9603d
1 изменённых файлов: 28 добавлений и 0 удалений

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

@ -4,12 +4,14 @@
#addin "nuget:?package=Polly&version=4.2.0"
#addin "nuget:?package=NuGet.Core&version=2.12.0"
#addin "nuget:?package=Cake.DocFx&version=0.1.6"
///////////////////////////////////////////////////////////////////////////////
// TOOLS
///////////////////////////////////////////////////////////////////////////////
#tool "nuget:?package=xunit.runner.console&version=2.1.0"
#tool "nuget:?package=docfx.msbuild&version=2.4.0"
///////////////////////////////////////////////////////////////////////////////
// USINGS
@ -40,6 +42,7 @@ var ReleasePlatform = "Any CPU";
var ReleaseConfiguration = "Release";
var MSBuildSolution = "./ReactiveHistory.sln";
var XBuildSolution = "./ReactiveHistory.sln";
var DocFxProject = "./docs/docfx.json";
///////////////////////////////////////////////////////////////////////////////
// PARAMETERS
@ -89,6 +92,7 @@ if (isRunningOnAppVeyor)
var artifactsDir = (DirectoryPath)Directory("./artifacts");
var testResultsDir = artifactsDir.Combine("test-results");
var nugetRoot = artifactsDir.Combine("nuget");
var docsRoot = artifactsDir.Combine("docs");
var dirSuffix = isPlatformAnyCPU ? configuration : platform + "/" + configuration;
@ -225,6 +229,7 @@ Task("Clean")
CleanDirectory(artifactsDir);
CleanDirectory(testResultsDir);
CleanDirectory(nugetRoot);
CleanDirectory(docsRoot);
});
Task("Restore-NuGet-Packages")
@ -309,6 +314,16 @@ Task("Run-Unit-Tests")
}
});
Task("Create-Docs")
.IsDependentOn("Run-Unit-Tests")
.Does(() =>
{
DocFxMetadata(DocFxProject);
DocFxBuild(DocFxProject, new DocFxBuildSettings() {
OutputPath = docsRoot
});
});
Task("Create-NuGet-Packages")
.IsDependentOn("Run-Unit-Tests")
.Does(() =>
@ -330,6 +345,18 @@ Task("Upload-AppVeyor-Artifacts")
}
});
Task("Publish-Docs")
.IsDependentOn("Create-Docs")
.WithCriteria(() => !isLocalBuild)
.WithCriteria(() => !isPullRequest)
.WithCriteria(() => isMainRepo)
.WithCriteria(() => isMasterBranch)
.WithCriteria(() => isNuGetRelease)
.Does(() =>
{
// TODO
}
Task("Publish-MyGet")
.IsDependentOn("Create-NuGet-Packages")
.WithCriteria(() => !isLocalBuild)
@ -410,6 +437,7 @@ Task("Default")
Task("AppVeyor")
.IsDependentOn("Upload-AppVeyor-Artifacts")
.IsDependentOn("Publish-Docs")
.IsDependentOn("Publish-MyGet")
.IsDependentOn("Publish-NuGet");