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
|
//
// C# implementation of a handful of shell steps
// this is used to automate the buidl in Windows
//
using System;
using System.Text;
using System.IO;
class Prepare {
delegate void filt (StreamReader sr, StreamWriter sw);
static void Filter (string inpath, string outpath, filt filter)
{
using (var ins = new StreamReader (inpath)){
using (var outs = new StreamWriter (outpath)){
filter (ins, outs);
}
}
}
static void Main (string [] args)
{
string bdir = args.Length == 0 ? "../../../mcs" : args [0];
if (!Directory.Exists (Path.Combine(bdir, "class"))){
Console.Error.WriteLine ("The directory {0} does not contain class at {1}", Path.GetFullPath (bdir), Environment.CurrentDirectory);
Environment.Exit (1);
}
Filter (bdir + "/class/System.XML/System.Xml.XPath/Parser.jay",
bdir + "/class/System.XML/Mono.Xml.Xsl/PatternParser.jay",
(i, o) => o.Write (i.ReadToEnd ().Replace ("%start Expr", "%start Pattern")));
Filter (bdir + "/build/common/Consts.cs.in",
bdir + "/build/common/Consts.cs",
(i, o) => o.Write (i.ReadToEnd ().Replace ("@MONO_VERSION@", "Mono-VSBuild")));
}
}
|