Skip to content

Commit 5cdeea9

Browse files
authored
Merge pull request #10 from TorchAPI/jenkins
Continuous Integration Support
2 parents d2da824 + 8399387 commit 5cdeea9

7 files changed

Lines changed: 192 additions & 26 deletions

File tree

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,8 @@ paket-files/
250250
# JetBrains Rider
251251
.idea/
252252
*.sln.iml
253+
254+
255+
# Binaries
256+
TorchBinaries
257+
GameBinaries

‎Essentials.sln‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.8
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials", "Essentials\Essentials.csproj", "{A4C5FC37-5848-4A75-8CDC-4A1ADB2E01A2}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{A4C5FC37-5848-4A75-8CDC-4A1ADB2E01A2}.Debug|x64.ActiveCfg = Debug|x64
15+
{A4C5FC37-5848-4A75-8CDC-4A1ADB2E01A2}.Debug|x64.Build.0 = Debug|x64
16+
{A4C5FC37-5848-4A75-8CDC-4A1ADB2E01A2}.Release|x64.ActiveCfg = Release|x64
17+
{A4C5FC37-5848-4A75-8CDC-4A1ADB2E01A2}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {F5A14432-44BA-480B-8B20-1AC78BEF79BC}
24+
EndGlobalSection
25+
EndGlobal

