-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignatureBuilder.AssemblyInfo.tt
49 lines (43 loc) · 1.76 KB
/
SignatureBuilder.AssemblyInfo.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#
string output = File.ReadAllText(this.Host.ResolvePath("SignatureBuilder.AssemblyInfo.cs"));
Regex pattern = new Regex("AssemblyVersion\\(\"(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<revision>\\d+)\\.(?<build>\\d+)\"\\)");
MatchCollection matches = pattern.Matches(output);
if( matches.Count == 1 )
{
major = Convert.ToInt32(matches[0].Groups["major"].Value);
minor = Convert.ToInt32(matches[0].Groups["minor"].Value);
revision = Convert.ToInt32(matches[0].Groups["revision"].Value);
build = Convert.ToInt32(matches[0].Groups["build"].Value) + 1;
dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
if( this.Host.ResolveParameterValue("-","-","BuildConfiguration") == "Release" )
{
major++;
}
}
#>
using System.Reflection;
using System.Resources;
// General Information
[assembly: AssemblyTitle("SignatureBuilder")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SignatureBuilder")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information
[assembly: AssemblyVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")]
[assembly: AssemblyFileVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")]
[assembly: AssemblyDescription("<#= this.dt #>")]
[assembly: NeutralResourcesLanguage( "en-US" )]
<#+
int major = 10;
int minor = 0;
int revision = 5;
int build = 1302;
String dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
#>