forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Noticed a bunch of unused APIs in ActivatorUtilities when attempting to enable trimmability on Http.Abstractions
- Loading branch information
Showing
4 changed files
with
33 additions
and
291 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
16 changes: 0 additions & 16 deletions
16
src/Shared/ActivatorUtilities/ActivatorUtilitiesConstructorAttribute.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Trimmer baseline verification | ||
|
||
This project is used to verify that ASP.NET Core APIs do not result in additional trimmer warnings other than the ones that are already known. It works by running the trimmer in "library mode", rooting all of it's public APIs, using a set of baselined suppressions and ensuring no new trimmer warnings are produced. | ||
|
||
### Enabling trimming on a new project | ||
|
||
* Update the project file to enable trimming `<Trimmable>true</Trimmable> | ||
* Run `eng/scripts/GenerateProjectList.ps1` to update the list of projects that are known to be trimmable | ||
* Build this project | ||
|
||
### Updating the baselines | ||
|
||
If a suppressed warning has been resolved, or if new trimmer warnings are to be baselined, run the following command: | ||
|
||
``` | ||
dotnet build /p:GenerateLinkerWarningSuppressions=true | ||
``` | ||
|
||
This should update the WarningSuppressions.xml files associated with projects. | ||
|
||
⚠️ Note that the generated file sometimes messing up formatting for some compiler generated nested types and you may need to manually touch up these files on regenerating. The generated file uses braces `{...}` instead of angle brackets `<...>`: | ||
|
||
```diff | ||
- LegacyRouteTableFactory.<>c.{Create}b__2_1(System.Reflection.Assembly) | ||
+ LegacyRouteTableFactory.<>c.<Create>b__2_1(System.Reflection.Assembly) | ||
``` |