From f4e3bb768d465ba0ee7a5733eb871a7b5f5af08f Mon Sep 17 00:00:00 2001 From: AndrewPeters Date: Wed, 29 Jan 2014 14:10:09 -0800 Subject: [PATCH] Adds resx to proj gen --- build/_k-generate-projects.shade | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/build/_k-generate-projects.shade b/build/_k-generate-projects.shade index 6bfb517959..45710a0a38 100644 --- a/build/_k-generate-projects.shade +++ b/build/_k-generate-projects.shade @@ -195,12 +195,10 @@ functions } // Get the list of files - var filesString = String.Join(Environment.NewLine, - Directory.GetFiles(projectDir, "*.cs", SearchOption.AllDirectories) - .Select(p => p.Substring(projectDir.Length).Trim(Path.DirectorySeparatorChar)) - .Where(p => !p.StartsWith("obj")) - .Select(p => String.Format( - @"", p))); + var filesString + = String.Join(Environment.NewLine, + BuildFileList(projectDir, "*.cs", "Compile"), + BuildFileList(projectDir, "*.resx", "EmbeddedResource")); var packageReferences = dependencies.Where(r => !projectMapping.ContainsKey(r.Key)) .ToDictionary(k => k.Key, k => (string)k.Value); @@ -302,6 +300,15 @@ functions } } + private static string BuildFileList(string projectDir, string pattern, string elementName) + { + return String.Join(Environment.NewLine, + Directory.GetFiles(projectDir, pattern, SearchOption.AllDirectories) + .Select(p => p.Substring(projectDir.Length).Trim(Path.DirectorySeparatorChar)) + .Where(p => !p.StartsWith(@"obj\")) + .Select(p => String.Format(@"<{0} Include=""{1}"" />", elementName, p))); + } + private static string GetProjectKTargets(string packagesDir) { var projectK = Directory.GetDirectories(packagesDir, "ProjectK*")