Files
Umbraco-CMS/build/build-docs.ps1

45 lines
1.2 KiB
PowerShell
Raw Normal View History

2019-04-28 21:14:32 +02:00
$uenv=build/build.ps1 -get
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
$src = "$($uenv.SolutionRoot)\src"
$tmp = $uenv.BuildTemp
$out = $uenv.BuildOutput
$DocFxJson = "$src\ApiDocs\docfx.json"
$DocFxSiteOutput = "$tmp\_site\*.*"
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
################ Do the UI docs
$uenv.CompileBelle()
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
"Moving to Umbraco.Web.UI.Client folder"
cd .\src\Umbraco.Web.UI.Client
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
"Generating the docs and waiting before executing the next commands"
& gulp docs | Out-Null
2019-04-15 22:04:55 +02:00
# change baseUrl
2019-05-01 15:22:10 +02:00
$BaseUrl = "https://our.umbraco.com/apidocs/v8/ui/"
2019-04-28 21:14:32 +02:00
$IndexPath = "./docs/api/index.html"
2019-04-15 22:04:55 +02:00
(Get-Content $IndexPath).replace('location.href.replace(rUrl, indexFile)', "`'" + $BaseUrl + "`'") | Set-Content $IndexPath
2019-04-28 21:14:32 +02:00
# zip it
& $uenv.BuildEnv.Zip a -tzip -r "$out\ui-docs.zip" "$src\Umbraco.Web.UI.Client\docs\api\*.*"
2019-04-15 22:04:55 +02:00
################ Do the c# docs
# Build the solution in debug mode
2019-04-28 21:14:32 +02:00
$SolutionPath = Join-Path -Path $src -ChildPath "umbraco.sln"
#$uenv.CompileUmbraco()
2019-04-15 22:04:55 +02:00
#restore nuget packages
2019-04-28 21:14:32 +02:00
$uenv.RestoreNuGet()
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
# run DocFx
$DocFx = $uenv.BuildEnv.DocFx
2019-04-15 22:04:55 +02:00
2019-04-28 21:14:32 +02:00
Write-Host "$DocFxJson"
2019-04-15 22:04:55 +02:00
& $DocFx metadata $DocFxJson
2019-04-28 21:14:32 +02:00
& $DocFx build $DocFxJson
2019-04-15 22:04:55 +02:00
# zip it
2019-04-28 21:14:32 +02:00
& $uenv.BuildEnv.Zip a -tzip -r "$out\csharp-docs.zip" $DocFxSiteOutput