Build number increment

Developer
Feb 23, 2009 at 9:01 PM
Hi,

Could you please apply my patch (or write your version) to your code? I use your plugin with my change to increment only build version number. Probably you can use my changes to add YearDayOfYear_AutoIncrement, because now you have current version information inside CreateBuildVersion method.

-- patch --
62c62
<         DeltaBaseYear = 2
---
>         DeltaBaseYear = 2,
63a64
>         AutoIncrementBuildNumber
654c655,656
<                                                         "DeltaBaseYear takes the time elapsed since the given start date and formats the buildversion as string.Format(\"{0}{1:000}.{2:HHmm}\", deltaYears.ToString(), dayOfyear, now)"};
---
>                                                         "DeltaBaseYear takes the time elapsed since the given start date and formats the buildversion as string.Format(\"{0}{1:000}.{2:HHmm}\", deltaYears.ToString(), dayOfyear, now)",
>                                                        "TODO"};
-- end patch --

-- patch --
101d100
<             string currentBuildVersion = CreateBuildVersion(solutionItem.BuildVersioningStyle);
110c109
<                     try
---
>                     try
112c111
<                         string pattern = "^[\\[<]assembly:\\ ?" + attribute + "(Attribute)?\\(\"\\d+\\.\\d+\\.(?<Version>[^\"]+)\"\\)[\\]>]";
---
>                         string pattern = "^[\\[<]assembly:\\ ?" + attribute + "(Attribute)?\\(\"(?<FullVersion>\\d+\\.\\d+\\.(?<Version>[^\"]+))\"\\)[\\]>]";
123c122,126
<                         if (m.Groups["Version"].Value != currentBuildVersion)
---
>                         Version existingVersion = new Version(m.Groups["FullVersion"].Value);
>                         _connect.Log("Existing version \"" + existingVersion + "\"", LogLevel.Info);
>                         string currentBuildVersion = CreateBuildVersion(solutionItem.BuildVersioningStyle, existingVersion);
>
>                         if (m.Groups["Version"].Value != currentBuildVersion)
437c440
<         private string CreateBuildVersion(BuildVersioningStyleType buildVersioningStyleType)
---
>         private string CreateBuildVersion(BuildVersioningStyleType buildVersioningStyleType, Version existingVer)
464a468,470
>
>                 case BuildVersioningStyleType.AutoIncrementBuildNumber:
>                     return string.Format("{0}.{1}", existingVer.Revision, existingVer.Build + 1);
-- end patch --

Best regards,
Krzysztof Blacha
Coordinator
Feb 28, 2009 at 3:09 PM
Nice work :)

Added you to the developers team so you can add these things yourself.