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

GitVersion with NuGet IncludeReferencedProjects on feature branches #1240

Closed
kingofzeal opened this issue Jun 22, 2017 · 2 comments
Closed
Labels

Comments

@kingofzeal
Copy link

We have a .NET solution that contains many common libraries used across our other products. The projects tend to build on each other, extending functionality to more specific (but still common) purposes - for example, We have:
Core
Core.Data (dependency on Core)
Core.Data.Sql (dependency on Core.Data and Core)

We use the -IncludeReferencedProjects when building the NuGet packages, and commits are normally made against the master branch (with GitVersion configured for mainline development).

We've recently had to cut a branch for some development, and we are noticing that the NuGet package has a dependency referencing the assembly version, not the nuget package version, so we are unable to update them in the upstream solutions.

For example, Core.Data.Sql 4.0.8-branch0004 has a dependency on Core.Data 4.0.8-branch.4 (which doesn't exist - Core.Data 4.0.8-branch0004 does). We could update the nuget version on pack to be the SemVer version, but my understanding is that Core.Data 4.0.8-branch.10 will be considered 'less' than Core.Data 4.0.8-branch.9 (when in fact it's greater).

It looks like when we patch the assembly version with GitVersion we don't have control over which of the calculated versions should be used. In this case, it would be nice to be able to change the version to use NuGetVersion (or NuGetVersionV2) instead of SemVer.

Is there any way to resolve this issue?

@asbjornu
Copy link
Member

asbjornu commented Jun 22, 2017

Sounds like what you need is assembly-version-format, similar to assembly-informational-format. It's starting to become rather messy with both assembly-versioning-scheme and
assembly-file-versioning-scheme there already, though.

To get around the issue of assembly-informational-format missing the word version and being able to expand the formatting capability of all [Assembly*Version] attributes, perhaps we should mint an entirely new YAML key for this? Something like:

version-schemes:
    assembly-version: '{MajorMinorPatch}'
    assembly-file-version: '{MajorMinorPatchTag}'
    assembly-informational-version: '{InformationalVersion}'

I think we could co-support the current functionality along with a new, much more flexible system based on format strings instead of enum values. The only enum value I would consider supporting is None, which as per #964 should mean the corresponding Assembly*Version attribute would not be emitted. Not sure that we can support both strings and enums simultaneously in the same key, though.

#886 might be talking about the same needs, but I'm unsure if they are fulfilled by #1130 or not. Either way, let's discuss how to solve this formatting requirement once and for all.

/cc @GitTools/developers

@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 29, 2019
@stale stale bot closed this as completed Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants