Files
radzen-blazor/Radzen.Blazor.Api/Radzen.Blazor.Api.csproj
Atanas Korchev cf4a3feded Speed up website deploy: generate API docs from the Radzen.Blazor package
The Docker deploy compiled Radzen.Blazor from source (3 target frameworks
plus Sass and Terser) only to feed the API reference generator, even though
the deployed site ships the published Radzen.Blazor NuGet package. Generate
the API docs and llms.txt from that same package and drop the source build.

- Radzen.Blazor.Api: reference the Radzen.Blazor package in Release (source
  project in Debug), like RadzenBlazorDemos already does; the generator reads
  the package dll/xml.
- RadzenBlazorDemos: GenerateLlmsTxt reads the package XML in Release so the
  LLM docs keep their API descriptions.
- Dockerfile: restore for Release, drop the Radzen.Blazor source build,
  generate API pages from the restored package, set NUGET_XMLDOC_MODE=none so
  the package XML is extracted.
- Add .dockerignore to keep .git/bin/obj out of the build context.
- deploy.yml: shallow checkout (fetch-depth 1).
2026-06-24 20:25:11 +03:00

40 lines
2.2 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Radzen.Blazor" Version="*" GeneratePathProperty="true" Condition="'$(Configuration)' == 'Release'" />
<ProjectReference Include="..\Radzen.Blazor\Radzen.Blazor.csproj" Condition="'$(Configuration)' != 'Release'" />
</ItemGroup>
<PropertyGroup>
<GeneratorProject>$(MSBuildThisFileDirectory)..\Radzen.Blazor.Api.Generator\Radzen.Blazor.Api.Generator.csproj</GeneratorProject>
<GeneratedPagesDir>$(MSBuildThisFileDirectory)Generated\Pages</GeneratedPagesDir>
</PropertyGroup>
<!-- Release reflects over the published package (what the site ships); Debug over the source build. -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<RadzenBlazorDll>$(PkgRadzen_Blazor)/lib/net10.0/Radzen.Blazor.dll</RadzenBlazorDll>
<RadzenBlazorXml>$(PkgRadzen_Blazor)/lib/net10.0/Radzen.Blazor.xml</RadzenBlazorXml>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Release'">
<RadzenBlazorDll>$(MSBuildThisFileDirectory)..\Radzen.Blazor\bin\$(Configuration)\net10.0\Radzen.Blazor.dll</RadzenBlazorDll>
<RadzenBlazorXml>$(MSBuildThisFileDirectory)..\Radzen.Blazor\bin\$(Configuration)\net10.0\Radzen.Blazor.xml</RadzenBlazorXml>
</PropertyGroup>
<!-- Usage: dotnet build -p:GenerateApiPages=true -->
<Target Name="GenerateApiPages" BeforeTargets="ResolveProjectStaticWebAssets;AssignTargetPaths"
Inputs="$(RadzenBlazorDll)"
Outputs="$(GeneratedPagesDir)\ApiIndex.razor"
Condition="Exists('$(RadzenBlazorDll)') AND ('$(Configuration)' == 'Release' OR '$(GenerateApiPages)' == 'true')">
<Message Text="Generating API reference pages..." Importance="high" />
<MakeDir Directories="$(GeneratedPagesDir)" />
<Exec Command="dotnet run --project &quot;$(GeneratorProject)&quot; -- &quot;$(RadzenBlazorDll)&quot; &quot;$(RadzenBlazorXml)&quot; &quot;$(GeneratedPagesDir)&quot;"
ContinueOnError="false" />
<Message Text="API reference pages generated in $(GeneratedPagesDir)" Importance="high" />
</Target>
</Project>