eng/scripts/README.md
Scripts to test .NET MAUI pull request builds in your own projects before they're merged.
get-maui-pr.sh - Bash script for Unix-like systems (Linux, macOS)get-maui-pr.ps1 - PowerShell script for cross-platform use (Windows, Linux, macOS)⚠️ WARNING: Always review the PR code before running these scripts. Only test PRs you trust.
Bash:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- <PR_NUMBER>
PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } <PR_NUMBER>"
Downloaded packages are stored in a hive directory:
~/.maui/hives/pr-<PR_NUMBER>/packages%USERPROFILE%\.maui\hives\pr-<PR_NUMBER>\packages.csproj with <UseMaui>true</UseMaui>)curl, jq, and unzipget-maui-pr.sh)| Argument | Description | Required |
|---|---|---|
| 1st | PR number to test | Yes |
| 2nd | Path to .csproj file | No (auto-detects) |
get-maui-pr.ps1)| Parameter | Description | Default |
|---|---|---|
-PrNumber | PR number to test | Required |
-ProjectPath | Path to .csproj file | Auto-detect |
# Test PR in current directory
./get-maui-pr.sh 33002
# Test PR with specific project
./get-maui-pr.sh 33002 ./MyApp/MyApp.csproj
# Test PR in current directory
.\get-maui-pr.ps1 33002
# Test PR with specific project
.\get-maui-pr.ps1 -PrNumber 33002 -ProjectPath ./MyApp/MyApp.csproj
You can point the scripts at a fork by setting the MAUI_REPO environment variable to owner/name before invoking the script (defaults to dotnet/maui).
export MAUI_REPO=myfork/maui
./get-maui-pr.sh 1234
$env:MAUI_REPO = 'myfork/maui'
./get-maui-pr.ps1 1234
TIP: Use a separate Git branch for testing!
git checkout -b test-pr-33002
# ... test the PR ...
git checkout main # Easy revert!
Or manually revert:
.csproj - change package version back to stable (see NuGet)maui-pr-build source from NuGet.configdotnet restore --force.csproj file that has <UseMaui>true</UseMaui>.Run the PowerShell script with the help flag to see detailed usage information:
Get-Help .\get-maui-pr.ps1 -Detailed