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

Suggestion: Extend DotNet.BuildConfiguration #2031

Merged
merged 3 commits into from Jul 29, 2018

Conversation

vbfox
Copy link
Contributor

@vbfox vbfox commented Jul 22, 2018

Description

Extend DotNet.BuildConfiguration:

  • Implement ToString to be able to get a string representation
  • Add a way to parse from a string
  • Add an easy way to get a configuration from an environment variable

Combined they allow to use the discriminated union as "one and only" type for .Net build configuration, easily obtaining a value from an environment variable and converting it to string if needed in other tools.

let configuration = DotNet.BuildConfiguration.fromEnvironVarOrDefault "configuration" DotNet.BuildConfiguration.Release

// Later
let cmdLine = sprintf "mytool /configuration %O" configuration

TODO

  • New (API-)documentation for new features exist (Note: API-docs are enough, additional docs are in help/markdown)
  • Fake 5 API guideline is honored

@vbfox vbfox changed the title Add Parse and ToString to DotNet.BuildConfiguration Extend DotNet.BuildConfiguration Jul 22, 2018
@vbfox vbfox changed the title Extend DotNet.BuildConfiguration Suggestion: Extend DotNet.BuildConfiguration Jul 22, 2018
@matthid
Copy link
Member

matthid commented Jul 25, 2018

Question is if we should use a module and lowerCamelCase instead of static member?
Otherwise looks reasonable we could take it as-is imho.

@vbfox
Copy link
Contributor Author

vbfox commented Jul 25, 2018

I'm ok with making it a module, might be more logical.

@matthid matthid merged commit 40ace60 into fsprojects:release/next Jul 29, 2018
@matthid
Copy link
Member

matthid commented Jul 29, 2018

Thanks!

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.

None yet

2 participants