mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-04-05 22:01:04 +00:00
Pre-generate API reference pages before dotnet publish
MSBuild evaluates **/*.razor globs at project evaluation time, before targets run. The GenerateApiPages target creates .razor files too late for them to be compiled on a clean build, resulting in a 13KB DLL with no pages instead of 27MB. Fix by running the generator in a separate step so files exist on disk before publish.
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -20,11 +20,16 @@ RUN dotnet restore RadzenBlazorDemos.Host/RadzenBlazorDemos.Host.csproj \
|
|||||||
# Copy full source after restore layer
|
# Copy full source after restore layer
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Publish the Blazor host app (API reference pages are generated at build time via MSBuild target)
|
# Pre-generate API reference pages (must exist on disk before publish evaluates globs)
|
||||||
|
RUN dotnet build Radzen.Blazor/Radzen.Blazor.csproj -c Release \
|
||||||
|
&& dotnet run --project Radzen.Blazor.Api.Generator -- \
|
||||||
|
Radzen.Blazor/bin/Release/net10.0/Radzen.Blazor.dll \
|
||||||
|
Radzen.Blazor/bin/Release/net10.0/Radzen.Blazor.xml \
|
||||||
|
Radzen.Blazor.Api/Generated/Pages
|
||||||
|
|
||||||
|
# Publish the Blazor host app (generated pages are now on disk for the SDK to discover)
|
||||||
WORKDIR /src/RadzenBlazorDemos.Host
|
WORKDIR /src/RadzenBlazorDemos.Host
|
||||||
RUN dotnet publish -c Release -o /app/out \
|
RUN dotnet publish -c Release -o /app/out
|
||||||
&& test -f /app/out/Radzen.Blazor.Api.dll \
|
|
||||||
&& echo "API reference assembly found in publish output"
|
|
||||||
|
|
||||||
|
|
||||||
# =============================
|
# =============================
|
||||||
|
|||||||
Reference in New Issue
Block a user