Author: jbevain
Date: 2007-07-05 10:25:48 -0400 (Thu, 05 Jul 2007)
New Revision: 81392
Modified:
trunk/cecil/linker/Mono.Linker/Driver.cs
trunk/cecil/linker/README
trunk/cecil/linker/man/monolinker.1
Log:
document -s switch
Modified: trunk/cecil/linker/Mono.Linker/Driver.cs
===================================================================
--- trunk/cecil/linker/Mono.Linker/Driver.cs 2007-07-05 14:18:17 UTC (rev
81391)
+++ trunk/cecil/linker/Mono.Linker/Driver.cs 2007-07-05 14:25:48 UTC (rev
81392)
@@ -248,6 +248,7 @@
Console.WriteLine (" --version Print the version
number of the {0}", _linker);
Console.WriteLine (" -out Specify the output
directory, default to `output'");
Console.WriteLine (" -c Action on the core
assemblies, skip, copy or link, default to skip");
+ Console.WriteLine (" -s Add a new step to
the pipeline.");
Console.WriteLine (" -d Add a directory
where the linker will look for assemblies");
Console.WriteLine (" -l List of i18n
assemblies to copy to the output directory");
Console.WriteLine (" separated with a
comma: none,all,cjk,mideast,other,rare,west");
Modified: trunk/cecil/linker/README
===================================================================
--- trunk/cecil/linker/README 2007-07-05 14:18:17 UTC (rev 81391)
+++ trunk/cecil/linker/README 2007-07-05 14:25:48 UTC (rev 81392)
@@ -139,6 +139,44 @@
monoliner -d ../../libs -a program.exe
+8) Adding custom steps to the linker.
+
+You can write custom steps for the linker and tell the linker to use them.
+Let's take a simple example:
+
+using System;
+
+using Mono.Linker;
+using Mono.Linker.Steps;
+
+namespace Foo {
+
+ public class FooStep : IStep {
+
+ public void Process (LinkContext context)
+ {
+ foreach (IStep step in context.Pipeline.GetSteps ()) {
+ Console.WriteLine (step.GetType ().Name);
+ }
+ }
+ }
+}
+
+
+That is compiled against the linker to a Foo.dll assembly.
+
+You can ask the linker to add it at the end of the pipeline:
+
+monolinker -s Foo.FooStep,Foo -a program.exe
+
+Or you can ask the linker to add it after a specific step:
+
+monolinker -s MarkStep:Foo.FooStep,Foo -a program.exe
+
+Or before a specific step:
+
+monolinker -s Foo.FooStep,Foo:MarkStep
+
* Inside the linker
The linker is a quite small piece of code, and it pretty simple to address.
Modified: trunk/cecil/linker/man/monolinker.1
===================================================================
--- trunk/cecil/linker/man/monolinker.1 2007-07-05 14:18:17 UTC (rev 81391)
+++ trunk/cecil/linker/man/monolinker.1 2007-07-05 14:25:48 UTC (rev 81392)
@@ -122,6 +122,12 @@
generate an assembly that contains only what the public API defined in he info
file
needs. It will also adjust the visibility of the types that have to be present
in the
assembly, but that are not visibile from the public API.
+.TP
+.I "-s [StepBefore:]StepFullName,StepAssembly[:StepAfter]"
+.PP
+You can ask the linker to execute custom steps by using the -s command. This
command
+takes the standard TypeFullName,Assembly format to locate the step. You can
customize
+its position in the pipeline by either adding it before a step, or after.
.SH COPYRIGHT
Copyright (C) 2007 Novell, Inc (http://www.novell.com)
.SH BUGS
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches