Skip to content
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

GetDotNetSDKVersionFromGlobalJson #1754

Merged
merged 1 commit into from
Jan 28, 2018
Merged

Conversation

forki
Copy link
Member

@forki forki commented Jan 3, 2018

No description provided.

@tomasaschan
Copy link

How will this handle the (pretty common) case when no global.json exists (because the user wants to just use latest)?

@matthid
Copy link
Member

matthid commented Jan 3, 2018

@tlycken I guess you check if the file exists before using this new API? Or you assume the file is there when using the API?

@tomasaschan
Copy link

Ah, yeah, that works. But if so, it would probably be more usable if it returned an option with the version (if a global.json was found, and None if it wasn't) rather than failing. That way one could call this, and provide a fallback (e.g. a hard-coded value) if no global.json is found.

Also, should this traverse parent directories? According to the docs, valid locations are the current directory or any ancestor directory up to the drive root.

@forki
Copy link
Member Author

forki commented Jan 3, 2018 via email

@tomasaschan
Copy link

The global.json acts (sort-of) like paket.lock for the .NET SDK; with it, you can be sure that all developers (and build servers, etc) use the same .NET version, while without it, it just uses the latest.

Even though pinning it is probably a good idea as soon as a project is moderately sized with a team of more than one, i think FAKE should support not having one, with a nice and simple API, since otherwise we're imposing arbitrary requirements on your dotnet configuration that dotnet doesn't impose.

@matthid
Copy link
Member

matthid commented Jan 27, 2018

Even though pinning it is probably a good idea as soon as a project is moderately sized with a team of more than one, i think FAKE should support not having one, with a nice and simple API, since otherwise we're imposing arbitrary requirements on your dotnet configuration that dotnet doesn't impose.

@tlycken Yes, however an API called GetDotNetSDKVersionFromGlobalJson can only throw an exception if the requirement (global.json) is not fullfilled. IMHO there is nothing else meaningful such an API can do. Which version has any meaning in that scenario? People without this requirement just don't call this function.

I feel like either people want to lock down the version and have an error if non is given (this API) or they don't.

matthid added a commit that referenced this pull request Jan 27, 2018
@matthid matthid merged commit 400e334 into master Jan 28, 2018
@tomasaschan
Copy link

@matthid I guess what I'm after is an api that lets me figure out which dotnet version to install, that would respect global.json if it exists, but not blow up if it doesn't (rather figure out which is the latest, and return that). But you're right; that would probably be better to implement with the help of this function, rather than as part of it.

@matthid
Copy link
Member

matthid commented Jan 28, 2018

@tlycken Yes everything is a mess - feel free to suggest an API for this via PR ;)

@matthid matthid deleted the GetDotNetSDKVersionFromGlobalJson branch May 10, 2018 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants