Last active
January 30, 2016 10:07
-
-
Save 3F/f54ad9736a9cbb984785 to your computer and use it in GitHub Desktop.
Example of the Version class for vsSolutionBuildEvent documentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code was generated by a tool. | |
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. | |
namespace net.r_eg.vsSBE | |
{ | |
internal class Version | |
{ | |
public static readonly System.Version number = new System.Version(0, 11, 3, 47085); | |
public const string numberWithRevString = "0.11.3.47085"; | |
public const string numberString = "0.11.3"; | |
public const string branchName = "master"; | |
public const string branchSha1 = "399a7e8"; | |
public const string branchRevCount = "212"; | |
public const string informational = "0.11.3.47085 [ 399a7e8 ]"; | |
public const string informationalFull = "0.11.3.47085 [ 399a7e8 ] /'master':212"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
try | |
{ | |
Provider.ILibrary library = loader.load(solutionFile, properties, libPath, false); | |
msg("Library: loaded from '{0}' :: v{1} [{2}] /'{3}':{4}", | |
library.Dllpath, | |
library.Version.Number.ToString(), | |
library.Version.BranchSha1, | |
library.Version.BranchName, | |
library.Version.BranchRevCount); | |
library.Event.solutionOpened(pUnkReserved, 0); | |
return library; | |
} | |
catch(Exception ex) { | |
// ... | |
} | |
throw new AbortException(); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
[assembly: AssemblyVersion(Version.numberString)] | |
[assembly: AssemblyFileVersion(Version.numberString)] | |
[assembly: AssemblyInformationalVersion(Version.informational)] | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !DEBUG | |
labelVersionVal.Text = String.Format("v{0} [ {1} ]", Version.numberWithRevString, Version.branchSha1); | |
if(Version.branchName.ToLower() != "releases") { | |
labelVersionVal.Text += String.Format(" /\"{0}\":{1}", Version.branchName, Version.branchRevCount); | |
} | |
#else | |
labelVersionVal.Text = String.Format("v{0} Debug [ {1} ] /\"{2}\":{3}", | |
Version.numberWithRevString, | |
Version.branchSha1, | |
Version.branchName, | |
Version.branchRevCount); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cross link: Automatic Version Numbering