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

Command line not generating proper AssemblyVersion #252

Closed
seankearney opened this issue Sep 10, 2014 · 8 comments
Closed

Command line not generating proper AssemblyVersion #252

seankearney opened this issue Sep 10, 2014 · 8 comments

Comments

@seankearney
Copy link

The AssemblyVersion attribute appears to be generated incorrectly.

GitVersion output

{
  "Major":1,
  "Minor":0,
  "Patch":1,
  "PreReleaseTag":"",
  "PreReleaseTagWithDash":"",
  "BuildMetaData":2,
  "FullBuildMetaData":"2.Branch.master.Sha.84bbec7a3e93663b2caad2262641647e1fd27a1a",
  "MajorMinorPatch":"1.0.1",
  "SemVer":"1.0.1",
  "LegacySemVer":"1.0.1",
  "LegacySemVerPadded":"1.0.1",
  "AssemblySemVer":"1.0.1.0",
  "FullSemVer":"1.0.1+2",
  "InformationalVersion":"1.0.1+2.Branch.master.Sha.84bbec7a3e93663b2caad2262641647e1fd27a1a",
  "ClassicVersion":"1.0.1.2",
  "ClassicVersionWithTag":"1.0.1.2",
  "BranchName":"master",
  "Sha":"84bbec7a3e93663b2caad2262641647e1fd27a1a",
  "AssemblyVersion":"1.0.1.0",
  "AssemblyFileVersion":"1.0.1.2",
  "OriginalRelease":"84bbec7a3e93663b2caad2262641647e1fd27a1a.2014-09-10 17:22:00Z",
  "NuGetVersionV2":"1.0.1",
  "NuGetVersion":"1.0.1"
}

Generated Attributes:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyInformationalVersion("1.0.1+2.Branch.master.Sha.84bbec7a3e93663b2caad2262641647e1fd27a1a")]

I would expect [assembly: AssemblyVersion("1.0.1.0")]

This line appears to be the issue: https://github.com/Particular/GitVersion/blob/a78ef71d41406a223a87e599e2ef9e888449b23d/GitVersionExe/AssemblyInfoFileUpdate.cs#L34

Thoughts?

@gep13
Copy link
Member

gep13 commented Sep 10, 2014

There is definitely some sort of inconsistency here. If you look at what GitVersion is outputing in the JSON response you can see:

  "AssemblyVersion":"1.0.1.0",
  "AssemblyFileVersion":"1.0.1.2",

If these properties names are to be taken at face value, then they should map directly to the properties in the AssemblyInfo file.

I know that there are some "problems" when bumping the AssemblyVersion number too often in terms of references within projects, is that why this decision has been taken?

@seankearney
Copy link
Author

I should mention that the resulting assembly attributes are used to along with the NuGet.exe pack [proj] command. So, I am looking to have my NuGet package at version 1.0.1. Since AssemblyVersion isn't changing the patch my NuGet package version doesn't change.

@andreasohlund
Copy link
Contributor

Can you try to use the strict assembly versioning strategy?

#147

On Wed, Sep 10, 2014 at 8:43 PM, Sean Kearney notifications@github.com
wrote:

I should mention that the resulting assembly attributes are used to along
with the NuGet.exe pack [proj] command. So, I am looking to have my NuGet
package at version 1.0.1. Since AssemblyVersion isn't changing the patch
my NuGet package version doesn't change.


Reply to this email directly or view it on GitHub
#252 (comment)
.

@gep13
Copy link
Member

gep13 commented Sep 10, 2014

Ah, now this makes more sense. FWIW, since GitVersion is marketed as "Use convention to derive a SemVer product version from a GitFlow based repository" I think that Strict has to be the default, with an option to change this if, and only if, the user knowingly changes it.

@seankearney
Copy link
Author

Maybe I am missing it, but it looks like that is only supported with the MSBuild Task. I am working with the Command Line.

@JakeGinnivan
Copy link
Contributor

Pretty sure this is sorted in v2

We now default to using Major.Minor.Patch for the version (used to be Major.Minor).

You can also change this using GitVersionConfig.yaml.

Reopen or let us know if it is still an issue

@JakeGinnivan
Copy link
Contributor

Actually, just noticed this is still not right...

  • The AssemblyVersionFormat argument needs to be removed
  • var assemblyFileVersion = variables[VariableProvider.AssemblySemVer]; -> var assemblyFileVersion = variables[VariableProvider.AssemblyFileSemVer];
  • assemblyVersion should be variables[VariableProvider.AssemblySemVer];

@JakeGinnivan JakeGinnivan reopened this Jan 6, 2015
@JakeGinnivan
Copy link
Contributor

Fixed this properly in 3.0 release branch

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

No branches or pull requests

4 participants