Author: jbevain
Date: 2007-06-04 16:22:30 -0400 (Mon, 04 Jun 2007)
New Revision: 78588

Modified:
   trunk/cecil/linker/ChangeLog
   trunk/cecil/linker/Descriptors/corlib.xml
   trunk/cecil/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
Log:
2007-06-04  Jb Evain  <[EMAIL PROTECTED]>

        * Mono.Linker.Steps/ResolveFromXmlStep.cs
          Descriptors/corlib.xml:
                Preserve the whole S.S.Crypto namespace.


Modified: trunk/cecil/linker/ChangeLog
===================================================================
--- trunk/cecil/linker/ChangeLog        2007-06-04 20:00:44 UTC (rev 78587)
+++ trunk/cecil/linker/ChangeLog        2007-06-04 20:22:30 UTC (rev 78588)
@@ -1,5 +1,9 @@
 2007-06-04  Jb Evain  <[EMAIL PROTECTED]>
 
+       * Mono.Linker.Steps/ResolveFromXmlStep.cs
+         Descriptors/corlib.xml:
+               Preserve the whole S.S.Crypto namespace.
+
        * rename back from mink to monolinker.
 
 2007-06-01  Jb Evain  <[EMAIL PROTECTED]>

Modified: trunk/cecil/linker/Descriptors/corlib.xml
===================================================================
--- trunk/cecil/linker/Descriptors/corlib.xml   2007-06-04 20:00:44 UTC (rev 
78587)
+++ trunk/cecil/linker/Descriptors/corlib.xml   2007-06-04 20:22:30 UTC (rev 
78588)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <linker>
        <assembly fullname="mscorlib">
+               <namespace fullname="System.Security.Cryptography" />
                <type fullname="Mono.Interop.ComInteropProxy" />
                <type fullname="Mono.Interop.IDispatch" />
                <type fullname="Mono.Interop.IUnknown" />
@@ -26,6 +27,7 @@
                <type fullname="System.Char" />
                <type fullname="System.Collections.Generic.ICollection`1" />
                <type fullname="System.Collections.Generic.IEnumerable`1" />
+               <type 
fullname="System.Collections.Generic.IEquatableOfTEqualityComparer`1" />
                <type fullname="System.Collections.Generic.IList`1" />
                <type fullname="System.Console" />
                <type fullname="System.ConsoleDriver" />

Modified: trunk/cecil/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
===================================================================
--- trunk/cecil/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs  2007-06-04 
20:00:44 UTC (rev 78587)
+++ trunk/cecil/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs  2007-06-04 
20:22:30 UTC (rev 78588)
@@ -42,7 +42,7 @@
                static readonly string _fullname = "fullname";
                static readonly string _required = "required";
                static readonly string _preserve = "preserve";
-               static readonly string _ns = "";
+               static readonly string _ns = string.Empty;
 
                XPathDocument _document;
 
@@ -63,9 +63,31 @@
                        while (iterator.MoveNext ()) {
                                AssemblyDefinition assembly = GetAssembly 
(context, GetFullName (iterator.Current));
                                ProcessTypes (assembly, 
iterator.Current.SelectChildren ("type", _ns));
+                               ProcessNamespaces (assembly, 
iterator.Current.SelectChildren ("namespace", _ns));
                        }
                }
 
+               void ProcessNamespaces (AssemblyDefinition assembly, 
XPathNodeIterator iterator)
+               {
+                       while (iterator.MoveNext ()) {
+                               string fullname = GetFullName 
(iterator.Current);
+                               foreach (TypeDefinition type in 
assembly.MainModule.Types) {
+                                       if (type.Namespace != fullname)
+                                               continue;
+
+                                       MarkAndPreserveAll (type);
+                               }
+                       }
+               }
+
+               static void MarkAndPreserveAll (TypeDefinition type)
+               {
+                       Annotations.Mark (type);
+                       Annotations.SetPreserve (type, TypePreserve.All);
+                       foreach (TypeDefinition nested in type.NestedTypes)
+                               MarkAndPreserveAll (nested);
+               }
+
                void ProcessTypes (AssemblyDefinition assembly, 
XPathNodeIterator iterator)
                {
                        while (iterator.MoveNext ()) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to