Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Set the file version environment variable #192

Merged
merged 1 commit into from
Mar 30, 2015

Conversation

victorhurdugaci
Copy link
Contributor

This change is to set an environment variable for the AssemblyFileVersion attribute.

The version has 5 characters, the first 3 are the number of months since 2015/1/1 and the last 2 are the day of the month. @joeloff suggested this format since it is used in other places. For example, today's version is 00327.

Please review: @joeloff @pranavkm

@Eilon, @davidfowl are you okay with the version in this format?

There is a DNX change coming soon that will actually write the attribute.

Part of the fix for aspnet/dnx#1504

@Eilon
Copy link
Member

Eilon commented Mar 28, 2015

That's a very wacky versioning scheme. Why not just YYMMDD? Or YYYYMMDD?

Also, why is it always 1.0.*.0? That would be very confusing given that our product versions are often not 1.0.*.0.

@pranavkm
Copy link
Contributor

File versions are capped at 65k (http://blogs.msdn.com/b/msbuild/archive/2007/01/03/why-are-build-numbers-limited-to-65535.aspx). So most leading year based schemes are broken.


string version = "0";

// If the computer date is set before the start date, then the version is 0
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems pretty unrealistic.

@pranavkm
Copy link
Contributor

@joeloff
Copy link

joeloff commented Mar 30, 2015

I suggested the wacky scheme to give a maximum number of versions beyond the typical six year limitation we have today with the old .NET scheme

@victorhurdugaci
Copy link
Contributor Author

Updated. You should be able to specify the pattern now with a wildcard. If for example MVC want v6, then it can set the pattern to 6.0.*.0 and * will be replaced by the number that we autogenerate

var assemblyFileVersion = E("DNX_ASSEMBLY_FILE_VERSION");
if (string.IsNullOrEmpty(assemblyFileVersion))
{
assemblyFileVersion = "1.0.*.0";
Copy link

Choose a reason for hiding this comment

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

Does Sake support comments? Should we document how * is used?

@victorhurdugaci
Copy link
Contributor Author

Changed the logic to only set the number that we increment. DNX does all the rest

@victorhurdugaci victorhurdugaci merged commit 188f5e8 into release Mar 30, 2015
@victorhurdugaci victorhurdugaci deleted the victorhu/fileversion branch March 30, 2015 22:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants