Author: vlad
Date: 2005-05-25 22:19:22 -0400 (Wed, 25 May 2005)
New Revision: 45025
Modified:
trunk/tao/src/Tao.PostProcess/BuildProcessor.cs
trunk/tao/src/Tao.PostProcess/ReleaseBuildProcessor.cs
Log:
Tao: let the postprocessor fixup .assembly 'Foo-pre' to be .assembly 'Foo' in
resulting il file
Modified: trunk/tao/src/Tao.PostProcess/BuildProcessor.cs
===================================================================
--- trunk/tao/src/Tao.PostProcess/BuildProcessor.cs 2005-05-26 00:13:01 UTC
(rev 45024)
+++ trunk/tao/src/Tao.PostProcess/BuildProcessor.cs 2005-05-26 02:19:22 UTC
(rev 45025)
@@ -120,6 +120,20 @@
#endregion Dispose(bool isDisposing)
// --- Protected Abstract Methods ---
+ #region string FixAssemblyName()
+ /// <summary>
+ /// Modifies any .assembly 'Foo-pre' to be .assembly 'Foo',
+ /// which will be the name on the resulting -pre
+ /// </summary>
+ /// <param name="fileContent">
+ /// The content to modify.
+ /// </param>
+ /// <returns>
+ /// The modified content.
+ /// </returns>
+ protected abstract string FixAssemblyName(string fileContent);
+ #endregion FixAssemblyName()
+
#region string InjectMsil()
/// <summary>
/// Injects supplied MSIL into a method's body.
@@ -165,6 +179,7 @@
throw new ObjectDisposedException("Object has been disposed.");
}
+ content = FixAssemblyName(content);
content = ModifyCdeclDelegates(content);
content = InjectMsil(content);
Modified: trunk/tao/src/Tao.PostProcess/ReleaseBuildProcessor.cs
===================================================================
--- trunk/tao/src/Tao.PostProcess/ReleaseBuildProcessor.cs 2005-05-26
00:13:01 UTC (rev 45024)
+++ trunk/tao/src/Tao.PostProcess/ReleaseBuildProcessor.cs 2005-05-26
02:19:22 UTC (rev 45025)
@@ -265,5 +265,36 @@
return fileContent;
}
#endregion string ModifyCdeclDelegates()
+
+ #region string FixAssemblyName(string fileContent)
+ /// <summary>
+ /// Modifies any .assembly 'Foo-pre' to be .assembly 'Foo',
+ /// which will be the name on the resulting -pre
+ /// </summary>
+ /// <param name="fileContent">
+ /// The content to modify.
+ /// </param>
+ /// <returns>
+ /// The modified content.
+ /// </returns>
+ protected override string FixAssemblyName(string fileContent) {
+ Regex localPreAssembly = new Regex(@"\.assembly '(.*)-pre'",
RegexOptions.Compiled);
+ int startPos = -1;
+ int matchLen = -1;
+ StringBuilder builder = new StringBuilder(fileContent);
+
+ Match startMatch = localPreAssembly.Match(builder.ToString());
+ while (startMatch.Success) {
+ Console.WriteLine("Match: {0} {1}\n",
startMatch.Groups[1].Index, startMatch.Groups[1].Length);
+ startPos = startMatch.Groups[1].Index;
+ matchLen = startMatch.Groups[1].Length;
+ builder = builder.Remove(startPos + matchLen, 4);
+
+ startMatch = localPreAssembly.Match(builder.ToString());
+ }
+
+ return builder.ToString();
+ }
+ #endregion FixAssemblyName(string fileContent)
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches