Bug: Projucer VS2019 multi line pre build and post build steps don't work

Projucer VS2019 multi line pre-build and post-build steps don’t work (except if they are generated by the Projucer, like the AAX post build steps).

Here is a fix:

--- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h
+++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h
@@ -1134,6 +1134,7 @@ public:
         String getPostBuildSteps (const MSVCBuildConfiguration& config) const
         {
             auto postBuild = config.getPostbuildCommandString();
+            postBuild = postBuild.replace ("\n", "\r\n");^M
             auto extraPostBuild = getExtraPostBuildSteps (config);

             return postBuild + String (postBuild.isNotEmpty() && extraPostBuild.isNotEmpty() ? "\r\n" : "") + extraPostBuild;
@@ -1142,6 +1143,7 @@ public:
         String getPreBuildSteps (const MSVCBuildConfiguration& config) const
         {
             auto preBuild = config.getPrebuildCommandString();
+            preBuild = preBuild.replace ("\n", "\r\n");^M
             auto extraPreBuild = getExtraPreBuildSteps (config);

             return preBuild + String (preBuild.isNotEmpty() && extraPreBuild.isNotEmpty() ? "\r\n" : "") + extraPreBuild;

Thanks for reporting.

2 Likes

Thanks for fixing.