Skip to content

Commit

Permalink
Use "dotnet tool" instead of "0install" to get docfx
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Dec 27, 2023
1 parent 7080393 commit 9906337
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.74.1",
"commands": [
"docfx"
]
}
}
}
10 changes: 8 additions & 2 deletions doc/build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot

..\0install.ps1 run --batch https://apps.0install.net/dotnet/docfx.xml --logLevel=warning --warningsAsErrors docfx.json
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
function Run-DotNet {
..\0install.ps1 run --batch --version 6.0.. https://apps.0install.net/dotnet/sdk.xml @args
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
}

# Build docs
Run-DotNet tool restore
Run-DotNet docfx --logLevel=warning --warningsAsErrors docfx.json

popd
11 changes: 10 additions & 1 deletion doc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@
set -e
cd `dirname $0`

../0install.sh run https://apps.0install.net/dotnet/docfx.xml --logLevel=warning --warningsAsErrors docfx.json
# Find dotnet
if command -v dotnet > /dev/null 2> /dev/null; then
dotnet="dotnet"
else
dotnet="../0install.sh run --version 6.0.. https://apps.0install.net/dotnet/sdk.xml"
fi

# Build docs
$dotnet tool restore
$dotnet docfx --logLevel=warning --warningsAsErrors docfx.json

0 comments on commit 9906337

Please sign in to comment.