Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dir.targets26
1 files changed, 17 insertions, 9 deletions
diff --git a/dir.targets b/dir.targets
index f99d427a6e..b24dcdffa0 100644
--- a/dir.targets
+++ b/dir.targets
@@ -60,6 +60,13 @@
</UsingTask>
<!--
+ Use a semaphore file to determine the need to restore build tools to avoid conflicts with locked binaries.
+ -->
+ <PropertyGroup>
+ <BuildToolsSemaphore>$(ToolsDir)BuildTools.semaphore</BuildToolsSemaphore>
+ </PropertyGroup>
+
+ <!--
Needed to avoid the IntialTargets from having an Output which ends up getting
added to the output references when you have a project to project reference.
-->
@@ -67,7 +74,7 @@
<Target Name="_RestoreBuildTools"
Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.$(OsEnvironment).config"
- Outputs="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll;$(NugetToolPath);$(DnuToolPath)">
+ Outputs="$(BuildToolsSemaphore)">
<Message Importance="High" Text="Restoring build tools..." />
<Copy Condition="Exists('$(NuGetCachedPath)')" SourceFiles="$(NuGetCachedPath)" DestinationFiles="$(NuGetToolPath)" SkipUnchangedFiles="true" />
@@ -95,16 +102,17 @@
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="find '$(RoslynPackageDir)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />
- <Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
- Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
-
<!--
- There are cases where the inputs could be newer than the outputs but the
- download or restore may not need to update. In such cases we need to touch
- these files otherwise we continually run this target over and over for
- every project until these files are cleaned (if the are ever cleaned).
+ Touch our semaphore file to ensure Inputs/Outputs comparison for this target will show that we're up to date.
+ Ignore failures in the unlikely, but possible, event that we hit this from two projects simultaneously.
-->
- <Touch Files="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll;$(NugetToolPath);$(DnuToolPath)" />
+ <Touch Files="$(BuildToolsSemaphore)"
+ ContinueOnError="WarnAndContinue"
+ AlwaysCreate="true"
+ ForceTouch="true" />
+
+ <Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
+ Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
</Target>
<!-- Provide default targets which can be hooked onto or overridden as necessary -->