More generated files
[mono.git] / msvc / scripts / prepare.cs
1 //
2 // C# implementation of a handful of shell steps
3 // this is used to automate the buidl in Windows
4 //
5 using System;
6 using System.Text;
7 using System.IO;
8
9 class Prepare {
10         delegate void filt (StreamReader sr, StreamWriter sw);
11         
12         static void Filter (string inpath, string outpath, filt filter)
13         {
14                 using (var ins = new StreamReader (){
15                         using (var outs = new StreamWriter ()){
16                                 filter (ins, outs);
17                         }
18                 }
19         }
20         
21         static void Main (string [] args)
22         {
23                 string bdir = args.Length == 0 ? "../../../mcs" : args [0];
24
25                 Filter (bdir + "/class/System.XML/System.Xml.XPath/Parser.jay",
26                         bdir + "/class/System.XML/Mono.Xml.Xsl/PatternParser.jay",
27                         (i, o) => o.Write (i.ReadToEnd ().Replace ("%start Expr", "%start Pattern")));
28
29                 Filter (bdir + "/mcs/build/common/Consts.cs.in",
30                         bdir + "/mcs/build/common/Consts.cs",
31                         (i, o) => o.Write (i.ReadToEnd ().Replace ("@MONO_VERSION@", "Mono-VSBuild")));
32         }
33         
34 }