diff options
author | Mike Voorhees <michaelv@unity3d.com> | 2017-05-16 17:20:52 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-05-16 20:01:55 +0300 |
commit | 81c6635355c40f4c66772bd200918204b62c5234 (patch) | |
tree | 85764c9dcdf1b75af599ea178de57fe29d111bc5 /linker/Tests | |
parent | 6f93b07e7b8a8d24a09464e377a12065572237ad (diff) |
Add ability to preserve an entire assembly
Diffstat (limited to 'linker/Tests')
3 files changed, 25 insertions, 0 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.cs b/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.cs new file mode 100644 index 000000000..246c80af6 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.cs @@ -0,0 +1,20 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.LinkXml { + + [KeptMember(".ctor()")] + class UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved { + public static void Main () + { + } + + [Kept] + [KeptMember (".ctor()")] + class Unused { + [Kept] + void Foo () + { + } + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.xml b/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.xml new file mode 100644 index 000000000..7ecdb6c22 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases/LinkXml/UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.xml @@ -0,0 +1,3 @@ +<linker> + <assembly fullname="test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all" /> +</linker>
\ No newline at end of file diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Mono.Linker.Tests.Cases.csproj b/linker/Tests/Mono.Linker.Tests.Cases/Mono.Linker.Tests.Cases.csproj index a9cba0fda..1ebc87aa6 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases/Mono.Linker.Tests.Cases.csproj +++ b/linker/Tests/Mono.Linker.Tests.Cases/Mono.Linker.Tests.Cases.csproj @@ -96,6 +96,7 @@ <Compile Include="LinkXml\UnusedMethodPreservedByLinkXmlIsKept.cs" /> <Compile Include="LinkXml\UnusedNestedTypePreservedByLinkXmlIsKept.cs" /> <Compile Include="LinkXml\UnusedPropertyPreservedByLinkXmlIsKept.cs" /> + <Compile Include="LinkXml\UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.cs" /> <Compile Include="LinkXml\UnusedTypePreservedByLinkXmlIsKept.cs" /> <Compile Include="LinkXml\UnusedTypeWithPreserveAllHasAllMembersPreserved.cs" /> <Compile Include="LinkXml\UnusedTypeWithPreserveFieldsHasMethodsRemoved.cs" /> @@ -128,6 +129,7 @@ <Content Include="LinkXml\UnusedMethodPreservedByLinkXmlIsKept.xml" /> <Content Include="LinkXml\UnusedNestedTypePreservedByLinkXmlIsKept.xml" /> <Content Include="LinkXml\UnusedPropertyPreservedByLinkXmlIsKept.xml" /> + <Content Include="LinkXml\UnusedTypeIsPresservedWhenEntireAssemblyIsPreserved.xml" /> <Content Include="LinkXml\UnusedTypePreservedByLinkXmlIsKept.xml" /> <Content Include="LinkXml\UnusedTypeWithPreserveAllHasAllMembersPreserved.xml" /> <Content Include="LinkXml\UnusedTypeWithPreserveFieldsHasMethodsRemoved.xml" /> |