diff options
author | Patrick McDonald <paddymcdonald@gmail.com> | 2015-05-20 19:21:01 +0300 |
---|---|---|
committer | Patrick McDonald <paddymcdonald@gmail.com> | 2015-05-20 19:21:01 +0300 |
commit | 3324f4b00f85cc27c1c4fbf0c040e98dbf1fbd91 (patch) | |
tree | 4585135aa6b31897c77ffccf5b93de458a391adb /dir.targets | |
parent | ee9c51f501cc367b339fe0799fef95fb05f66235 (diff) |
Support Proxy servers for our nuget download task
Reapply #38, but handle the case when DefaultWebProxy is null.
Fix #963
Diffstat (limited to 'dir.targets')
-rw-r--r-- | dir.targets | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dir.targets b/dir.targets index b61b410ef5..f3405083c5 100644 --- a/dir.targets +++ b/dir.targets @@ -17,6 +17,8 @@ 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; @@ -57,7 +59,7 @@ </Task> </UsingTask> - <!-- + <!-- 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. --> @@ -86,7 +88,7 @@ <Exec Command="$(_RestoreBuildToolsCommand)" StandardOutputImportance="Low" /> <!-- currently DNU doesn't support -ConfigFile: https://github.com/aspnet/dnx/issues/1693 - Our DnuRestoreCommand doesn't force a config file and we rely on the + Our DnuRestoreCommand doesn't force a config file and we rely on the directory probing for it to find nuget.config. This works for restore from source, but not restore from PackagesDir as happens for test project restore since PackagesDir will not be under src. To workaround, copy our nuget.config to packages. --> @@ -99,7 +101,7 @@ <Exec Condition="'$(OsEnvironment)'=='Unix'" Command="chmod a+x "$(DnxPackageDir)/bin/dnx"" /> <Exec Condition="'$(OsEnvironment)'=='Unix'" - Command="find '$(RoslynPackageDir)tools' -name "*.exe" -exec chmod "+x" '{}' ';'" /> + Command="find '$(RoslynPackageDir)tools' -name "*.exe" -exec chmod "+x" '{}' ';'" /> <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." /> |