Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Enable interactive optional tools authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer committed Apr 3, 2019
1 parent 3559172 commit a0d5ef3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions eng/Tools.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,25 @@
</ItemGroup>

<!--
Temporarily opt-in as dotnet restore interactive doesn't seem to work.
https://github.com/NuGet/Home/issues/7812. Use nuget restore meanwhile.
Restore internals tools if OptionalToolSource environment variable is set or
/p:RestoreInternalTools=true is passed in.
-->
<Target Name="InitOptionalTools"
Condition="'$(RestoreInternalTools)' == 'true'"
Condition="'$(OptionalToolSource)' != '' or '$(RestoreInternalTools)' == 'true'"
AfterTargets="Restore">

<PropertyGroup>
<CredentialsProviderScriptUrl Condition="'$(OS)' == 'Windows_NT'">https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1</CredentialsProviderScriptUrl>
<CredentialsProviderScriptUrl Condition="'$(OS)' != 'Windows_NT'">https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh</CredentialsProviderScriptUrl>
</PropertyGroup>

<DownloadFile SourceUrl="$(CredentialsProviderScriptUrl)" DestinationFolder="$(ArtifactsDir)">
<Output TaskParameter="DownloadedFile" ItemName="CredentialsProviderScriptPath" />
</DownloadFile>

<Exec Condition="'$(OS)' == 'Windows_NT'" Command="powershell -ExecutionPolicy ByPass -NoProfile -File &quot;%(CredentialsProviderScriptPath.Identity)&quot;" />
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="chmod +x &quot;%(CredentialsProviderScriptPath.Identity)&quot; %26%26 &quot;%(CredentialsProviderScriptPath.Identity)&quot;" />

<PropertyGroup>
<OptionalToolDir>$([MSBuild]::NormalizeDirectory('$(RepositoryEngineeringDir)', 'common', 'internal'))</OptionalToolDir>
<OptionalToolProjectPath>$(OptionalToolDir)Tools.csproj</OptionalToolProjectPath>
Expand Down

0 comments on commit a0d5ef3

Please sign in to comment.