Skip to content

Commit 3f23d1d

Browse files
committed
New versioning system.
1 parent a7d7864 commit 3f23d1d

4 files changed

Lines changed: 33 additions & 28 deletions

File tree

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
84
[assembly: AssemblyTitle("Concealment")]
95
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
116
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("Concealment")]
13-
[assembly: AssemblyCopyright("Copyright © 2017")]
7+
[assembly: AssemblyProduct("Torch")]
8+
[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
149
[assembly: AssemblyTrademark("")]
1510
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2011
[assembly: ComVisible(false)]
2112

22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("e5c0184b-7dc4-43d8-872e-2f71162748aa")]
24-
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("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
13+
#if DEBUG
14+
[assembly: AssemblyConfiguration("Debug")]
15+
#else
16+
[assembly: AssemblyConfiguration("Release")]
17+
#endif

‎Jenkinsfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def test_with_torch(branch)
99
}
1010

1111
stage('Build + Torch ' + branch) {
12-
bat "\"${tool 'MSBuild'}msbuild\" Concealment.sln /p:Configuration=Release /p:Platform=x64 /t:Clean"
13-
// bat "\"${tool 'MSBuild'}msbuild\" Concealment.sln /p:Configuration=Release /p:Platform=x64 /t:TransformOnBuild"
12+
currentBuild.description = bat(returnStdout: true, script: '@powershell -File Versioning/version.ps1').trim()
13+
bat "\"${tool 'MSBuild'}msbuild\" Essentials.sln /p:Configuration=Release /p:Platform=x64 /t:Clean"
1414
bat "\"${tool 'MSBuild'}msbuild\" Concealment.sln /p:Configuration=Release /p:Platform=x64"
1515
}
1616

‎Versioning/AssemblyVersion.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using System.Reflection;
2+
3+
[assembly: AssemblyVersion("0.0.0.0")]
4+
[assembly: AssemblyInformationalVersion("v0.0.0-dev")]

‎Versioning/version.ps1‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
$gitVersion = git describe --tags
2+
$gitSimpleVersion = git describe --tags --abbrev=0
3+
if ($gitSimpleVersion.Equals($gitVersion)) {
4+
$buildSalt = 0
5+
} else {
6+
$gitLatestCommit = git rev-parse --short HEAD
7+
$buildSalt = [System.Numerics.BigInteger]::Abs([System.Numerics.BigInteger]::Parse($gitLatestCommit, [System.Globalization.NumberStyles]::HexNumber) % 16383) + 1
8+
}
9+
$dotNetVersion = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value+".$buildSalt"}
10+
11+
$fileContent = @"
12+
using System.Reflection;
13+
14+
[assembly: AssemblyVersion("$dotNetVersion")]
15+
[assembly: AssemblyInformationalVersion("$gitVersion")]
16+
"@
17+
18+
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
19+
20+
echo "$gitVersion / $dotNetVersion"

0 commit comments

Comments
 (0)