Gitversion: Support generating AssemblyVersion attributes in other languages

Created on 30 Mar 2014  路  12Comments  路  Source: GitTools/GitVersion

  • [x] VB

    • [x] Command Line

    • [x] MS Build Task

  • [ ] F#

    • [ ] Command Line

    • [ ] MS Build Task

Most helpful comment

Shouldn't this be a better job for respective language specific compilers?

Yeah it is, this is the issue with putting too much in GitVersion. If we added roslyn to parse the files properly it would add heaps of weight to gitversion. I think documenting different tools to do different things and examples on how to configure them would be a better way to go?

All 12 comments

VB.NET support in the MS Build Task was implemented in #811.

Is F# support still a goal, or can this issue be closed since we have full support for VB.NET reached?

It looks like some work was done here for F# support. Last I can recall there was some specific handling for language specific project extensions where .fsproj was missing but I'm unable to find it at the moment.

https://github.com/GitTools/GitVersion/pull/882/commits/1353214b6a5db6abcadd0c709cc58e372840a950

@pascalberger personally, I am still dubious about this. I would rather see GitVersion as a standalone tool that asserts version numbers. And leave the updating of various files to other, more capable tools, like magic chunks.

@gep13, magic chunks?

In my case updating assembly info at build time is the sole reason why I starting using GitVersion. Other tools in the past that I've tried with Subversion, TFS, and Git have required too much manual customization and team conventions with the build pipeline whereas GitVersion msbuild tasks just seem to work.

With respect to this issue and the current support for F# I have forked and done what I believe is the necessary work to put support on par with VB.NET and C# languages. I'll be putting in a pull request for these changes soon.

@jpierson sorry, should have linked to it...

https://github.com/sergeyzwezdin/magic-chunks

It is very good at what it does.

@gep13, thanks magic chunks looks interestesting. I'm not sure how that relates to updating the actual version numbers on an assembly though unless that tool is also updating source files in addition to config like scripts. BTW, I took both approaches in the source-version package which initially just added a version.txt file into the content of a web application but had changed to generate a version.json file instead in addition to updating the AssemblyVersion stuff as well.

I looked briefly at adding support for F# in InvalidFileChecker but the regex approach doesn't seem like the correct way to be testing these auto generated source files. Shouldn't this be a better job for respective language specific compilers? How are other projects testing code gen output?

Looking a bit deeper in how it appears InvalidFileChecker is used outside of the tests this may be a non-issue for F# projects as they seem to use a first-in-wins approach with conflicting assembly attributes and no build error occurs.

Shouldn't this be a better job for respective language specific compilers?

Yeah it is, this is the issue with putting too much in GitVersion. If we added roslyn to parse the files properly it would add heaps of weight to gitversion. I think documenting different tools to do different things and examples on how to configure them would be a better way to go?

Another case is C++ .rc file versioning, e.g. in mixed C#/C++ solutions.
Maybe it could be solved generically by allowing to specify regex(s) for the file update?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cryptomatt picture cryptomatt  路  4Comments

pcoombe picture pcoombe  路  5Comments

makuepfer picture makuepfer  路  4Comments

drewwilliams1982 picture drewwilliams1982  路  5Comments

mikeblakeuk picture mikeblakeuk  路  3Comments