‎Essentials/Essentials.csproj‎

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
</PropertyGroup>
1313
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
1414
<DebugSymbols>true</DebugSymbols>
15-
<OutputPath>bin\x64\Debug\</OutputPath>
15+
<OutputPath>$(SolutionDir)\bin\x64\Debug\</OutputPath>
1616
<DefineConstants>DEBUG;TRACE</DefineConstants>
1717
<DebugType>full</DebugType>
1818
<PlatformTarget>x64</PlatformTarget>
1919
<ErrorReport>prompt</ErrorReport>
2020
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
2121
</PropertyGroup>
2222
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
23-
<OutputPath>bin\x64\Release\</OutputPath>
23+
<OutputPath>$(SolutionDir)\bin\x64\Release\</OutputPath>
2424
<DefineConstants>TRACE</DefineConstants>
2525
<Optimize>true</Optimize>
2626
<DebugType>pdbonly</DebugType>
@@ -30,27 +30,34 @@
3030
</PropertyGroup>
3131
<ItemGroup>
3232
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
33-
<HintPath>packages\NLog.4.4.11\lib\net45\NLog.dll</HintPath>
33+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
34+
<Private>False</Private>
3435
</Reference>
3536
<Reference Include="PresentationCore" />
3637
<Reference Include="PresentationFramework" />
3738
<Reference Include="Sandbox.Common">
38-
<HintPath>..\..\Torch\GameBinaries\Sandbox.Common.dll</HintPath>
39+
<HintPath>$(SolutionDir)\GameBinaries\Sandbox.Common.dll</HintPath>
40+
<Private>False</Private>
3941
</Reference>
4042
<Reference Include="Sandbox.Game">
41-
<HintPath>..\..\Torch\GameBinaries\Sandbox.Game.dll</HintPath>
43+
<HintPath>$(SolutionDir)\GameBinaries\Sandbox.Game.dll</HintPath>
44+
<Private>False</Private>
4245
</Reference>
4346
<Reference Include="Sandbox.Graphics">
44-
<HintPath>..\..\Torch\GameBinaries\Sandbox.Graphics.dll</HintPath>
47+
<HintPath>$(SolutionDir)\GameBinaries\Sandbox.Graphics.dll</HintPath>
48+
<Private>False</Private>
4549
</Reference>
4650
<Reference Include="SpaceEngineers.Game">
47-
<HintPath>..\..\Torch\GameBinaries\SpaceEngineers.Game.dll</HintPath>
51+
<HintPath>$(SolutionDir)\GameBinaries\SpaceEngineers.Game.dll</HintPath>
52+
<Private>False</Private>
4853
</Reference>
4954
<Reference Include="SpaceEngineers.ObjectBuilders">
50-
<HintPath>..\..\Torch\GameBinaries\SpaceEngineers.ObjectBuilders.dll</HintPath>
55+
<HintPath>$(SolutionDir)\GameBinaries\SpaceEngineers.ObjectBuilders.dll</HintPath>
56+
<Private>False</Private>
5157
</Reference>
5258
<Reference Include="SpaceEngineers.ObjectBuilders.XmlSerializers">
53-
<HintPath>..\..\Torch\GameBinaries\SpaceEngineers.ObjectBuilders.XmlSerializers.dll</HintPath>
59+
<HintPath>$(SolutionDir)\GameBinaries\SpaceEngineers.ObjectBuilders.XmlSerializers.dll</HintPath>
60+
<Private>False</Private>
5461
</Reference>
5562
<Reference Include="System" />
5663
<Reference Include="System.Core" />
@@ -63,52 +70,68 @@
6370
<Reference Include="System.Net.Http" />
6471
<Reference Include="System.Xml" />
6572
<Reference Include="Torch">
66-
<HintPath>..\..\Torch\bin\x64\Release\Torch.dll</HintPath>
73+
<HintPath>$(SolutionDir)\TorchBinaries\Torch.dll</HintPath>
74+
<Private>False</Private>
6775
</Reference>
6876
<Reference Include="Torch.API">
69-
<HintPath>..\..\Torch\bin\x64\Release\Torch.API.dll</HintPath>
77+
<HintPath>$(SolutionDir)\TorchBinaries\Torch.API.dll</HintPath>
78+
<Private>False</Private>
7079
</Reference>
7180
<Reference Include="Torch.Server">
72-
<HintPath>..\..\Torch\bin\x64\Release\Torch.Server.exe</HintPath>
81+
<HintPath>$(SolutionDir)\TorchBinaries\Torch.Server.exe</HintPath>
82+
<Private>False</Private>
7383
</Reference>
7484
<Reference Include="VRage">
75-
<HintPath>..\..\Torch\GameBinaries\VRage.dll</HintPath>
85+
<HintPath>$(SolutionDir)\GameBinaries\VRage.dll</HintPath>
86+
<Private>False</Private>
7687
</Reference>
7788
<Reference Include="VRage.Audio">
78-
<HintPath>..\..\Torch\GameBinaries\VRage.Audio.dll</HintPath>
89+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Audio.dll</HintPath>
90+
<Private>False</Private>
7991
</Reference>
8092
<Reference Include="VRage.Dedicated">
81-
<HintPath>..\..\Torch\GameBinaries\VRage.Dedicated.dll</HintPath>
93+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Dedicated.dll</HintPath>
94+
<Private>False</Private>
8295
</Reference>
8396
<Reference Include="VRage.Game">
84-
<HintPath>..\..\Torch\GameBinaries\VRage.Game.dll</HintPath>
97+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Game.dll</HintPath>
98+
<Private>False</Private>
8599
</Reference>
86100
<Reference Include="VRage.Game.XmlSerializers">
87-
<HintPath>..\..\Torch\GameBinaries\VRage.Game.XmlSerializers.dll</HintPath>
101+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Game.XmlSerializers.dll</HintPath>
102+
<Private>False</Private>
88103
</Reference>
89104
<Reference Include="VRage.Input">
90-
<HintPath>..\..\Torch\GameBinaries\VRage.Input.dll</HintPath>
105+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Input.dll</HintPath>
106+
<Private>False</Private>
91107
</Reference>
92108
<Reference Include="VRage.Library">
93-
<HintPath>..\..\Torch\GameBinaries\VRage.Library.dll</HintPath>
109+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Library.dll</HintPath>
110+
<Private>False</Private>
94111
</Reference>
95112
<Reference Include="VRage.Math">
96-
<HintPath>..\..\Torch\GameBinaries\VRage.Math.dll</HintPath>
113+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Math.dll</HintPath>
114+
<Private>False</Private>
97115
</Reference>
98116
<Reference Include="VRage.Native">
99-
<HintPath>..\..\Torch\GameBinaries\VRage.Native.dll</HintPath>
117+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Native.dll</HintPath>
118+
<Private>False</Private>
100119
</Reference>
101120
<Reference Include="VRage.OpenVRWrapper">
102-
<HintPath>..\..\Torch\GameBinaries\VRage.OpenVRWrapper.dll</HintPath>
121+
<HintPath>$(SolutionDir)\GameBinaries\VRage.OpenVRWrapper.dll</HintPath>
122+
<Private>False</Private>
103123
</Reference>
104124
<Reference Include="VRage.Render">
105-
<HintPath>..\..\Torch\GameBinaries\VRage.Render.dll</HintPath>
125+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Render.dll</HintPath>
126+
<Private>False</Private>
106127
</Reference>
107128
<Reference Include="VRage.Render11">
108-
<HintPath>..\..\Torch\GameBinaries\VRage.Render11.dll</HintPath>
129+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Render11.dll</HintPath>
130+
<Private>False</Private>
109131
</Reference>
110132
<Reference Include="VRage.Scripting">
111-
<HintPath>..\..\Torch\GameBinaries\VRage.Scripting.dll</HintPath>
133+
<HintPath>$(SolutionDir)\GameBinaries\VRage.Scripting.dll</HintPath>
134+
<Private>False</Private>
112135
</Reference>
113136
<Reference Include="WindowsBase" />
114137
</ItemGroup>

‎Essentials/packages.config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NLog" version="4.4.11" targetFramework="net461" />
3+
<package id="NLog" version="4.4.12" targetFramework="net461" />
44
</packages>

‎Jenkins/jenkins-grab-se.ps1‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pushd
2+
3+
$steamData = "C:/Steam/Data/"
4+
$steamCMDPath = "C:/Steam/steamcmd/"
5+
$steamCMDZip = "C:/Steam/steamcmd.zip"
6+
7+
Add-Type -AssemblyName System.IO.Compression.FileSystem
8+
9+
if (!(Test-Path $steamData)) {
10+
mkdir "$steamData"
11+
}
12+
if (!(Test-Path $steamCMDPath)) {
13+
if (!(Test-Path $steamCMDZip)) {
14+
(New-Object System.Net.WebClient).DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip", "$steamCMDZip");
15+
}
16+
[System.IO.Compression.ZipFile]::ExtractToDirectory($steamCMDZip, $steamCMDPath)
17+
}
18+
19+
cd "$steamData"
20+
& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740" "+quit"
21+
22+
popd

‎Jenkinsfile‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
def test_with_torch(branch)
2+
{
3+
try {
4+
stage('Acquire Torch ' + branch) {
5+
bat 'IF EXIST TorchBinaries RMDIR /S /Q TorchBinaries'
6+
bat 'mkdir TorchBinaries'
7+
step([$class: 'CopyArtifact', projectName: "Torch/Torch/${branch}", filter: "**/Torch*.dll", flatten: true, fingerprintArtifacts: true, target: "TorchBinaries"])
8+
step([$class: 'CopyArtifact', projectName: "Torch/Torch/${branch}", filter: "**/Torch*.exe", flatten: true, fingerprintArtifacts: true, target: "TorchBinaries"])
9+
}
10+
11+
stage('Build + Torch ' + branch) {
12+
bat "\"${tool 'MSBuild'}msbuild\" Essentials.sln /p:Configuration=Release /p:Platform=x64 /t:Clean"
13+
// bat "\"${tool 'MSBuild'}msbuild\" Essentials.sln /p:Configuration=Release /p:Platform=x64 /t:TransformOnBuild"
14+
bat "\"${tool 'MSBuild'}msbuild\" Essentials.sln /p:Configuration=Release /p:Platform=x64"
15+
}
16+
17+
/*
18+
stage('Test + Torch ' + branch) {
19+
bat 'IF NOT EXIST reports MKDIR reports'
20+
bat "\"packages/xunit.runner.console.2.2.0/tools/xunit.console.exe\" \"bin-test/x64/Release/Essentials.Tests.dll\" -parallel none -xml \"reports/Essentials.Tests.xml\""
21+
step([
22+
$class: 'XUnitBuilder',
23+
thresholdMode: 1,
24+
thresholds: [[$class: 'FailedThreshold', failureThreshold: '1']],
25+
tools: [[
26+
$class: 'XUnitDotNetTestType',
27+
deleteOutputFiles: true,
28+
failIfNotNew: true,
29+
pattern: 'reports/*.xml',
30+
skipNoTestFiles: false,
31+
stopProcessingIfError: true
32+
]]
33+
])
34+
}
35+
*/
36+
return true
37+
} catch (e) {
38+
return false
39+
}
40+
}
41+
42+
node {
43+
stage('Checkout') {
44+
checkout scm
45+
}
46+
47+
stage('Acquire SE') {
48+
bat 'powershell -File Jenkins/jenkins-grab-se.ps1'
49+
bat 'IF EXIST GameBinaries RMDIR GameBinaries'
50+
bat 'mklink /J GameBinaries "C:/Steam/Data/DedicatedServer64/"'
51+
}
52+
53+
stage('Acquire NuGet Packages') {
54+
bat 'nuget restore Essentials.sln'
55+
}
56+
57+
resultMaster = test_with_torch("master")
58+
resultStaging = test_with_torch("staging")
59+
if (resultMaster || resultStaging) {
60+
currentBuild.result = "SUCCESS"
61+
stage('Archive') {
62+
archiveArtifacts artifacts: "bin/x64/Release/Essentials.dll", caseSensitive: false, fingerprint: true, onlyIfSuccessful: true
63+
}
64+
}
65+
else
66+
currentBuild.result = "FAIL"
67+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:: This script creates a symlink to the game binaries to account for different installation directories on different systems.
2+
3+
@echo off
4+
set /p path="Please enter the folder location of your SpaceEngineersDedicated.exe: "
5+
cd %~dp0
6+
mklink /J GameBinaries %path%
7+
if errorlevel 1 goto Error
8+
echo Done!
9+
goto End
10+
:Error
11+
echo An error occured creating the symlink.
12+
goto EndFinal
13+
:End
14+
15+
set /p path="Please enter the folder location of your Torch.Server.exe: "
16+
cd %~dp0
17+
mklink /J TorchBinaries %path%
18+
if errorlevel 1 goto Error
19+
echo Done! You can now open the Torch solution without issue.
20+
goto EndFinal
21+
:Error2
22+
echo An error occured creating the symlink.
23+
:EndFinal
24+
pause

0 commit comments

Comments
 (0)