|
3 | 3 | <Target |
4 | 4 | Name="_PrepareRunDesktop" |
5 | 5 | BeforeTargets="ComputeRunArguments" |
| 6 | + DependsOnTargets="_ValidateHotReloadConfiguration" |
6 | 7 | Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'"> |
7 | 8 |
|
| 9 | + <!-- |
| 10 | + If we're running under 'dotnet watch', change a few defaults to: |
| 11 | + * Open in a new instance: enabled |
| 12 | + * Wait for exit: enabled |
| 13 | + * stdout/stderr: send to the current terminal |
| 14 | + --> |
| 15 | + <ItemGroup> |
| 16 | + <_DotNetWatchVariable Include="@(RuntimeEnvironmentVariable)" Condition="'%(Identity)' == 'DOTNET_WATCH' And '%(Value)' == '1'" /> |
| 17 | + </ItemGroup> |
| 18 | + <PropertyGroup Condition="'$(RunWithOpen)' != 'false' And '@(_DotNetWatchVariable->Count())' == '1'"> |
| 19 | + <_IsDotNetWatch>true</_IsDotNetWatch> |
| 20 | + <OpenNewInstance Condition="'$(OpenNewInstance)' == ''">true</OpenNewInstance> |
| 21 | + <OpenWaitForExit Condition="'$(OpenWaitForExit)' == ''">true</OpenWaitForExit> |
| 22 | + </PropertyGroup> |
| 23 | + <Exec |
| 24 | + Command="tty" |
| 25 | + Condition="'$(StandardOutputPath)' == '' Or '$(StandardErrorPath)' == ''" |
| 26 | + ConsoleToMSBuild="true" |
| 27 | + IgnoreStandardErrorWarningFormat="true" |
| 28 | + IgnoreExitCode="true" |
| 29 | + > |
| 30 | + <Output TaskParameter="ConsoleOutput" ItemName="_TtyOutput" /> |
| 31 | + </Exec> |
| 32 | + <PropertyGroup Condition="'$(_IsDotNetWatch)' == 'true'"> |
| 33 | + <_TtyPath>@(_TtyOutput)</_TtyPath> |
| 34 | + <StandardOutputPath Condition="'$(StandardOutputPath)' == '' And Exists('$(_TtyPath)')">$(_TtyPath)</StandardOutputPath> |
| 35 | + <StandardErrorPath Condition="'$(StandardErrorPath)' == '' And Exists('$(_TtyPath)')">$(_TtyPath)</StandardErrorPath> |
| 36 | + </PropertyGroup> |
| 37 | + |
8 | 38 | <PropertyGroup Condition="'$(RunWithOpen)' != 'false'"> |
9 | 39 | <_OpenArguments Condition="'$(XamarinDebugMode)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_MODE__=$(XamarinDebugMode)</_OpenArguments> |
10 | 40 | <_OpenArguments Condition="'$(XamarinDebugPort)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_PORT__=$(XamarinDebugPort)</_OpenArguments> |
|
0 commit comments