forked from stride3d/stride-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
en-build.ps1
55 lines (49 loc) · 1.25 KB
/
en-build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
param (
[switch]$API
)
# Remove build.log file
If(Test-Path build.log)
{
Remove-Item build.log
}
Start-Transcript -Path build.log
# Generate API doc
if ($API)
{
Write-Host "Generating API documentation..."
# Run MSBuild restore
$msbuild = & ("${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe") -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
& $msbuild ..\stride\build\Stride.sln /t:Restore
if ($LastExitCode -ne 0)
{
Write-Host "Failed to restore nuget packages"
exit $LastExitCode
}
# Build metadata from C# source
deps\docfx\docfx.exe metadata en/docfx.json
if ($LastExitCode -ne 0)
{
Write-Host "Failed to generate API metadata"
exit $LastExitCode
}
}
else
{
If(Test-Path en/api/.manifest)
{
Write-Host "Erasing API documentation..."
Remove-Item en/api/*yml -recurse
Remove-Item en/api/.manifest
}
}
Write-Host "Generating documentation..."
# Output to both build.log and console
deps\docfx\docfx.exe build en\docfx.json
if ($LastExitCode -ne 0)
{
Write-Host "Failed to build doc"
exit $LastExitCode
}
# Copy extra items
Copy-Item en/ReleaseNotes/ReleaseNotes.md _site/en/ReleaseNotes/
Stop-Transcript