From eebc3210a37fecf14296919d8d7bf26cc5abceda Mon Sep 17 00:00:00 2001 From: Kevin Glynn Date: Mon, 3 Jan 2011 11:11:31 -0600 Subject: [PATCH] Add Updgrader class --- CSharpTranslator/antlr3/UpdateTxFiles/Main.cs | 13 +++++++++--- .../UpdateTranslationTemplate.cs | 20 +++++++++++++++++++ .../antlr3/UpdateTxFiles/UpdateTxFiles.csproj | 4 +++- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs diff --git a/CSharpTranslator/antlr3/UpdateTxFiles/Main.cs b/CSharpTranslator/antlr3/UpdateTxFiles/Main.cs index 979e10b..5f767c4 100644 --- a/CSharpTranslator/antlr3/UpdateTxFiles/Main.cs +++ b/CSharpTranslator/antlr3/UpdateTxFiles/Main.cs @@ -7,6 +7,7 @@ using RusticiSoftware.Translator.Utils; using System.Xml.Serialization; using RusticiSoftware.Translator; using OldT = RusticiSoftware.Translator.TypeRepTemplate; +using NewT = RusticiSoftware.Translator.CLR.TypeRepTemplate; namespace UpdateTxFiles { @@ -62,19 +63,25 @@ namespace UpdateTxFiles foreach (string r in inDirs) doFile(r, ".xml", addOldNetTranslation, null); + UpdateTranslationTemplate tx = new UpdateTranslationTemplate(); + foreach (KeyValuePair de in oldAppEnv) - { + { + // update translation template + NewT txTemplate = tx.upgrade(de.Value); + String xmlFName = Path.Combine(outDir, ((string)de.Key).Replace('.', Path.DirectorySeparatorChar) + ".xml"); String xmlFDir = Path.GetDirectoryName(xmlFName); Console.WriteLine (xmlFName + ": " + de.Value.Java); + // if (!Directory.Exists(xmlFDir)) // { // Directory.CreateDirectory(xmlFDir); // } -// XmlSerializer s = new XmlSerializer(de.Value.GetType()); +// XmlSerializer s = new XmlSerializer(txTemplate.GetType()); // TextWriter w = new StreamWriter(xmlFName); -// s.Serialize(w, de.Value); +// s.Serialize(w, txTemplate); // w.Close(); } } diff --git a/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs new file mode 100644 index 0000000..c0d58f4 --- /dev/null +++ b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs @@ -0,0 +1,20 @@ +using System; +using RusticiSoftware.Translator; +using OldT = RusticiSoftware.Translator.TypeRepTemplate; +using NewT = RusticiSoftware.Translator.CLR.TypeRepTemplate; + +namespace UpdateTxFiles +{ + public class UpdateTranslationTemplate { + + public UpdateTranslationTemplate () + { + } + public NewT upgrade (OldT inTemplate) + { + throw new System.NotImplementedException (); + } + + } +} + diff --git a/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTxFiles.csproj b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTxFiles.csproj index 13324e5..31a5b82 100644 --- a/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTxFiles.csproj +++ b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTxFiles.csproj @@ -19,7 +19,8 @@ DEBUG prompt 4 - true + false + -inxmldir=/home/keving/gitrepos/cs2j/CS2JLibrary/NetTranslations/ none @@ -40,6 +41,7 @@ +