From e1e89d4d061b46eaad0ed99ec95bb06b277153d7 Mon Sep 17 00:00:00 2001 From: "kenneth.skovhede@gmail.com" Date: Mon, 21 Dec 2009 20:42:47 +0000 Subject: [PATCH] Fixed a bug with startfolder and exclude. git-svn-id: https://duplicati.googlecode.com/svn/trunk@308 59da171f-624f-0410-aa54-27559c288bec --- BuildTools/LocalizationTool/LocalizationTool/Program.cs | 7 +++++-- .../LocalizationTool/LocalizationTool/ResXCompiler.cs | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/BuildTools/LocalizationTool/LocalizationTool/Program.cs b/BuildTools/LocalizationTool/LocalizationTool/Program.cs index f7f68021f..6feb9dc55 100644 --- a/BuildTools/LocalizationTool/LocalizationTool/Program.cs +++ b/BuildTools/LocalizationTool/LocalizationTool/Program.cs @@ -398,7 +398,10 @@ namespace LocalizationTool foreach (XElement n in conf.Elements("assembly")) { - List excludes = n.Elements("exclude").Select(c => c.Value).ToList(); + List excludes = (from x in n.Elements("exclude") + let fullpath = System.IO.Path.Combine(System.IO.Path.Combine(Application.StartupPath, cultureReq), x.Value) + select fullpath).ToList(); + string assemblyName = n.Attribute("name").Value; string folder = n.Attribute("folder").Value; string @namespace = n.Attribute("namespace") == null ? assemblyName : n.Attribute("namespace").Value; @@ -409,7 +412,7 @@ namespace LocalizationTool if (!System.IO.Directory.Exists(outfolder)) System.IO.Directory.CreateDirectory(outfolder); - ResXCompiler.CompileResxFiles(System.IO.Path.Combine(Application.StartupPath, culture), excludes, @namespace, System.IO.Path.Combine(outfolder, assemblyName + ".resources.dll"), System.IO.Path.GetFullPath(versionassembly), keyfile, culture, productname); + ResXCompiler.CompileResxFiles(System.IO.Path.Combine(System.IO.Path.Combine(Application.StartupPath, culture), folder), excludes, @namespace, System.IO.Path.Combine(outfolder, assemblyName + ".resources.dll"), System.IO.Path.GetFullPath(versionassembly), keyfile, culture, productname); } } } diff --git a/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs b/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs index aa4ec4511..ce975b65b 100644 --- a/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs +++ b/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Linq; namespace LocalizationTool { @@ -71,9 +72,8 @@ namespace LocalizationTool { if (s.ToLower().EndsWith("." + culture.ToLower() + ".resx")) { - foreach (string xf in excludeFolders) - if (s.ToLower().StartsWith(Duplicati.Library.Core.Utility.AppendDirSeperator(xf).ToLower())) - continue; + if (excludeFolders.Any(xf => s.ToLower().StartsWith(Duplicati.Library.Core.Utility.AppendDirSeperator(xf).ToLower()))) + continue; string resname = System.IO.Path.ChangeExtension(s, ".resources");