Skip to content

Commit

Permalink
Add prebuild commands
Browse files Browse the repository at this point in the history
svn path=/trunk/mono/; revision=133364
  • Loading branch information
migueldeicaza committed May 2, 2009
1 parent 67e68c8 commit 314ce86
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
7 changes: 7 additions & 0 deletions msvc/scripts/System.Xml.pre
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
..\..\jay\bin\Debug\jay.exe -ct ..\..\jay\skeleton.cs System.Xml.XPath/Parser.jay > System.Xml.XPath/Parser.cs
echo #define XSLT_PATTERN > Mono.Xml.Xsl/PatternParser.cs
..\..\jay\bin\Debug\jay.exe -ct ..\..\jay\skeleton.cs Mono.Xml.Xsl/PatternParser.jay >> Mono.Xml.Xsl/PatternParser.cs
echo #define XSLT_PATTERN > Mono.Xml.Xsl/PatternTokenizer.cs
type System.Xml.XPath/Tokenizer.cs >> Mono.Xml.Xsl/PatternTokenizer.cs
..\..\..\mono\msvc\scripts\prepare .

27 changes: 20 additions & 7 deletions msvc/scripts/genproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ static string [] LoadArgs (string file)

return ret_value;
}

static string Load (string f)
{
if (File.Exists (f)){
using (var sr = new StreamReader (f)){
return sr.ReadToEnd ();
}
} else
return "";
}

public void Generate (XElement xproject)
{
Expand All @@ -456,14 +466,17 @@ public void Generate (XElement xproject)
library_output = xproject.Element ("library_output").Value;
response = xproject.Element ("response").Value;

string prefile = Path.Combine ("inputs", library + ".pre");
string prebuild = "";
if (File.Exists (prefile)){
using (var pre = new StreamReader (prefile)){
prebuild = pre.ReadToEnd ();
}
}
//
// Prebuild code, might be in inputs, check:
// inputs/LIBRARY-PROFILE.pre
// inputs/LIBRARY.pre
//
string prebuild = Load (library + ".pre");

int q = library.IndexOf ("-");
if (q != -1)
prebuild = prebuild + Load (library.Substring (0, q) + ".pre");

var all_args = new Queue<string []> ();
all_args.Enqueue (flags.Split ());
while (all_args.Count > 0){
Expand Down
23 changes: 23 additions & 0 deletions msvc/scripts/prepare.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// 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 {

static void Main (string [] args)
{
string bdir = args.Length == 0 ? "../../../mcs/class" : args [0];

using (var xps = new StreamReader (bdir + "/System.XML/System.Xml.XPath/Parser.jay")){
using (var xpp = new StreamWriter (bdir + "/System.XML/Mono.Xml.Xsl/PatternParser.jay")){

xpp.Write (xps.ReadToEnd ().Replace ("%start Expr", "%start Pattern"));
}
}
}

}
1 change: 1 addition & 0 deletions msvc/setup-solution.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@echo off
csc -debug -out:scripts\monowrap.exe scripts\monowrap.cs
csc -debug -out:scripts\genproj.exe scripts\genproj.cs
csc -debug -out:scripts\prepare.exe scripts\prepare.cs
cd scripts
genproj.exe
cd ..
Expand Down

0 comments on commit 314ce86

Please sign in to comment.