Skip to content

Fix Version number Bugs in Net Core Template - #89

Merged
natidea merged 5 commits into
dotnet:masterfrom
natidea:buildTemplates
Aug 25, 2016
Merged

natidea merged 5 commits into
dotnet:masterfrom
natidea:buildTemplates

Conversation

@natidea

@natidea natidea commented Aug 24, 2016

Copy link
Copy Markdown
Contributor

Fixes #64

  • Drop the version suffix from the vsix manifest
  • Generate version in project json template to match current build. Approach here is to use an inline task to replace a token with the version number and write the results to project.json.template before it is zipped into the VSIX.

/cc @srivatsn @eerhardt @dotnet/project-system

Comment thread build/Targets/Templates.Imports.targets Outdated

<!-- Returns the current build version. Used in .vsixmanifests to substitute our build version into them -->
<Target Name="GetBuildVersion" Outputs="$(Version)" />
<Target Name="GetBuildVersion" Outputs="$(VersionPrefix)" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want our daily build number included in the .vsix? That way we can tell which actual build we have? Using just $(VersionPrefix), we will always get "1.0.0". A user/tester won't be able to tell which actual version they are using.

@nguerrera nguerrera Aug 24, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only slightly related: I'm actually concerned about $(VersionPrefix) even being a thing in the customer-facing targets. The weird thing is that this will be 1.0.0 and have no relationship to $(Version) if customer sets $(Version) in csporoj. If we want to have $(VersionPrefix) always available, it should be computed from $(Version), ditto for $(VersionSuffix).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to make a slight change where we only set $(VersionPrefix) if no $(Version) is set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention with VersionSuffix was to provide a way for users to have an easy way to increment their version between builds in a similar way to how they did it in the cli.

There was no intention of a requirement that VersionPrefix always be 1.0.0 in fact in many cases I'd expect it to be something like 1.0.0-beta and VersionSuffix being only a number that increments.

The only concern I have with having VersionSuffix computed from Version is that then the user needs to go and implement the logic to increment the build number. While it would be admittedly simple, why not provide an easier experience? There may be reasons, I am just trying to show my reasoning for the current case.

@nguerrera nguerrera Aug 24, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, right now. If you have say <Version>4.5.6-beta</Version>, <VersionPrefix> is defaulted 1.0.0. This can lead to bugs if we start using VersionPrefix elsewhere in targets.

We can continue to support specifying a prefix and a suffix as we do today, but we should leave VersionPrefix unset if it didn't come from the user..

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A things we make sure everyone is clear on here: @natidea is editing our own build system in this change. This change isn't for customers' projects.

If we want to discuss the usage of $(Version)/$(VersionPrefix)/etc for customers projects, we should do that somewhere else. I don't feel this is the place for that discussion. Please open an issue if what we are doing today is wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad for discussing this inline. I was aware and did that anyway. Sorry. I am going to file a bug.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I don't want to stiffle the conversation, and I think the discussion needs to happen. It just should be more "official", and not be confused with @natidea's change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to guess a valid format for vsix is just n.n.n.n. I've tracked down the setup in roslyn-project-system. Their build numbers are formatted differently $(date:yyyyMMdd)$(rev:.r) versus $(date:yyyyMMdd)$(rev:-r) in our build. But even that wouldn't be valid because it would add a fifth number. The version parsing does $(BuildNumber.Split('.')[0]) to extract just the first part which means you don't get different build versions for two builds on the same day. I'll just concatenate to make the version number unique.


In reply to: 76150160 [](ancestors = 76150160)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #93

@srivatsn

Copy link
Copy Markdown
Contributor

👍

@eerhardt

Copy link
Copy Markdown
Member

:shipit: Thanks, @natidea.

@natidea
natidea merged commit d14a325 into dotnet:master Aug 25, 2016
nguerrera pushed a commit that referenced this pull request Oct 10, 2016
Fix Version number Bugs in Net Core Template
GangWang01 pushed a commit to GangWang01/sdk that referenced this pull request Mar 20, 2023
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 this pull request may close these issues.

Add NET Core Template for CSharp

5 participants