[genproj] Fix line endings in generated file to be CRLF
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 19 Feb 2015 18:12:10 +0000 (19:12 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 19 Feb 2015 18:23:23 +0000 (19:23 +0100)
The template uses CRLF everywhere, so we should generate the same to avoid mixed line endings.

msvc/scripts/genproj.cs

index 60b4036396213371311c9beeed78e78876abd830..49967e6eefb4356903817f8b26b27bc520a659a5 100644 (file)
@@ -688,8 +688,8 @@ class MsbuildGenerator {
                const string condition_unix    = "Condition=\" '$(OS)' != 'Windows_NT' \"";
                const string condition_windows = "Condition=\" '$(OS)' == 'Windows_NT' \"";
                prebuild =
-                       "    <PreBuildEvent " + condition_unix + ">\n" + prebuild_unix + "\n    </PreBuildEvent>\n" +
-                       "    <PreBuildEvent " + condition_windows + ">\n" + prebuild_windows + "\n    </PreBuildEvent>\n";
+                       "    <PreBuildEvent " + condition_unix + ">" + NewLine + prebuild_unix + NewLine + "    </PreBuildEvent>" + NewLine +
+                       "    <PreBuildEvent " + condition_windows + ">" + NewLine + prebuild_windows + NewLine + "    </PreBuildEvent>" + NewLine;
 
                var all_args = new Queue<string []> ();
                all_args.Enqueue (flags.Split ());
@@ -853,8 +853,8 @@ class MsbuildGenerator {
                string postbuild_windows = string.Empty;
 
                var postbuild =  
-                       "    <PostBuildEvent " + condition_unix + ">\n" + postbuild_unix + "\n    </PostBuildEvent>\n" +
-                       "    <PostBuildEvent " + condition_windows + ">\n" + postbuild_windows + "\n    </PostBuildEvent>";
+                       "    <PostBuildEvent " + condition_unix + ">" + NewLine + postbuild_unix + NewLine + "    </PostBuildEvent>" + NewLine +
+                       "    <PostBuildEvent " + condition_windows + ">" + NewLine + postbuild_windows + NewLine + "    </PostBuildEvent>";
                        
 
                bool basic_or_build = (library.Contains ("-basic") || library.Contains ("-build"));
@@ -866,13 +866,13 @@ class MsbuildGenerator {
                string strongNameSection = "";
                if (StrongNameKeyFile != null){
                        strongNameSection = String.Format (
-                               "  <PropertyGroup>\n" +
-                               "    <SignAssembly>true</SignAssembly>\n" +
+                               "  <PropertyGroup>" + NewLine +
+                               "    <SignAssembly>true</SignAssembly>" + NewLine +
                                "{1}" +
-                               "  </PropertyGroup>\n" + 
-                               "  <PropertyGroup>\n" + 
-                               "    <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>\n" +
-                               "  </PropertyGroup>", StrongNameKeyFile, StrongNameDelaySign ? "    <DelaySign>true</DelaySign>\n" : "");
+                               "  </PropertyGroup>" + NewLine +
+                               "  <PropertyGroup>" + NewLine +
+                               "    <AssemblyOriginatorKeyFile>{0}</AssemblyOriginatorKeyFile>" + NewLine +
+                               "  </PropertyGroup>", StrongNameKeyFile, StrongNameDelaySign ? "    <DelaySign>true</DelaySign>" + NewLine : "");
                }
                Csproj.output = template.
                        Replace ("@SIGNATURE@", strongNameSection).