Skip to content

Commit df06c54

Browse files
authored
Wrap these commands with quotes (#11807)
I'm pretty exactly following the diff from #917. These paths weren't wrapped in `"`s, so building the solution in a directory with a space in it would explode. Closes #917. Turns out, the diff provided by that user wasn't exactly right. I've tested building in a directory with spaces now, and this seems to work. Also caught a bug in the Generate Feature Flags script.
1 parent a98d18c commit df06c54

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

build/rules/GenerateFeatureFlags.proj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@
6363
Outputs="$(OpenConsoleCommonOutDir)\inc\TilFeatureStaging.h"
6464
DependsOnTargets="_GenerateBranchAndBrandingCache">
6565
<MakeDir Directories="$(OpenConsoleCommonOutDir)\inc" />
66+
<!-- This commandline is escaped like:
67+
68+
powershell -Command "&'$(SolutionDir)\tools\Generate-FeatureStagingHeader.ps1' -Path '%(FeatureFlagFile.FullPath)'' -Branding $(_WTBrandingName)"
69+
70+
which was the only way I could find to get it to obey spaces in the SolutionDir
71+
-->
6672
<Exec
67-
Command="powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy ByPass -Command &quot;$(SolutionDir)\tools\Generate-FeatureStagingHeader.ps1&quot; -Path &quot;%(FeatureFlagFile.FullPath)&quot; -Branding $(_WTBrandingName)"
73+
Command="powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy ByPass -Command &quot;&amp;&apos;$(SolutionDir)\tools\Generate-FeatureStagingHeader.ps1&apos; -Path &apos;%(FeatureFlagFile.FullPath)&apos; -Branding $(_WTBrandingName)&quot;"
6874
ConsoleToMsBuild="true"
6975
StandardOutputImportance="low">
7076
<Output TaskParameter="ConsoleOutput" ItemName="_FeatureFlagFileLines" />

src/host/ft_uia/Host.Tests.UIA.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
144144
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
145145
<PropertyGroup>
146-
<PostBuildEvent>copy $(SolutionDir)\dep\WinAppDriver\* $(OutDir)\</PostBuildEvent>
146+
<PostBuildEvent>copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)\&quot;</PostBuildEvent>
147147
</PropertyGroup>
148148
<Import Project="..\..\..\packages\Microsoft.Taef.10.60.210621002\build\Microsoft.Taef.targets" Condition="Exists('..\..\..\packages\Microsoft.Taef.10.60.210621002\build\Microsoft.Taef.targets')" />
149149
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -152,4 +152,4 @@
152152
</PropertyGroup>
153153
<Error Condition="!Exists('..\..\..\packages\Microsoft.Taef.10.60.210621002\build\Microsoft.Taef.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Taef.10.60.210621002\build\Microsoft.Taef.targets'))" />
154154
</Target>
155-
</Project>
155+
</Project>

src/propsheet/propsheet.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@
7878
<AdditionalIncludeDirectories>$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
7979
</ResourceCompile>
8080
</ItemDefinitionGroup>
81+
<!-- If you don't include a '.' at the end of the $(IntermediateOutputPath),
82+
mc.exe will get confused by the trailing slash. -->
8183
<Target Name="MessageCompile" Inputs="@(MessageCompile)" Outputs="$(IntermediateOutputPath)\%(MessageCompile.Filename).h" BeforeTargets="ClCompile">
82-
<Exec Command="mc.exe /h $(IntermediateOutputPath) /r $(IntermediateOutputPath) @(MessageCompile)" />
84+
<Exec Command="mc.exe /h &quot;$(IntermediateOutputPath).&quot; /r &quot;$(IntermediateOutputPath).&quot; @(MessageCompile)" />
8385
</Target>
8486
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
8587
<Import Project="..\common.build.post.props" />

0 commit comments

Comments
 (0)