From 5f984ae83f0c474e03d7e42a4cec8ab08bba4e8d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Jan 2021 16:48:00 -0500 Subject: [PATCH] Cleanup, and little improvement for aggressive trimming (#46587) * 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/` * cleanup * Trim the test runner also. based on @mareks' feedback --- eng/testing/tests.mobile.targets | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index e6e140d..9ac8dcc 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -148,26 +148,27 @@ - + link - - true - link - - - link - - - copy - - - - - + + + + + + + + + + + -- 2.7.4