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:
authorJose Perez Rodriguez <joperezr@microsoft.com>2016-01-11 22:43:08 +0300
committerJose Perez Rodriguez <joperezr@microsoft.com>2016-01-11 22:43:08 +0300
commit3cbbca94331bd78f881903a2fd21edf2ebea4e31 (patch)
treeb3603a6208afd2c61fe8d12d9b84999a5a6aad6d /dir.targets
parent5c09275d6aba0bb21e0392adaf6b3d99eff80b2e (diff)
Updating Dev Workflow
[tfs-changeset: 1562939]
Diffstat (limited to 'dir.targets')
-rw-r--r--dir.targets124
1 files changed, 10 insertions, 114 deletions
diff --git a/dir.targets b/dir.targets
index e031a1bd60..a9151ec8c2 100644
--- a/dir.targets
+++ b/dir.targets
@@ -1,122 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" InitialTargets="_RestoreBuildToolsWrapper" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <!-- Inline task to bootstrap the build to enable downloading nuget.exe -->
- <UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
- <ParameterGroup>
- <Address ParameterType="System.String" Required="true" />
- <FileName ParameterType="System.String" Required="true" />
- </ParameterGroup>
- <Task>
- <Reference Include="System" />
- <Reference Include="System.IO" />
- <Code Type="Fragment" Language="cs">
- <![CDATA[
- var directory = System.IO.Path.GetDirectoryName(FileName);
- Directory.CreateDirectory(directory);
-
- var tempFile = Path.Combine(directory, Path.GetRandomFileName());
- var client = new System.Net.WebClient();
- client.Proxy = System.Net.WebRequest.DefaultWebProxy;
- if (client.Proxy != null) client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
- var tryCount = 1;
- var maxTries = 3;
-
- while (tryCount <= maxTries)
- {
- try
- {
- Log.LogMessage("Attempting to download {0}...", Address);
- client.DownloadFile(Address, tempFile);
- break;
- }
- catch (System.Net.WebException e)
- {
- tryCount++;
- if (tryCount > maxTries)
- {
- throw;
- }
- else
- {
- Log.LogMessage(MessageImportance.High, "Download failed, retrying: {0}", e.Message);
- }
- }
- }
-
- try
- {
- if (!File.Exists(FileName))
- File.Move(tempFile, FileName);
- }
- finally
- {
- if (File.Exists(tempFile))
- File.Delete(tempFile);
- }
- ]]>
- </Code>
- </Task>
- </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.
- -->
- <Target Name="_RestoreBuildToolsWrapper" DependsOnTargets="_RestoreBuildTools" Condition="'$(RestorePackages)' != 'false'"/>
-
- <Target Name="_RestoreBuildTools"
- Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.$(OsEnvironment).config"
- Outputs="$(BuildToolsSemaphore)">
- <Message Importance="High" Text="Restoring build tools..." />
-
- <Copy Condition="Exists('$(NuGetCachedPath)')" SourceFiles="$(NuGetCachedPath)" DestinationFiles="$(NuGetToolPath)" SkipUnchangedFiles="true" />
-
- <!-- Download latest nuget.exe -->
- <DownloadFile FileName="$(NuGetToolPath)"
- Address="https://www.nuget.org/nuget.exe"
- Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Windows_NT'" />
-
- <Exec Command="curl -sSL --create-dirs -o $(NuGetToolPath) https://api.nuget.org/downloads/nuget.exe"
- Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Unix'" />
-
- <PropertyGroup>
- <_RestoreBuildToolsCommand>$(NugetRestoreCommand) "$(SourceDir).nuget/packages.$(OsEnvironment).config"</_RestoreBuildToolsCommand>
- </PropertyGroup>
-
- <!-- Restore build tools -->
- <Exec Command="$(_RestoreBuildToolsCommand)" StandardOutputImportance="Low" />
-
- <!-- Add DNU and Roslyn tool execute rights -->
- <Exec Condition="'$(OsEnvironment)'=='Unix'"
- Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnu&quot;" />
- <Exec Condition="'$(OsEnvironment)'=='Unix'"
- Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnx&quot;" />
- <Exec Condition="'$(OsEnvironment)'=='Unix'"
- Command="find '$(RoslynPackageDir)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />
-
- <!--
- 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="$(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." />
+<Project ToolsVersion="12.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Target Name="CheckForBuildTools">
+ <Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'=='true'"
+ Text="The tools directory [$(ToolsDir)] does not exist. Please run sync in your enlistment to ensure the tools are installed before attempting to build an individual project." />
+ <Error Condition="!Exists('$(ToolsDir)') and '$(OverrideToolsDir)'!='true'"
+ Text="The tools directory [$(ToolsDir)] does not exist. Please run init-tools.cmd in your enlistment to ensure the tools are installed before attempting to build an individual project." />
</Target>
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
<Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
<Target Name="Test" />
+
+ <Import Project="$(ToolsDir)/Build.Common.targets" />
+
</Project>