Skip to content

Allow newer dotnet cli #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
}

# Make sure the dotnet we found is the right version
if ($dotnetExePath -and (& $dotnetExePath --version) -eq $requiredSdkVersion) {
if ($dotnetExePath -and [version](& $dotnetExePath --version) -ge [version]$requiredSdkVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So why don't we just use a global.json file to specify the SDK version? See https://github.com/PowerShell/PowerShell/blob/master/global.json

Copy link
Member Author

Choose a reason for hiding this comment

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

@rkeithhill that's kinda opposite of why I opened this PR. I didn't want to require 1 particular SDK version. I wanted to be able to build using the dotnet sdk of any version greater than 2.0.

Ex. I have 2.1.4 on my machine and it builds just fine.

By adding a global.json it forces the construct of "you need this exact version" at least until this is implemented:
https://github.com/dotnet/core-setup/issues/679

Copy link
Contributor

@rjmholt rjmholt Mar 20, 2018

Choose a reason for hiding this comment

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

I was just looking for a mechanism to set a minimum version, and lo and behold it led me right back here from that core-setup issue

Copy link
Member Author

Choose a reason for hiding this comment

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

It's so sad. I just want to not have to download a million dotnet sdks 😭

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if it is dl of dotnet or what but every time I debug the extension, it builds PSES and that part is sloooow. :-(

Copy link
Contributor

Choose a reason for hiding this comment

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

dotnet build times have supposedly improved noticeably in the 2.1 preview. Maybe I should try that version to see how it performs.

Copy link
Member Author

Choose a reason for hiding this comment

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

dotnet 2.1 seems good to me :)

this PR will allow you to use that build if you have it on your machine already... but still be compat with 2.0 if folks have that

Copy link
Member Author

Choose a reason for hiding this comment

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

@rkeithhill is that thumbs up a sign off 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW there are a bit too many warnings IMO. At some point, we should clean up what we can. I see a couple of variable not used warnings that should be easy to fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. The unused variable warnings would make a great Up-for-grabs I think.

$script:dotnetExe = $dotnetExePath
}
else {
Expand Down Expand Up @@ -78,7 +78,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
$env:DOTNET_INSTALL_DIR = $dotnetExeDir
}

Write-Host "`n### Using dotnet v$requiredSDKVersion at path $script:dotnetExe`n" -ForegroundColor Green
Write-Host "`n### Using dotnet v$(& $script:dotnetExe --version) at path $script:dotnetExe`n" -ForegroundColor Green
}

task Clean {
Expand Down