-
Notifications
You must be signed in to change notification settings - Fork 790
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
Feature request: command-line version #3549
Comments
It is already exists in the compiler, however, it is deprecated. As always, it is deprecated and may eventually get removed.
If the warning bothers you try this:
|
Great! I suppose I can pass the git hash there then? |
I think I prematurely closed it. I've updated the initial question with details on what's needed. |
The dotnet sdk attribute generation for F# is not wired up yet.
Build the test to contain whatever you need. There will be no command line mechanism to pass this. The sdk does a good job of passing it through. This sets the System.Reflection.AssemblyInformationalVersionAttribute which is used for this stuff. It will show up as the productversion in explorer. |
Will close as a duplicate of #3113 |
@KevinRansom But that (the xml tag) means I have to modify the file on disk, right? Why not support it from command line? |
I personally agree that supporting these on the command line makes total sense However we follow the rule "do what C# does" here. It doesn't have command line switches. For F# the deprecated |
Pardon my ignorance. Why follow C#? Would it break something to also allow it to come from command line? The use-case is to be able to use the above mentioned tooling; and I don't have xml parsers and generators on the linux command line (that I know of). (But possibly if FAKE grew a CLI I could use the |
Because doing it differently comes with large cost, e.g. in .NET SDK tooling, IDE tooling, anything which processes project files or generates assembly information files (FAKE).
Offering an alternative way of doing the same thing is ok though since F# 2.0 we avoided it unless we were totally sure we were bringing differentiate value. It's just work (implementing it, checking for duplicate information, testing etc.) |
Can't we use this issue to track this feature request – specifically from command line – and when the time comes and the It would be very useful in all my nugets and it would be used very much. As example of how much it would help; all PRs to my projects, Suave, Expecto, Logary, HTTP.fs and so on, to implement support for .Net Core has failed to include the auto-generated AssemblyInfo.fs file, despite remembering the command-line version flag. Had that version flag traversed all the way to the compiler, (when wired up), we wouldn't have had the tens of people asking why assembly redirects with Suave didn't work (thereby providing some of them a bad initial experience to F# dev). |
@haf But wouldn't those PRs have used the technique from #3113 to specify the version? We would encourage that, even if it means modifying the file (or presumably passing a |
If I manually have to modify the file, it is not what I'm after. If I can call dotnet or whatever and THAT modifies the file; it's fine. Is that the technique? |
@haf If I understand correctly, using |
I think this bug should be re-opened since it's not solved for mono which is the latest stable toolchain we're using, and #3113 is about the .Net Core SDK. Neither Use case: - name: eu.gcr.io/$PROJECT_ID/fsharp
waitFor: ["fsharp-restore", "js-build-langs"]
id: fsharp-build-1
args:
- msbuild
- /verbosity:minimal
- /p:Configuration=Release
# https://cloud.google.com/container-builder/docs/configuring-builds/substitute-variable-values
- /p:InformationalVersion=v2.0.0-alpha.$SHORT_SHA
- Api.sln |
Based on the updated issue text + @haf's sample dockerfile I'll re-open this. @KevinRansom and @dsyme can you confirm if there would be any additional work beyond using @haf just to give you some perspective on timing, we're full steam ahead on the remaining work for Type Providers and F# Interactive on .NET Core, aiming for the 2.1 release which will be in Q2 2018. There are some higher-priority things to finish first (such as #4034) in addition to that, so while I'd like to say we could get this in for 2.1, the conservative side of me says not to count on it. |
@cartermp No worries, I can wait; I've done a workaround for now that involves environment variables. It feels good to have an open issue to track the problem with. |
Would be great to get this feature :) 👍 |
This feature is not likely to happen, the .NET Sdk has good support for configuring these values. and the .NET Sdk is the long term direction that we are aiming at for project file configuration, Mono too is heading that way. Kevin |
Just to clarify here, Mono is moving towards using the .NET SDK as well, so we just have one tool set and project file format for cross-platform (which does support this use case now). Any work independently of that would be an interim solution that would eventually end up in the bucket of legacy-we-need-to-support-but-wish-we-didn't-have-to, or something to eventually phase out with deprecation warnings, which is also additional work. |
Thank you for clarifying your aims further. Just to make it even clearer; are you saying I can pass the version to |
Like this:
Note the error message says that the specified value is invalid. This happens because the use any string fix, is not yet in released product. |
I'd like to supply assembly version info using the command line and not have to generate a file.
Use-case is to provide a build step for Container Builder and allow me to attach a git commit hash to the assembly metadata (not necessarily a numeric)
Requirements:
The text was updated successfully, but these errors were encountered: