1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

Add Updgrader class

This commit is contained in:
Kevin Glynn 2011-01-03 11:11:31 -06:00
parent 99211b1a8c
commit eebc3210a3
3 changed files with 33 additions and 4 deletions

View File

@ -7,6 +7,7 @@ using RusticiSoftware.Translator.Utils;
using System.Xml.Serialization; using System.Xml.Serialization;
using RusticiSoftware.Translator; using RusticiSoftware.Translator;
using OldT = RusticiSoftware.Translator.TypeRepTemplate; using OldT = RusticiSoftware.Translator.TypeRepTemplate;
using NewT = RusticiSoftware.Translator.CLR.TypeRepTemplate;
namespace UpdateTxFiles namespace UpdateTxFiles
{ {
@ -62,19 +63,25 @@ namespace UpdateTxFiles
foreach (string r in inDirs) foreach (string r in inDirs)
doFile(r, ".xml", addOldNetTranslation, null); doFile(r, ".xml", addOldNetTranslation, null);
UpdateTranslationTemplate tx = new UpdateTranslationTemplate();
foreach (KeyValuePair<string,OldT> de in oldAppEnv) foreach (KeyValuePair<string,OldT> de in oldAppEnv)
{ {
// update translation template
NewT txTemplate = tx.upgrade(de.Value);
String xmlFName = Path.Combine(outDir, String xmlFName = Path.Combine(outDir,
((string)de.Key).Replace('.', Path.DirectorySeparatorChar) + ".xml"); ((string)de.Key).Replace('.', Path.DirectorySeparatorChar) + ".xml");
String xmlFDir = Path.GetDirectoryName(xmlFName); String xmlFDir = Path.GetDirectoryName(xmlFName);
Console.WriteLine (xmlFName + ": " + de.Value.Java); Console.WriteLine (xmlFName + ": " + de.Value.Java);
// if (!Directory.Exists(xmlFDir)) // if (!Directory.Exists(xmlFDir))
// { // {
// Directory.CreateDirectory(xmlFDir); // Directory.CreateDirectory(xmlFDir);
// } // }
// XmlSerializer s = new XmlSerializer(de.Value.GetType()); // XmlSerializer s = new XmlSerializer(txTemplate.GetType());
// TextWriter w = new StreamWriter(xmlFName); // TextWriter w = new StreamWriter(xmlFName);
// s.Serialize(w, de.Value); // s.Serialize(w, txTemplate);
// w.Close(); // w.Close();
} }
} }

View File

@ -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 ();
}
}
}

View File

@ -19,7 +19,8 @@
<DefineConstants>DEBUG</DefineConstants> <DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole> <ConsolePause>false</ConsolePause>
<Commandlineparameters>-inxmldir=/home/keving/gitrepos/cs2j/CS2JLibrary/NetTranslations/</Commandlineparameters>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType> <DebugType>none</DebugType>
@ -40,6 +41,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="Main.cs" /> <Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" /> <Compile Include="AssemblyInfo.cs" />
<Compile Include="UpdateTranslationTemplate.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>