Skip to content

Commit 3b038a8

Browse files
atsushienojonpryor
authored andcommitted
[generator] Write intermediate API XML with post-metadata-fixup state. (#51)
Create an `api.xml.fixup` file which contains `api.xml` after metadata fixups are processed. This should ease debugging bindings.
1 parent 4b85cc7 commit 3b038a8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/generator/Parser.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ public XmlDocument Load (string filename)
2929

3030
public List<GenBase> Parse (string filename, IEnumerable<string> fixups, string apiLevel, int productVersion)
3131
{
32-
return Parse (Load (filename), fixups, apiLevel, productVersion);
32+
var doc = Load (filename);
33+
try {
34+
return Parse (doc, fixups, apiLevel, productVersion);
35+
} finally {
36+
try {
37+
doc.Save (filename + ".fixed");
38+
} catch { } // skip any error here.
39+
}
3340
}
3441

3542
public List<GenBase> Parse (XmlDocument doc, IEnumerable<string> fixups, string apiLevel, int productVersion)

0 commit comments

Comments
 (0)