-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathAssemblyInfo.tt
More file actions
34 lines (33 loc) · 1.45 KB
/
AssemblyInfo.tt
File metadata and controls
34 lines (33 loc) · 1.45 KB
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
<#@ 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(Environment.CurrentDirectory + Path.DirectorySeparatorChar + "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);
build++;
}
#>
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("39E66F87-E17F-4311-A477-C5F47F7F7B1F")]
[assembly: AssemblyTitle("PingLogger")]
[assembly: AssemblyDescription("Advanced multi-threaded ping logging application")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")]
[assembly: AssemblyFileVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.0")]
<#+
int major = 1;
int minor = 0;
int revision = 0;
int build = 0;
#>