From 583dfaba1ed98f62987be15f8dd01aab81c884a1 Mon Sep 17 00:00:00 2001 From: HarpyWar Date: Sun, 6 May 2018 12:22:06 +0300 Subject: [PATCH] fix define versions in compiler --- .gitignore | 1 + MurmurVersionCompiler/Program.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index aa0625e..b40de21 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ MurmurVersionCompiler/bin/ MurmurVersionCompiler/obj/ MurmurVersionCompiler/slice2cs/ MurmurTest/ +.localhistory/ *.suo *.user *.prr diff --git a/MurmurVersionCompiler/Program.cs b/MurmurVersionCompiler/Program.cs index 9f22e6b..4e3b150 100644 --- a/MurmurVersionCompiler/Program.cs +++ b/MurmurVersionCompiler/Program.cs @@ -35,7 +35,12 @@ static void Main(string[] args) var v = Path.GetFileName(f).Replace("Murmur_", "").Replace(".cs", ""); versions.Add(v); } - + + // cerrect sort + versions.Sort((x, y) => { + return x.CompareTo(y); + }); + foreach (var v in versions) { contentDic.Clear(); @@ -71,17 +76,20 @@ static void Main(string[] args) static void Build(string version) { string shortVersion = version.Replace(".", ""); + string _shortVersion; - // add all versions on defines + // add current version, including all previous, to defines string defines = ""; foreach (var v in versions) { - defines += string.Format("MURMUR_{0};", shortVersion); + _shortVersion = v.Replace(".", ""); + defines += string.Format("MURMUR_{0};", _shortVersion); // stop adding constants if (v == version) break; } + // Instantiate a new Engine object var engine = new Engine();