Skip to content

Commit

Permalink
Revert the attempt to share signal file path between MSBuild and VS e…
Browse files Browse the repository at this point in the history
…xtension code, because it doesn't get populated at the right time
  • Loading branch information
SteveSandersonMS committed Apr 4, 2018
1 parent df25c95 commit 3c4c7ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ public int UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg
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);
}
}
});
Expand Down

0 comments on commit 3c4c7ac

Please sign in to comment.