Skip to content

Commit 844d52f

Browse files
committed
Prep for 0.1.0-beta release
1 parent d0b0418 commit 844d52f

File tree

4 files changed

+53
-31
lines changed

4 files changed

+53
-31
lines changed

Code/TSqlFlex.Core.Tests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
1212
[assembly: AssemblyProduct("TSqlFlex.Core.Tests")]
13-
[assembly: AssemblyCopyright("Copyright © 2014")]
13+
[assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
using System.Reflection;
1+
using System;
2+
using System.Reflection;
23
using System.Runtime.CompilerServices;
34
using System.Runtime.InteropServices;
45

56
// General Information about an assembly is controlled through the following
67
// set of attributes. Change these attribute values to modify the information
78
// associated with an assembly.
89
[assembly: AssemblyTitle("TSqlFlex.Core")]
9-
[assembly: AssemblyDescription("Scripts data to INSERT statements or Excel-compatible spreadsheets.")]
10+
[assembly: AssemblyDescription("Scripts SQL Server data.")]
1011
[assembly: AssemblyConfiguration("")]
1112
[assembly: AssemblyCompany("")]
1213
[assembly: AssemblyProduct("TSqlFlex.Core")]
13-
[assembly: AssemblyCopyright("Copyright © 2014 Steve Ognibene")]
14+
[assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")]
1415
[assembly: AssemblyTrademark("")]
1516
[assembly: AssemblyCulture("")]
17+
[assembly: AssemblyVersion("0.1.0.0")]
18+
[assembly: AssemblyFileVersion("0.1.0.0")]
19+
[assembly: AssemblySemverPrereleaseTag("beta")]
1620

1721
// Setting ComVisible to false makes the types in this assembly not visible
1822
// to COM components. If you need to access a type in this assembly from
@@ -22,18 +26,16 @@
2226
// The following GUID is for the ID of the typelib if this project is exposed to COM
2327
[assembly: Guid("f28ef710-39c6-4254-a0db-e930d24f2372")]
2428

25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.11.0")]
36-
[assembly: AssemblyFileVersion("0.0.11.0")]
37-
3829
//Enable testing internal members of classes.
3930
[assembly: InternalsVisibleTo("TSqlFlex.Core.Tests")]
31+
32+
[AttributeUsage(AttributeTargets.Assembly)]
33+
public class AssemblySemverPrereleaseTag : Attribute
34+
{
35+
public readonly string tag;
36+
public AssemblySemverPrereleaseTag() : this(string.Empty) { }
37+
public AssemblySemverPrereleaseTag(string value)
38+
{
39+
tag = value;
40+
}
41+
}

Code/TSqlFlex.Core/Utils.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,16 @@ public static class Info
8282
{
8383
public static string Version() {
8484

85-
return "v" + VersionNumbersOnly() + "-alpha";
85+
string tag = SemverPrereleaseTag();
86+
if (string.IsNullOrEmpty(tag))
87+
{
88+
return "v" + VersionNumbersOnly();
89+
}
90+
else
91+
{
92+
return "v" + VersionNumbersOnly() + "-" + tag;
93+
}
94+
8695
}
8796

8897
public static string VersionNumbersOnly()
@@ -91,6 +100,25 @@ public static string VersionNumbersOnly()
91100
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
92101
return fvi.FileVersion;
93102
}
103+
104+
public static string SemverPrereleaseTag()
105+
{
106+
Assembly assembly = Assembly.GetExecutingAssembly();
107+
108+
var attributes = assembly
109+
.GetCustomAttributes(typeof(AssemblySemverPrereleaseTag), false)
110+
.Cast<AssemblySemverPrereleaseTag>().ToArray();
111+
112+
if (attributes.Length == 0)
113+
{
114+
return "";
115+
}
116+
else
117+
{
118+
return attributes[0].tag;
119+
}
120+
121+
}
94122
}
95123

96124
}
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Reflection;
1+
using System;
2+
using System.Reflection;
23
using System.Runtime.CompilerServices;
34
using System.Runtime.InteropServices;
45

@@ -13,6 +14,9 @@
1314
[assembly: AssemblyCopyright("Copyright © 2015 Steve Ognibene")]
1415
[assembly: AssemblyTrademark("")]
1516
[assembly: AssemblyCulture("")]
17+
[assembly: AssemblyVersion("0.1.0.0")]
18+
[assembly: AssemblyFileVersion("0.1.0.0")]
19+
[assembly: AssemblySemverPrereleaseTag("beta")]
1620

1721
// Setting ComVisible to false makes the types in this assembly not visible
1822
// to COM components. If you need to access a type in this assembly from
@@ -22,15 +26,3 @@
2226
// The following GUID is for the ID of the typelib if this project is exposed to COM
2327
[assembly: Guid("aafe5ee1-f39f-4eee-9f37-ca4571ee5ea2")]
2428

25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.12.0")]
36-
[assembly: AssemblyFileVersion("0.0.12.0")]

0 commit comments

Comments
 (0)