Skip to content

Commit 94a821f

Browse files
committed
Add temporary workaround until docfx version is available that is compatible with .NET 10
1 parent 7d86a96 commit 94a821f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ api/*.yml
33
api/.manifest
44
request-examples/*.json
55
request-examples/*.temp
6+
docfx-net10-binaries/

docs/build-dev.ps1

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,25 @@ param(
99
[switch] $NoOpen=$False
1010
)
1111

12+
# workaround for bug at https://github.com/PowerShell/PowerShell/issues/23875#issuecomment-2672336383
13+
$PSDefaultParameterValues['Remove-Item:ProgressAction'] = 'SilentlyContinue'
14+
1215
function VerifySuccessExitCode {
1316
if ($LastExitCode -ne 0) {
1417
throw "Command failed with exit code $LastExitCode."
1518
}
1619
}
1720

21+
function EnsureDocfxBinaries() {
22+
# Temporary workaround until a proper DocFX build supporting .NET 10 is available.
23+
$zipFile = [IO.Path]::Combine($env:TEMP, 'docfx-net10-binaries.zip')
24+
25+
if (!(Test-Path -Path $zipFile)) {
26+
Invoke-WebRequest -Uri 'https://github.com/json-api-dotnet/docfx/raw/refs/heads/dotnet10-rtm/net10-binaries.zip' -Method 'GET' -OutFile $zipFile
27+
Expand-Archive $zipFile -Force
28+
}
29+
}
30+
1831
function EnsureHttpServerIsInstalled {
1932
if ((Get-Command "npm" -ErrorAction SilentlyContinue) -eq $null) {
2033
throw "Unable to find npm in your PATH. please install Node.js first."
@@ -25,9 +38,13 @@ function EnsureHttpServerIsInstalled {
2538

2639
if ($LastExitCode -eq 1) {
2740
npm install -g httpserver
41+
VerifySuccessExitCode
2842
}
2943
}
3044

45+
EnsureDocfxBinaries
46+
VerifySuccessExitCode
47+
3148
EnsureHttpServerIsInstalled
3249
VerifySuccessExitCode
3350

@@ -46,7 +63,7 @@ dotnet tool restore
4663
VerifySuccessExitCode
4764

4865
$env:DOCFX_SOURCE_BRANCH_NAME="dev"
49-
dotnet docfx ./docfx.json --warningsAsErrors true
66+
docfx-net10-binaries/docfx ./docfx.json --warningsAsErrors true
5067
VerifySuccessExitCode
5168

5269
Copy-Item -Force home/*.html _site/

0 commit comments

Comments
 (0)