CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 11:12:20 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/dotnet/android.git
etag: W/"27e035f03fc139998d99ab9e4d469578"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=1YZ1260L2LF09q407q4PBStWzPXDRbZmFl6BnCIluCiul%2BE93%2Blh8fJXh2dR8fQuAodobZCG7c6HVRKpUwjB%2BqDT8gh1%2Fv18HD71ikwt8drwd0BjHvqAfeTMYKlvFrlnR9kgS3Pn4P22uOE%2FJbQy63k0EBHL2d4mz3Jts94nacxlvZh%2BGwWCQMkhEVN1H1N9EtdTEcsloqLua6KSVx6etd%2Bywd3NyRuDkcoKmQVoN2v52qAfITaZ%2B%2Fs1VWvNHoXrAHLSev761R6ArlW8N%2BptYg%3D%3D--xzqi2iWC3viBv0OK--%2FOAMU54R8DyLXBbxxkUiqw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.535819193.1753614739; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:12:19 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:12:19 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C320:29FD1F:D79477:11CFF6A:68860993
[linker] move StripEmbeddedLibraries into the linker (#2162) · dotnet/android@95aeb61 · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/RemoveLibraryResourceZip.cs
Copy file name to clipboard
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/StripEmbeddedLibraries.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit 95aeb61
[linker] move StripEmbeddedLibraries into the linker (#2162)
Fixes: #1092
The `<StripEmbeddedLibraries/>` MSBuild task can take 1-2 seconds,
and it mainly removes `__AndroidLibraryProjects__.zip` from
assemblies.
If we moved this to happen during linking, it has various benefits:
- The linker already has every assembly opened and loaded.
- We know if the linker is going to `Skip`/`Delete` an assembly,
so we can likewise skip it.
- The linker writes all the assemblies out at the end, so we don't
have a second "write" step.
Changes to make this happen:
- Removed the `<StripEmbeddedLibraries/>` MSBuild task and related
targets
- Removed `$(_AndroidStripFlag)` from our targets, since it is no
longer used
- Created a new `StripEmbeddedLibraries` linker step that runs late
during linking
- Removed a `RemoveLibraryResourceZip` linker step, as it seemed to be
duplicative.
I timed before and after with the Xamarin.Forms test project:
.\bin\Debug\bin\xabuild .\tests\Xamarin.Forms-Performance-Integration\Droid\Xamarin.Forms.Performance.Integration.Droid.csproj /p:Configuration=Release /t:Clean
.\bin\Debug\bin\xabuild .\tests\Xamarin.Forms-Performance-Integration\Droid\Xamarin.Forms.Performance.Integration.Droid.csproj /p:Configuration=Release /t:Build /bl
Before:
1233 ms StripEmbeddedLibraries 1 calls
14925 ms LinkAssemblies 1 calls
After:
15437 ms LinkAssemblies 1 calls
As expected, `<LinkAssemblies/>` will be slightly slower, but since
`<StripEmbeddedLibraries/>` is not called at all, we have a net gain
of around 700ms.
Once this has been merged and working for `Release` builds, I plan to
do some further research to find out if running the new
`StripEmbeddedLibraries` linker step will help for `Debug` builds.
It could be a net performance improvement, if the time taken to
remove these files improves deployment and app startup times.
Greatly expanded upon an existing test:
- Made it a Xamarin.Forms project
- Moved the `@(AndroidEnvironment)` item to a referenced library project
- Added an `$(AndroidLinkSkip)` option for a support library assembly
- Made sure the `$(AndroidLinkSkip)` assembly is saved and stripped
- Check and make sure `@(EmbeddedResource)` items are stripped at the end
Other changes:
- Removed some assertions in tests looking for
`_StripEmbeddedLibraries`, since it is removed now.1 parent 647659e commit 95aeb61Copy full SHA for 95aeb61
File tree
Expand file treeCollapse file tree
9 files changed
+119
-169
lines changedFilter options
- src/Xamarin.Android.Build.Tasks
- Linker/MonoDroid.Tuner
- Tasks
- Tests/Xamarin.Android.Build.Tests
Expand file treeCollapse file tree
9 files changed
+119
-169
lines changedsrc/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
106 |
| - | |
107 | 106 |
| |
108 | 107 |
| |
109 | 108 |
| |
| |||
114 | 113 |
| |
115 | 114 |
| |
116 | 115 |
| |
| 116 | + | |
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
|
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/RemoveLibraryResourceZip.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/RemoveLibraryResourceZip.cs-26Lines changed: 0 additions & 26 deletions
This file was deleted.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/StripEmbeddedLibraries.cs
Copy file name to clipboard+58Lines changed: 58 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + |
src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs-18Lines changed: 0 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 | 72 |
| |
91 | 73 |
| |
92 | 74 |
| |
|
src/Xamarin.Android.Build.Tasks/Tasks/StripEmbeddedLibraries.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/StripEmbeddedLibraries.cs-93Lines changed: 0 additions & 93 deletions
This file was deleted.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs+49-13Lines changed: 49 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
| |||
849 | 850 |
| |
850 | 851 |
| |
851 | 852 |
| |
852 |
| - | |
853 |
| - | |
854 |
| - | |
855 | 853 |
| |
856 | 854 |
| |
857 | 855 |
| |
| |||
885 | 883 |
| |
886 | 884 |
| |
887 | 885 |
| |
888 |
| - | |
889 |
| - | |
890 |
| - | |
891 | 886 |
| |
892 | 887 |
| |
893 | 888 |
| |
| |||
1581 | 1576 |
| |
1582 | 1577 |
| |
1583 | 1578 |
| |
1584 |
| - | |
| 1579 | + | |
| 1580 | + | |
1585 | 1581 |
| |
1586 | 1582 |
| |
1587 | 1583 |
| |
1588 | 1584 |
| |
1589 | 1585 |
| |
1590 | 1586 |
| |
1591 |
| - | |
1592 |
| - | |
1593 |
| - | |
1594 |
| - | |
1595 |
| - | |
1596 |
| - | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
1597 | 1621 |
| |
1598 | 1622 |
| |
1599 | 1623 |
| |
| |||
1605 | 1629 |
| |
1606 | 1630 |
| |
1607 | 1631 |
| |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1608 | 1644 |
| |
1609 | 1645 |
| |
1610 | 1646 |
| |
|
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 |
| |
65 | 69 |
| |
66 | 70 |
| |
|
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj+1-2Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
| 110 | + | |
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
| |||
194 | 195 |
| |
195 | 196 |
| |
196 | 197 |
| |
197 |
| - | |
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
209 | 208 |
| |
210 | 209 |
| |
211 | 210 |
| |
|
You can’t perform that action at this time.
0 commit comments