Skip to content

Commit 9ef0193

Browse files
authored
chore: add runtime NuGet package metadata (#355)
1 parent 3d84bf4 commit 9ef0193

4 files changed

Lines changed: 45 additions & 3 deletions

File tree

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ The `@microsoft/webui` npm package follows the esbuild single-package model:
15311531

15321532
The `Microsoft.WebUI` package is the managed .NET binding for `webui-ffi`. It targets `net8.0` and `net9.0`, packs `dotnet/src/Microsoft.WebUI/README.md`, and publishes XML documentation generated from public API comments.
15331533

1534-
Native assets are split into `Microsoft.WebUI.Runtime.<rid>` packages for each supported RID. The managed package references every runtime package so NuGet restores them transitively; .NET then resolves `webui_ffi` from the matching `runtimes/<rid>/native` asset. `WEBUI_LIB_PATH` remains the override for custom local native builds.
1534+
Native assets are split into `Microsoft.WebUI.Runtime.<rid>` packages for each supported RID. The runtime packages share `dotnet/runtime/README.md`, include NuGet release notes pointing to the GitHub release notes, and carry the matching `runtimes/<rid>/native` asset. The managed package references every runtime package so NuGet restores them transitively; .NET then resolves `webui_ffi` from the matching native asset. `WEBUI_LIB_PATH` remains the override for custom local native builds.
15351535

15361536
`dotnet/Directory.Build.props` applies repository metadata, Source Link, and `.snupkg` symbol package generation to packable .NET projects. `cargo xtask publish` runs `dotnet pack` on `dotnet/Microsoft.WebUI.sln` and stages both `.nupkg` and `.snupkg` files under `publish/nuget`.
15371537

dotnet/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<PackageTags>webui</PackageTags>
1818
<!-- PackageIcon will be set once an approved 128x128 transparent PNG is available. -->
1919
</PropertyGroup>
20+
<PropertyGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').StartsWith('Microsoft.WebUI.Runtime.'))">
21+
<IsWebUIRuntimePackage>true</IsWebUIRuntimePackage>
22+
<PackageReadmeFile>README.md</PackageReadmeFile>
23+
<PackageReleaseNotes>WebUI native runtime assets for this release. See https://github.com/microsoft/webui/releases for release notes.</PackageReleaseNotes>
24+
<PackageTags>webui dotnet native runtime ffi server-side-rendering</PackageTags>
25+
</PropertyGroup>
2026
<ItemGroup Condition="'$(MSBuildProjectName)' != 'Microsoft.WebUI.Tests'">
2127
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2228
</ItemGroup>

dotnet/Directory.Build.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Project>
2-
<ItemGroup Condition="'$(PackageReadmeFile)' != '' and Exists('$(MSBuildProjectDirectory)\$(PackageReadmeFile)')">
3-
<None Include="$(MSBuildProjectDirectory)\$(PackageReadmeFile)" Pack="true" PackagePath="/" />
2+
<PropertyGroup>
3+
<PackageReadmeSourceFile Condition="'$(PackageReadmeFile)' != '' and Exists('$(MSBuildProjectDirectory)/$(PackageReadmeFile)')">$(MSBuildProjectDirectory)/$(PackageReadmeFile)</PackageReadmeSourceFile>
4+
<PackageReadmeSourceFile Condition="'$(PackageReadmeSourceFile)' == '' and '$(PackageReadmeFile)' != '' and '$(IsWebUIRuntimePackage)' == 'true' and Exists('$(MSBuildThisFileDirectory)runtime/$(PackageReadmeFile)')">$(MSBuildThisFileDirectory)runtime/$(PackageReadmeFile)</PackageReadmeSourceFile>
5+
</PropertyGroup>
6+
<ItemGroup Condition="'$(PackageReadmeSourceFile)' != ''">
7+
<None Include="$(PackageReadmeSourceFile)" Pack="true" PackagePath="/" />
48
</ItemGroup>
59
</Project>

dotnet/runtime/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Microsoft.WebUI.Runtime
2+
3+
Native runtime packages for Microsoft.WebUI.
4+
5+
`Microsoft.WebUI.Runtime.<rid>` packages carry the RID-specific `webui_ffi` native library under `runtimes/<rid>/native`. They do not contain managed APIs. The managed `Microsoft.WebUI` package depends on these runtime packages so NuGet restores the native asset for each supported platform.
6+
7+
Most applications should install the managed package:
8+
9+
```bash
10+
dotnet add package Microsoft.WebUI
11+
```
12+
13+
Reference a runtime package directly only when you are manually assembling native assets for custom packaging or testing.
14+
15+
## Supported packages
16+
17+
| Runtime | Package |
18+
|---------|---------|
19+
| Windows x64 | `Microsoft.WebUI.Runtime.win-x64` |
20+
| Windows ARM64 | `Microsoft.WebUI.Runtime.win-arm64` |
21+
| Linux x64 | `Microsoft.WebUI.Runtime.linux-x64` |
22+
| Linux ARM64 | `Microsoft.WebUI.Runtime.linux-arm64` |
23+
| macOS x64 | `Microsoft.WebUI.Runtime.osx-x64` |
24+
| macOS ARM64 | `Microsoft.WebUI.Runtime.osx-arm64` |
25+
26+
## Documentation
27+
28+
See the [WebUI repository](https://github.com/microsoft/webui) for full usage guides and examples.
29+
30+
## License
31+
32+
MIT - Copyright (c) Microsoft Corporation.

0 commit comments

Comments
 (0)