Welcome to mirror list, hosted at ThFree Co, Russian Federation.

UsedForwarderIsRemovedWhenLink.cs « TypeForwarding « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3db42a6ac5ed19bc09ef7597d15c2cc82c5bfb5a (plain)
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
using System;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies;

namespace Mono.Linker.Tests.Cases.TypeForwarding
{
	// Actions:
	// link - This assembly, Forwarder.dll and Implementation.dll
	[KeepTypeForwarderOnlyAssemblies ("false")]
	[IgnoreDescriptors (false)]

	[SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })]
	// Add another assembly in that uses the forwarder just to make things a little more complex
	[SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryUsingForwarder.cs" }, references: new[] { "Forwarder.dll" })]

	// After compiling the test case we then replace the reference impl with implementation + type forwarder
	[SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })]
	[SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" },
		resources: new object[] { new string[] { "Dependencies/ForwarderLibrary.xml", "ILLink.Descriptors.xml" } })]

	[RemovedAssembly ("Forwarder.dll")]
	[RemovedAssemblyReference ("test", "Forwarder")]
	[KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
	[KeptMemberInAssembly ("Library.dll", typeof (LibraryUsingForwarder), "GetValueFromOtherAssembly()")]
	class UsedForwarderIsRemovedWhenLink
	{
		static void Main ()
		{
			Console.WriteLine (new ImplementationLibrary ().GetSomeValue ());
			Console.WriteLine (new LibraryUsingForwarder ().GetValueFromOtherAssembly ());
		}

		// Removed because we don't support embedded xml in forwarders
		static void ReferencedByForwarderXml ()
		{
		}
	}
}