Revert the attempt to share signal file path between MSBuild and VS extension code, because it doesn't get populated at the right time

This commit is contained in:
Steve Sanderson 2018-04-04 12:26:51 +01:00
parent 3b0f1313fe
commit 6f7c188a76
2 changed files with 15 additions and 13 deletions

View File

@ -59,16 +59,10 @@
-->
<Target Name="_BlazorIssueLiveReloadNotification"
AfterTargets="Build"
Condition="'$(UseBlazorLiveReloading)'=='true' AND '$(_BlazorDidCopyFilesToOutputDirectory)'=='true'">
<PropertyGroup>
<_BlazorBuildCompletedSignalFullPath>$(ProjectDir)$(OutputPath)$(BlazorBuildCompletedSignalPath)</_BlazorBuildCompletedSignalFullPath>
</PropertyGroup>
<!--
If this is a command-line build, touch the signal file to trigger a reload.
If it's a VS build, then the VS extension will write the signal file instead.
-->
<WriteLinesToFile Condition="'$(BuildingInsideVisualStudio)'!='true'" File="$(_BlazorBuildCompletedSignalFullPath)" Lines="_" />
<Delete Condition="'$(BuildingInsideVisualStudio)'!='true'" Files="$(_BlazorBuildCompletedSignalFullPath)" />
Condition="'$(UseBlazorLiveReloading)'=='true' AND '$(_BlazorDidCopyFilesToOutputDirectory)'=='true' AND '$(BuildingInsideVisualStudio)'!='true'">
<!-- Touch the signal file to trigger a reload -->
<WriteLinesToFile File="$(ProjectDir)$(OutputPath)$(BlazorBuildCompletedSignalPath)" Lines="_" />
<Delete Files="$(ProjectDir)$(OutputPath)$(BlazorBuildCompletedSignalPath)" />
</Target>
<!-- Preparing blazor files for output:

View File

@ -94,10 +94,18 @@ namespace Microsoft.VisualStudio.BlazorExtension
var project = await access.GetProjectAsync(configuredProject);
// Now we can evaluate MSBuild properties
var signalFileFullPath = project.GetPropertyValue("_BlazorBuildCompletedSignalFullPath");
if (!string.IsNullOrEmpty(signalFileFullPath))
var projectDir = project.GetPropertyValue("ProjectDir");
var outputPath = project.GetPropertyValue("OutputPath");
var signalFilePath = project.GetPropertyValue("BlazorBuildCompletedSignalPath");
if (!string.IsNullOrEmpty(projectDir)
&& !string.IsNullOrEmpty(outputPath)
&& !string.IsNullOrEmpty(signalFilePath))
{
_signalFilePathsToNotify.Add(signalFileFullPath);
var fullPath = Path.Combine(
projectDir,
outputPath,
signalFilePath);
_signalFilePathsToNotify.Add(fullPath);
}
}
});