Skip to content

Commit 72b6d0e

Browse files
committed
Tweaks to versioning scheme
Nuke staging
1 parent 039c5d9 commit 72b6d0e

7 files changed

Lines changed: 21 additions & 28 deletions

File tree

‎Jenkinsfile‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,4 @@ node {
7171
]]
7272
])
7373
}
74-
75-
if (env.BRANCH_NAME == "master") {
76-
gitVersion = bat(returnStdout: true, script: "@git describe --tags").trim()
77-
gitSimpleVersion = bat(returnStdout: true, script: "@git describe --tags --abbrev=0").trim()
78-
if (gitVersion == gitSimpleVersion) {
79-
stage('${buildMode}') {
80-
withCredentials([usernamePassword(credentialsId: 'torch-github', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
81-
powershell "& ./Jenkins/${buildMode}.ps1 \"https://api.github.com/repos/TorchAPI/Torch/\" \"$gitSimpleVersion\" \"$USERNAME:$PASSWORD\" @(\"bin/torch-server.zip\", \"bin/torch-client.zip\")"
82-
}
83-
}
84-
}
85-
}
8674
}

‎Torch.Server/TorchServer.cs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public bool IsRunning
103103
private ServerState _state;
104104
private TimeSpan _elapsedPlayTime;
105105
private float _simRatio;
106-
private readonly AutoResetEvent _stopHandle = new AutoResetEvent(false);
107106
private Timer _watchdog;
108107
private Stopwatch _uptime;
109108

@@ -169,8 +168,6 @@ public override void Stop()
169168
Log.Info("Stopping server.");
170169
base.Stop();
171170
Log.Info("Server stopped.");
172-
LogManager.Flush();
173-
_stopHandle.Set();
174171

175172
State = ServerState.Stopped;
176173
IsRunning = false;

‎Torch.Tests/ReflectionTestManager.cs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Reflection;
45
using Torch.Utils;
56

@@ -42,8 +43,15 @@ public ReflectionTestManager()
4243

4344
public ReflectionTestManager Init(Assembly asm)
4445
{
45-
foreach (Type type in asm.GetTypes())
46-
Init(type);
46+
try
47+
{
48+
foreach (Type type in asm.GetTypes())
49+
Init(type);
50+
}
51+
catch (ReflectionTypeLoadException e)
52+
{
53+
throw e.LoaderExceptions[0];
54+
}
4755
return this;
4856
}
4957

‎Torch.Tests/TestUtils.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.IO;
45
using System.Linq;
6+
using System.Reflection;
57
using System.Text;
68
using System.Threading.Tasks;
79
using Torch.Utils;
@@ -32,4 +34,4 @@ private static string GetGameBinaries()
3234

3335
private static TorchAssemblyResolver _torchResolver;
3436
}
35-
}
37+
}

‎Torch/TorchBase.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ public virtual void Start()
394394
/// <inheritdoc />
395395
public virtual void Stop()
396396
{
397+
LogManager.Flush();
397398
_game.SignalStop();
398399
if (!_game.WaitFor(VRageGame.GameState.Stopped, TimeSpan.FromSeconds(15)))
399400
Log.Warn("Failed to wait for the game to be stopped");

‎Torch/VRageGame.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private void DoStart()
223223
StateChange(GameState.Stopped);
224224
}
225225
}
226-
226+
227227
private void LoadSession(string sessionPath)
228228
{
229229
// ?

‎Versioning/version.ps1‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1+
$buildSalt = $Env:BUILD_NUMBER
12
$gitVersion = git describe --tags
23
$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"}
4+
$simpleVersionStandard = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value}
5+
$dotNetVersion = "$simpleVersionStandard.$buildSalt"
6+
$infoVersion = "$gitVersion" -replace "([0-9]+)\.([0-9]+)\.([0-9]+)","$dotNetVersion"
107

118
$fileContent = @"
129
using System.Reflection;
1310
1411
[assembly: AssemblyVersion("$dotNetVersion")]
15-
[assembly: AssemblyInformationalVersion("$gitVersion")]
12+
[assembly: AssemblyInformationalVersion("$infoVersion")]
1613
"@
1714

1815
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
1916

20-
echo "$gitVersion / $dotNetVersion"
17+
echo "$infoVersion"

0 commit comments

Comments
 (0)