From 3aab4801ee68b1af0e6e3312d73a80866f9d8f7f Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Jan 2021 11:38:24 -0500 Subject: [PATCH 1/3] Cleanup, and little improvement for aggressive trimming - The `ConfigureTrimming` target adds xunit assemblies explicitly, and sets `TriggerRootAssembly` too. - Looking at the files being linked, some issues noticed: - Multiple copies of xunit assemblies, from various locations are included. Eg. from `System.Buffer.Tests`, `WasmTestRunner`, and from the nuget - `WasmTestRunner` is explicitly added as `TriggerRootAssembly`, but it is also passed as an arg for linking, `-p link ...` - `xunit.runner.json` is incorrectly added to the files to be linked - Instead: - all the files to be published are already in `ResolvedFileToPublish` after `AddTestRunnersToPublishedFiles` target - so, we mark everything for linking, - *except*: - main test assembly - and the test runner assembly - This way we are explicitly specifying which assemblies to link, and which ones to `copy` - This reduces the size: - 3.1M to 2.6M `artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/managed/` - 46M to 31M `artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/publish/` --- eng/testing/tests.mobile.targets | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 60c1465f982f1b..407afb7164e0f5 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -148,26 +148,22 @@ - + link - - true - link - - - link - - - copy - - - - - + + + + + + + + + From f56fe400f2d245a6796dcc8e5abba0ac55e6c4d0 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Jan 2021 11:51:08 -0500 Subject: [PATCH 2/3] cleanup --- eng/testing/tests.mobile.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 407afb7164e0f5..090566f05634e3 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -158,8 +158,8 @@ - + TrimMode="" is needed so the root assemblies are correctly identified --> + From 704694ce195842fa325aea5e2242971a19db8f1b Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Jan 2021 12:21:06 -0500 Subject: [PATCH 3/3] Trim the test runner also. based on @mareks' feedback --- eng/testing/tests.mobile.targets | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 090566f05634e3..7d2cdda0ab5efa 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -157,10 +157,15 @@ - - + + +