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

Add nuget restore source and set WorkingDirectory to RepoRoot for global tools install #33860

Merged
merged 1 commit into from
Dec 6, 2018

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Dec 6, 2018

  • Adding nuget restore source to dotnet tool install command as the sources are cleared in the root NuGet.config (I have no idea why it worked on Windows!)
  • Changing working directory of dotnet tool commands because of the error discussed here: dotnet/cli#4808.
  • Escaping slashes because of the error discussed here: .net core MSBuild normalizes slashes when it shouldn't msbuild#1622

It seems working with nuget cross-platform is still fragile.

cc @ericstj @safern

@ViktorHofer ViktorHofer self-assigned this Dec 6, 2018
@ViktorHofer ViktorHofer force-pushed the RestoreSourceGlobalTools branch 3 times, most recently from 6dd7d06 to 09f67a1 Compare December 6, 2018 13:07
@ViktorHofer ViktorHofer changed the title Add restore source to global tools restore Add nuget restore source to Tools.props and set WorkingDirectory to RepoRoot for global tools install Dec 6, 2018
@ViktorHofer ViktorHofer changed the title Add nuget restore source to Tools.props and set WorkingDirectory to RepoRoot for global tools install Add nuget restore source and set WorkingDirectory to RepoRoot for global tools install Dec 6, 2018
@ViktorHofer
Copy link
Member Author

test code coverage

Unrelated but as there is no official code coverage build yet I use this PR to test it.

@ViktorHofer
Copy link
Member Author

@dotnet-bot test Windows x64 Debug Build
@dotnet-bot test Windows x86 Release Build

ContinueOnError="WarnAndContinue" />

<!--
Installs the global tool if it doesn't exist with the right version.
Creates the global tools folder automatically if it doesn't exist.
-->
<Exec Condition="!Exists($(GlobalToolsDir)) OR !$([System.Text.RegularExpressions.Regex]::IsMatch('$(DotNetListToolsOutput)', '$([System.Text.RegularExpressions.Regex]::Escape('%(RepoTool.Identity)'))\s+$([System.Text.RegularExpressions.Regex]::Escape('%(RepoTool.Version)'))'))"
Command="$(DotNetCmd) tool install --tool-path $(GlobalToolsDir) %(RepoTool.Identity) --version %(RepoTool.Version)"
Command="$(DotNetCmd) tool install --tool-path $(GlobalToolsDir) %(RepoTool.Identity) --version %(RepoTool.Version) --add-source https:%2F%2Fapi.nuget.org/v3/index.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not work for the out-of-proc Exec task.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah right. Could you instead of hardcode it here, declare a property for the restore sources of the tools and then just use that here? That would avoid using %2F as part of the string, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I considered that but as there are right now some issues with the correct encoding of the sources, i.e. there are issues with semicolons and the slashes I didn't do that now. We can revisit that when we need to add global tools that aren't available on nuget.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool.

@ViktorHofer ViktorHofer merged commit 3839c4a into dotnet:master Dec 6, 2018
@ViktorHofer ViktorHofer deleted the RestoreSourceGlobalTools branch December 6, 2018 17:56
jlennox pushed a commit to jlennox/corefx that referenced this pull request Dec 16, 2018
@karelz karelz added this to the 3.0 milestone Dec 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants