Skip to content

Commit b541379

Browse files
committed
Revert "Directory cleanup and re-org (#500)"
This reverts commit 0895d1b.
1 parent 0895d1b commit b541379

62 files changed

Lines changed: 3018 additions & 450 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Jenkinsfile‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@ def packageAndArchive(buildMode, packageName) {
55
bat "IF EXIST ${zipFile} DEL ${zipFile}"
66
bat "IF EXIST ${packageDir} RMDIR /S /Q ${packageDir}"
77

8+
bat "xcopy bin\\x64\\${buildMode} ${packageDir}"
89

9-
bat "del bin\\x64\\${buildMode}\\lib\\Content"
10-
bat "del bin\\x64\\${buildMode}\\lib\\DedicatedServer64"
11-
bat "del bin\\x64\\${buildMode}\\lib\\steamapps"
12-
bat "del bin\\x64\\${buildMode}\\lib\\TempContent"
13-
bat "del bin\\x64\\${buildMode}\\lib\\Content"
14-
15-
16-
bat "xcopy bin\\x64\\${buildMode} ${packageDir} /S"
17-
18-
10+
bat "del ${packageDir}VRage.*"
11+
bat "del ${packageDir}Sandbox.*"
12+
bat "del ${packageDir}SpaceEngineers.*"
1913

2014
powershell "Add-Type -Assembly System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"\$PWD\\${packageDir}\", \"\$PWD\\${zipFile}\")"
2115
archiveArtifacts artifacts: zipFile, caseSensitive: false, onlyIfSuccessful: true
@@ -24,7 +18,7 @@ def packageAndArchive(buildMode, packageName) {
2418
node('windows') {
2519
stage('Checkout') {
2620
checkout scm
27-
//bat "git pull https://github.com/TorchAPI/Torch/ $env.BRANCH_NAME --tags"
21+
bat "git pull https://github.com/TorchAPI/Torch/ $env.BRANCH_NAME --tags"
2822
}
2923

3024
stage('Acquire SE') {
@@ -53,7 +47,7 @@ node('windows') {
5347
}
5448

5549
stage('Archive') {
56-
archiveArtifacts artifacts: "bin/x64/${buildMode}/*", caseSensitive: false, fingerprint: true, onlyIfSuccessful: true
50+
archiveArtifacts artifacts: "bin/x64/${buildMode}/Torch*", caseSensitive: false, fingerprint: true, onlyIfSuccessful: true
5751

5852
packageAndArchive(buildMode, "torch-server")
5953

‎Torch.API/Torch.API.csproj‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
</PropertyGroup>
1717
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
1818
<DebugSymbols>true</DebugSymbols>
19-
<OutputPath>..\bin\x64\Debug\lib\Torch\</OutputPath>
19+
<OutputPath>$(SolutionDir)\bin\x64\Debug\</OutputPath>
2020
<DefineConstants>DEBUG;TRACE</DefineConstants>
2121
<DebugType>full</DebugType>
2222
<PlatformTarget>x64</PlatformTarget>
2323
<ErrorReport>prompt</ErrorReport>
2424
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
2525
</PropertyGroup>
2626
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
27-
<OutputPath>..\bin\x64\Release\lib\Torch\</OutputPath>
27+
<OutputPath>$(SolutionDir)\bin\x64\Release\</OutputPath>
2828
<DefineConstants>TRACE</DefineConstants>
2929
<Optimize>true</Optimize>
3030
<DebugType>pdbonly</DebugType>
3131
<PlatformTarget>x64</PlatformTarget>
3232
<ErrorReport>prompt</ErrorReport>
3333
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
34-
<DocumentationFile>..\bin\x64\Release\lib\Torch\Torch.API.xml</DocumentationFile>
34+
<DocumentationFile>$(SolutionDir)\bin\x64\Release\Torch.API.xml</DocumentationFile>
3535
<NoWarn>1591</NoWarn>
3636
</PropertyGroup>
3737
<ItemGroup>
@@ -44,11 +44,13 @@
4444
<HintPath>..\GameBinaries\HavokWrapper.dll</HintPath>
4545
<Private>False</Private>
4646
</Reference>
47-
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
48-
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
47+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
48+
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
49+
<Private>True</Private>
4950
</Reference>
5051
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
51-
<HintPath>..\packages\NLog.4.7.15\lib\net45\NLog.dll</HintPath>
52+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
53+
<Private>True</Private>
5254
</Reference>
5355
<Reference Include="PresentationCore" />
5456
<Reference Include="PresentationFramework" />

‎Torch.API/WebAPI/JenkinsQuery.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Torch.API.WebAPI
1313
{
1414
public class JenkinsQuery
1515
{
16-
//Revert when ready
1716
private const string BRANCH_QUERY = "http://136.243.80.164:2690/job/Torch/job/{0}/" + API_PATH;
1817
private const string ARTIFACT_PATH = "artifact/bin/torch-server.zip";
1918
private const string API_PATH = "api/json";

‎Torch.API/packages.config‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Mono.TextTransform" version="1.0.0" targetFramework="net461" />
4-
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
5-
<package id="NLog" version="4.7.15" targetFramework="net48" />
4+
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
5+
<package id="NLog" version="4.4.12" targetFramework="net461" />
66
</packages>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
[assembly: AssemblyTitle("Torch Client Tests")]
5+
[assembly: AssemblyDescription("")]
6+
[assembly: AssemblyCompany("")]
7+
[assembly: AssemblyProduct("Torch")]
8+
[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
9+
[assembly: AssemblyTrademark("")]
10+
[assembly: AssemblyCulture("")]
11+
[assembly: ComVisible(false)]
12+
13+
#if DEBUG
14+
[assembly: AssemblyConfiguration("Debug")]
15+
#else
16+
[assembly: AssemblyConfiguration("Release")]
17+
#endif
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<ProjectGuid>{632E78C0-0DAC-4B71-B411-2F1B333CC310}</ProjectGuid>
6+
<OutputType>Library</OutputType>
7+
<AppDesignerFolder>Properties</AppDesignerFolder>
8+
<RootNamespace>Torch.Client.Tests</RootNamespace>
9+
<AssemblyName>Torch.Client.Tests</AssemblyName>
10+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
11+
<FileAlignment>512</FileAlignment>
12+
<TargetFrameworkProfile />
13+
<NuGetPackageImportStamp>
14+
</NuGetPackageImportStamp>
15+
<NoWarn>1591,0649</NoWarn>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
18+
<DebugSymbols>true</DebugSymbols>
19+
<OutputPath>$(SolutionDir)\bin-test\x64\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<DebugType>full</DebugType>
22+
<PlatformTarget>x64</PlatformTarget>
23+
<ErrorReport>prompt</ErrorReport>
24+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
25+
</PropertyGroup>
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
27+
<OutputPath>$(SolutionDir)\bin-test\x64\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<Optimize>true</Optimize>
30+
<DebugType>pdbonly</DebugType>
31+
<PlatformTarget>x64</PlatformTarget>
32+
<ErrorReport>prompt</ErrorReport>
33+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
34+
<DocumentationFile>$(SolutionDir)\bin-test\x64\Release\Torch.Client.Tests.xml</DocumentationFile>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
38+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
39+
<Private>True</Private>
40+
</Reference>
41+
<Reference Include="System" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="Microsoft.CSharp" />
46+
<Reference Include="System.Data" />
47+
<Reference Include="System.Net.Http" />
48+
<Reference Include="System.Xml" />
49+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
50+
<HintPath>..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
51+
</Reference>
52+
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
53+
<HintPath>..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
54+
</Reference>
55+
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
56+
<HintPath>..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
57+
</Reference>
58+
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
59+
<HintPath>..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
60+
</Reference>
61+
</ItemGroup>
62+
<ItemGroup>
63+
<Compile Include="..\Versioning\AssemblyVersion.cs">
64+
<Link>Properties\AssemblyVersion.cs</Link>
65+
</Compile>
66+
<Compile Include="Properties\AssemblyInfo.cs" />
67+
<Compile Include="TorchClientReflectionTest.cs" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<ProjectReference Include="..\Torch.API\Torch.API.csproj">
71+
<Project>{fba5d932-6254-4a1e-baf4-e229fa94e3c2}</Project>
72+
<Name>Torch.API</Name>
73+
</ProjectReference>
74+
<ProjectReference Include="..\Torch.Client\Torch.Client.csproj">
75+
<Project>{e36df745-260b-4956-a2e8-09f08b2e7161}</Project>
76+
<Name>Torch.Client</Name>
77+
</ProjectReference>
78+
<ProjectReference Include="..\Torch.Tests\Torch.Tests.csproj">
79+
<Project>{c3c8b671-6ad1-44aa-a8da-e0c0dc0fedf5}</Project>
80+
<Name>Torch.Tests</Name>
81+
</ProjectReference>
82+
<ProjectReference Include="..\Torch\Torch.csproj">
83+
<Project>{7e01635c-3b67-472e-bcd6-c5539564f214}</Project>
84+
<Name>Torch</Name>
85+
<Private>True</Private>
86+
</ProjectReference>
87+
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="app.config" />
90+
<None Include="packages.config" />
91+
</ItemGroup>
92+
<ItemGroup>
93+
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
94+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
95+
</ItemGroup>
96+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
97+
<Import Project="$(SolutionDir)\TransformOnBuild.targets" />
98+
</Project>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Torch.Client;
4+
using Torch.Tests;
5+
using Torch.Utils;
6+
using Xunit;
7+
8+
namespace Torch.Client.Tests
9+
{
10+
public class TorchClientReflectionTest
11+
{
12+
static TorchClientReflectionTest()
13+
{
14+
TestUtils.Init();
15+
}
16+
17+
private static ReflectionTestManager _manager;
18+
19+
private static ReflectionTestManager Manager()
20+
{
21+
if (_manager != null)
22+
return _manager;
23+
24+
return _manager = new ReflectionTestManager().Init(typeof(TorchClient).Assembly);
25+
}
26+
27+
public static IEnumerable<object[]> Getters => Manager().Getters;
28+
29+
public static IEnumerable<object[]> Setters => Manager().Setters;
30+
31+
public static IEnumerable<object[]> Invokers => Manager().Invokers;
32+
33+
public static IEnumerable<object[]> MemberInfo => Manager().MemberInfo;
34+
35+
public static IEnumerable<object[]> Events => Manager().Events;
36+
37+
#region Binding
38+
[Theory]
39+
[MemberData(nameof(Getters))]
40+
public void TestBindingGetter(ReflectionTestManager.FieldRef field)
41+
{
42+
if (field.Field == null)
43+
return;
44+
Assert.True(ReflectedManager.Process(field.Field));
45+
if (field.Field.IsStatic)
46+
Assert.NotNull(field.Field.GetValue(null));
47+
}
48+
49+
[Theory]
50+
[MemberData(nameof(Setters))]
51+
public void TestBindingSetter(ReflectionTestManager.FieldRef field)
52+
{
53+
if (field.Field == null)
54+
return;
55+
Assert.True(ReflectedManager.Process(field.Field));
56+
if (field.Field.IsStatic)
57+
Assert.NotNull(field.Field.GetValue(null));
58+
}
59+
60+
[Theory]
61+
[MemberData(nameof(Invokers))]
62+
public void TestBindingInvoker(ReflectionTestManager.FieldRef field)
63+
{
64+
if (field.Field == null)
65+
return;
66+
Assert.True(ReflectedManager.Process(field.Field));
67+
if (field.Field.IsStatic)
68+
Assert.NotNull(field.Field.GetValue(null));
69+
}
70+
71+
[Theory]
72+
[MemberData(nameof(MemberInfo))]
73+
public void TestBindingMemberInfo(ReflectionTestManager.FieldRef field)
74+
{
75+
if (field.Field == null)
76+
return;
77+
Assert.True(ReflectedManager.Process(field.Field));
78+
if (field.Field.IsStatic)
79+
Assert.NotNull(field.Field.GetValue(null));
80+
}
81+
82+
[Theory]
83+
[MemberData(nameof(Events))]
84+
public void TestBindingEvents(ReflectionTestManager.FieldRef field)
85+
{
86+
if (field.Field == null)
87+
return;
88+
Assert.True(ReflectedManager.Process(field.Field));
89+
if (field.Field.IsStatic)
90+
((Func<ReflectedEventReplacer>)field.Field.GetValue(null)).Invoke();
91+
}
92+
#endregion
93+
}
94+
}

‎Torch.Client.Tests/app.config‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

‎Torch.Client.Tests/packages.config‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Mono.TextTransform" version="1.0.0" targetFramework="net461" />
4+
<package id="NLog" version="4.4.12" targetFramework="net461" />
5+
<package id="xunit" version="2.2.0" targetFramework="net461" />
6+
<package id="xunit.abstractions" version="2.0.1" targetFramework="net461" />
7+
<package id="xunit.assert" version="2.2.0" targetFramework="net461" />
8+
<package id="xunit.core" version="2.2.0" targetFramework="net461" />
9+
<package id="xunit.extensibility.core" version="2.2.0" targetFramework="net461" />
10+
<package id="xunit.extensibility.execution" version="2.2.0" targetFramework="net461" />
11+
<package id="xunit.runner.console" version="2.2.0" targetFramework="net461" developmentDependency="true" />
12+
</packages>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Sandbox.Engine.Multiplayer;
7+
using Torch.API;
8+
using Torch.API.Managers;
9+
using Torch.Managers;
10+
11+
namespace Torch.Client.Manager
12+
{
13+
public class MultiplayerManagerClient : MultiplayerManagerBase, IMultiplayerManagerClient
14+
{
15+
/// <inheritdoc />
16+
public MultiplayerManagerClient(ITorchBase torch) : base(torch) { }
17+
18+
/// <inheritdoc />
19+
public override void Attach()
20+
{
21+
base.Attach();
22+
MyMultiplayer.Static.ClientJoined += RaiseClientJoined;
23+
}
24+
25+
/// <inheritdoc />
26+
public override void Detach()
27+
{
28+
MyMultiplayer.Static.ClientJoined -= RaiseClientJoined;
29+
base.Detach();
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)