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

GitVersionInformation in SDK-style projects #1242

Closed
bording opened this issue Jun 23, 2017 · 3 comments · Fixed by #1249
Closed

GitVersionInformation in SDK-style projects #1242

bording opened this issue Jun 23, 2017 · 3 comments · Fixed by #1249

Comments

@bording
Copy link
Contributor

bording commented Jun 23, 2017

In 4.0, UpdateAssemblyInfo is false for the new SDK-style projects, which makes sense since the appropriate values can be injected via UpdateVersionProperties.

However, this means that the static GitVersionInformation class is also no longer generated by default, which means SDK-style projects lose the ability to inspect version properties at run-time.

Setting UpdateAssemblyInfo to true works, but it's a pain because you then end up with assembly attribute conflicts, which means you have to add something like this to your project file also:

<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>

I'd like to see the generation of GitVersionInformation be controlled separately and be enabled by default even for SDK-style projects.

Is this something that sounds reasonable? I'd be willing to work on this if it sounds like something you'd accept.

@asbjornu
Copy link
Member

@bording: Thanks, I agree GitVersionInformation has value without Assembly*Info attributes. Perhaps you can take a look at all the other attribute related issues and see whether you can smack a few birds with one stone here? 😄

Related issues: #529, #895, #964, #1183, #1214, #1231, #1241.

@bording
Copy link
Contributor Author

bording commented Jun 29, 2017

Looking over those issues and some of the TODOs in the code, here's what I'm thinking of as a plan of attack for this:

  • Move the AssemblyInfo logic from GitVersionExe's AssemblyInfoFileUpdate class and GitVersionTask's UpdateAssemblyInfo class into GitVersionCore
  • Use the templates that are already in GitVersionCore instead of the ones in GitVersionTask
  • Generalize the update code to be able to handle another template type: GitVersionInformation and expose a way to use it from GitVersionExe and GitVersionTask

With that in place, it should be easier to also fix some of the other issues you linked to as well. How does that sound?

@asbjornu
Copy link
Member

@bording: Fantastic! Whole-heartedly supported! 😄 👍 🎉

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 a pull request may close this issue.

2 participants