Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] <LinkAssembliesNoShrink/> can skip the main assembly (#6328)
Context: #6356 Context: #6357 We found an incremental build in a `dotnet new android` app with C# code changes has this duration: 100 ms LinkAssembliesNoShrink 1 calls It turns out we don't actually need to run `<LinkAssembliesNoShrink/>` against the "main" assembly in .NET 6. After passing in `$(TargetName)` and simply copying the file, this time improved to: 9 ms LinkAssembliesNoShrink 1 calls This change should improve incremental C# changes by ~91ms in `dotnet new android` projects. In "Xammie" Xamarin.Android, it is possible for an application project to reference a class library with a higher `$(TargetFrameworkVersion)`; see [warning XA0105 docs][0]. We cannot apply this optimization for Xamarin.Android. However, in thinking about and revisiting this code, we've made two determinations for future work: * XA0105 being a warning is a terrible idea, as it can allow apps to crash via `TypeLoadException`. See #6356. * .NET 6 builds don't emit [XA2000 warnings][1] when a referenced assembly references `AppDomain.CreateDomain()`. This isn't desirable, as `AppDomain.CreateDomain()` is still part of the .NET Standard 2.0 API contract, and thus could still be used, even though it won't work. *Something* should warn if `AppDomain.CreateDomain()` is referenced, to reduce the need for manual app testing. See #6357. [0]: https://github.com/xamarin/xamarin-android/blob/af60da7f13e613faa8ded5ef734e8c6d91445acc/Documentation/guides/messages/xa0105.md [1]: https://github.com/xamarin/xamarin-android/blob/03d4e40d310255f80cc5ffb6475f03a02a561bc5/Documentation/guides/messages/xa2000.md
- Loading branch information
1 parent
03d4e40
commit d7c0578
Showing
4 changed files
with
89 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters