Repository navigation
Build Less, Build Faster: Selective Targeting for .NET MAUI #36815
Unanswered
stephenquan
asked this question in
Show and tell
Replies: 1 comment 1 reply
|
看不懂,速度可以提升还是说性能提升了? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The default MAUI project defines platform targets as:
We've been replacing this with fine-grained platform switches:
This allows us to enable or disable individual targets for rapid development. For example, the following
Directory.Build.propsfile, when deployed on a Windows machine, disables the Android, iOS, and MacCatalyst targets:Note:
Directory.Build.propscan live in the repository root or any parent directory, making it easy to apply settings across multiple repositories.Alternatively, the same behaviour can be achieved using MSBuild properties:
In our tests, this has improved build performance by at least 2×. For CI/CD builds, we can tailor
Directory.Build.propsfor Windows, macOS, and Linux build agents so that Windows MSIX, iOS IPA, and Android APK packages can be produced more quickly than before.Caveat: Disabling targets can significantly improve build times, but it may also hide platform-specific issues. Ensure all targets are re-enabled before publishing packages, creating releases, or completing feature work so that full cross-platform validation can be performed.
All reactions