From 844d52f19724599a6e37115d55a94ce0686d0434 Mon Sep 17 00:00:00 2001 From: Steve Ognibene Date: Thu, 7 May 2015 23:28:34 -0400 Subject: [PATCH] Prep for 0.1.0-beta release --- .../Properties/AssemblyInfo.cs | 2 +- Code/TSqlFlex.Core/Properties/AssemblyInfo.cs | 34 ++++++++++--------- Code/TSqlFlex.Core/Utils.cs | 30 +++++++++++++++- Code/TSqlFlex/Properties/AssemblyInfo.cs | 18 +++------- 4 files changed, 53 insertions(+), 31 deletions(-) diff --git a/Code/TSqlFlex.Core.Tests/Properties/AssemblyInfo.cs b/Code/TSqlFlex.Core.Tests/Properties/AssemblyInfo.cs index 5d1770b..76ea8ab 100644 --- a/Code/TSqlFlex.Core.Tests/Properties/AssemblyInfo.cs +++ b/Code/TSqlFlex.Core.Tests/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TSqlFlex.Core.Tests")] -[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Code/TSqlFlex.Core/Properties/AssemblyInfo.cs b/Code/TSqlFlex.Core/Properties/AssemblyInfo.cs index 6d64b75..63dedfa 100644 --- a/Code/TSqlFlex.Core/Properties/AssemblyInfo.cs +++ b/Code/TSqlFlex.Core/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -6,13 +7,16 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TSqlFlex.Core")] -[assembly: AssemblyDescription("Scripts data to INSERT statements or Excel-compatible spreadsheets.")] +[assembly: AssemblyDescription("Scripts SQL Server data.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TSqlFlex.Core")] -[assembly: AssemblyCopyright("Copyright © 2014 Steve Ognibene")] +[assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("0.1.0.0")] +[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblySemverPrereleaseTag("beta")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -22,18 +26,16 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f28ef710-39c6-4254-a0db-e930d24f2372")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.11.0")] -[assembly: AssemblyFileVersion("0.0.11.0")] - //Enable testing internal members of classes. [assembly: InternalsVisibleTo("TSqlFlex.Core.Tests")] + +[AttributeUsage(AttributeTargets.Assembly)] +public class AssemblySemverPrereleaseTag : Attribute +{ + public readonly string tag; + public AssemblySemverPrereleaseTag() : this(string.Empty) { } + public AssemblySemverPrereleaseTag(string value) + { + tag = value; + } +} \ No newline at end of file diff --git a/Code/TSqlFlex.Core/Utils.cs b/Code/TSqlFlex.Core/Utils.cs index 37ac72c..6b97661 100644 --- a/Code/TSqlFlex.Core/Utils.cs +++ b/Code/TSqlFlex.Core/Utils.cs @@ -82,7 +82,16 @@ public static class Info { public static string Version() { - return "v" + VersionNumbersOnly() + "-alpha"; + string tag = SemverPrereleaseTag(); + if (string.IsNullOrEmpty(tag)) + { + return "v" + VersionNumbersOnly(); + } + else + { + return "v" + VersionNumbersOnly() + "-" + tag; + } + } public static string VersionNumbersOnly() @@ -91,6 +100,25 @@ public static string VersionNumbersOnly() FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); return fvi.FileVersion; } + + public static string SemverPrereleaseTag() + { + Assembly assembly = Assembly.GetExecutingAssembly(); + + var attributes = assembly + .GetCustomAttributes(typeof(AssemblySemverPrereleaseTag), false) + .Cast().ToArray(); + + if (attributes.Length == 0) + { + return ""; + } + else + { + return attributes[0].tag; + } + + } } } diff --git a/Code/TSqlFlex/Properties/AssemblyInfo.cs b/Code/TSqlFlex/Properties/AssemblyInfo.cs index 5d5ba3e..ec06041 100644 --- a/Code/TSqlFlex/Properties/AssemblyInfo.cs +++ b/Code/TSqlFlex/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -13,6 +14,9 @@ [assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("0.1.0.0")] +[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblySemverPrereleaseTag("beta")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -22,15 +26,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("aafe5ee1-f39f-4eee-9f37-ca4571ee5ea2")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.12.0")] -[assembly: AssemblyFileVersion("0.0.12.0")]