Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,33 @@ jobs:

- name: Test
run: dotnet test LoadingIndicators.Avalonia.Tests/LoadingIndicators.Avalonia.Tests.csproj -c Release

aot:
name: AOT compatibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x

# Native AOT links with clang against zlib on Linux.
- name: Install Native AOT prerequisites
run: sudo apt-get update && sudo apt-get install -y clang zlib1g-dev

# A library's trim/AOT warnings only surface when a consuming app is AOT-published.
# The demo Desktop project roots the whole library, so this is the authoritative gate.
- name: AOT publish demo (fail on any IL trim/AOT warning)
run: |
set -o pipefail
dotnet publish LoadingIndicators.Avalonia.Demo/LoadingIndicators.Avalonia.Demo.Desktop/LoadingIndicators.Avalonia.Demo.Desktop.csproj \
-c Release -r linux-x64 -p:PublishAot=true 2>&1 | tee aot-publish.log
if grep -nE "warning IL[0-9]{4}" aot-publish.log; then
echo "::error::Native AOT/trim warnings detected — the library is no longer AOT-clean (see IL#### lines above)."
exit 1
fi
echo "No IL2xxx/IL3xxx trim/AOT warnings — library is AOT-clean."
4 changes: 2 additions & 2 deletions LoadingIndicators.Avalonia/LoadingIndicators.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<Version>0.0.0-local</Version>
<Authors>Optris GmbH, original by moviegear</Authors>
<Company>Optris GmbH</Company>
<Description>Optris-maintained fork of LoadingIndicators.Avalonia, ported to Avalonia 12. An adaptation for Avalonia of the LoadingIndicators.WPF collection of 9 animated loading indicators.</Description>
<Description>Optris-maintained fork of LoadingIndicators.Avalonia, ported to Avalonia 12. An adaptation for Avalonia of the LoadingIndicators.WPF collection of 9 animated loading indicators. Trim- and Native-AOT-compatible.</Description>
<Copyright>Optris GmbH, moviegear © $([System.DateTime]::Now.Year)</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageProjectUrl>https://github.com/Optris/Optris.LoadingIndicators.Avalonia</PackageProjectUrl>
<RepositoryUrl>https://github.com/Optris/Optris.LoadingIndicators.Avalonia.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>Avalonia, loading, progress, activity</PackageTags>
<PackageTags>Avalonia, loading, progress, activity, AOT, trimming</PackageTags>
<PackageId>Optris.LoadingIndicators.Avalonia</PackageId>
<IsAotCompatible>true</IsAotCompatible>
<DebugType>portable</DebugType>
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ LoadingIndicators.Avalonia is an adaptation for Avalonia of the [LoadingIndicato
<li:LoadingIndicator IsActive="{Binding IsBusy}" Mode="Arcs" SpeedRatio="1.2" />
```

## Trimming & Native AOT

The package is **trim- and Native-AOT-compatible**. The assembly is marked `IsTrimmable`, all
bindings in the control themes are compiled (no reflection bindings), and the control uses no
runtime reflection — so it adds no trim/AOT warnings to a consuming app. This is enforced in CI by
publishing the demo with `PublishAot=true` and failing on any `IL2xxx`/`IL3xxx` warning.

Nothing extra is required to consume it from an AOT app — just keep Avalonia's default compiled
bindings (`<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>`) in
your own project, as the Avalonia templates already do.

## Releasing a new version

The major version tracks Avalonia (e.g. `12.x.y` for Avalonia 12). Minor and patch versions are for library changes.
Expand Down
Loading