Skip to content

Commit 140461c

Browse files
committed
Update to tomlyn 0.19 & csharpier 1.1.2
1 parent 3be34e9 commit 140461c

File tree

6 files changed

+87
-68
lines changed

6 files changed

+87
-68
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"isRoot": true,
44
"tools": {
55
"csharpier": {
6-
"version": "0.30.6",
6+
"version": "1.1.2",
77
"commands": [
8-
"dotnet-csharpier"
8+
"csharpier"
99
]
1010
}
1111
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Further deployment steps for automatic updates are still in progress.
3737

3838
### Formatting
3939

40-
This project uses the CSharpier formatter. You can run it with `dotnet csharpier .`
40+
This project uses the CSharpier formatter. You can run it with `dotnet csharpier format .`
4141

4242
### Flatbuffers
4343

RLBotCS/ManagerTools/ConfigParser.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@ private uint GetTeam(TomlTable table, List<string> missingValues)
270270
switch (raw)
271271
{
272272
// Toml numbers are longs by default
273-
case long i
274-
and >= 0
275-
and <= 1:
273+
case long i and >= 0 and <= 1:
276274
return (uint)i;
277275
case string s when s.Equals("blue", StringComparison.OrdinalIgnoreCase):
278276
return 0;

RLBotCS/RLBotCS.csproj

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<OutputType>Exe</OutputType>
54
<TargetFramework>net8.0</TargetFramework>
@@ -14,70 +13,86 @@
1413
<PublishWmiLightStaticallyLinked>true</PublishWmiLightStaticallyLinked>
1514
<SelfContained>true</SelfContained>
1615
<StaticExecutable>true</StaticExecutable>
17-
<LinkerFlavor Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">lld</LinkerFlavor>
16+
<LinkerFlavor
17+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
18+
>lld</LinkerFlavor
19+
>
1820
<InvariantGlobalization>true</InvariantGlobalization>
1921
</PropertyGroup>
20-
2122
<ItemGroup>
22-
<PackageReference Include="Tomlyn" Version="0.18.0" />
23+
<PackageReference Include="Tomlyn" Version="0.19.0" />
2324
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
2425
</ItemGroup>
25-
2626
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
2727
<DefineConstants>WINDOWS</DefineConstants>
2828
</PropertyGroup>
29-
3029
<ItemGroup>
3130
<PackageReference Include="Google.FlatBuffers" Version="25.2.10" />
3231
</ItemGroup>
3332
<ItemGroup>
3433
<Folder Include="FlatBuffer\" />
3534
</ItemGroup>
36-
3735
<ItemGroup>
3836
<DirectPInvoke Include="rl_ball_sym" />
39-
4037
<!-- Statically linked for publishing -->
41-
<NativeLibrary Include=".\lib\rl_ball_sym\win-x86_64\rl_ball_sym.lib" Condition="'$(OS)' == 'Windows_NT'" />
42-
<NativeLibrary Include="./lib/rl_ball_sym/linux-x86_64/librl_ball_sym.a" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'" />
43-
<NativeLibrary Include="./lib/rl_ball_sym/mac-aarch64/librl_ball_sym.a" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'" />
44-
38+
<NativeLibrary
39+
Include=".\lib\rl_ball_sym\win-x86_64\rl_ball_sym.lib"
40+
Condition="'$(OS)' == 'Windows_NT'"
41+
/>
42+
<NativeLibrary
43+
Include="./lib/rl_ball_sym/linux-x86_64/librl_ball_sym.a"
44+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
45+
/>
46+
<NativeLibrary
47+
Include="./lib/rl_ball_sym/mac-aarch64/librl_ball_sym.a"
48+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'"
49+
/>
4550
<!-- Dynamically linked for development -->
46-
<ContentWithTargetPath Include=".\lib\rl_ball_sym\win-x86_64\rl_ball_sym.dll" Condition="'$(OS)' == 'Windows_NT'">
51+
<ContentWithTargetPath
52+
Include=".\lib\rl_ball_sym\win-x86_64\rl_ball_sym.dll"
53+
Condition="'$(OS)' == 'Windows_NT'"
54+
>
4755
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
4856
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4957
<TargetPath>rl_ball_sym.dll</TargetPath>
5058
</ContentWithTargetPath>
51-
52-
<ContentWithTargetPath Include="./lib/rl_ball_sym/linux-x86_64/librl_ball_sym.so" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
59+
<ContentWithTargetPath
60+
Include="./lib/rl_ball_sym/linux-x86_64/librl_ball_sym.so"
61+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
62+
>
5363
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
5464
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5565
<TargetPath>rl_ball_sym.so</TargetPath>
5666
</ContentWithTargetPath>
57-
58-
<ContentWithTargetPath Include="./lib/rl_ball_sym/mac-aarch64/librl_ball_sym.dylib" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'">
59-
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
60-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
61-
<TargetPath>rl_ball_sym.dylib</TargetPath>
67+
<ContentWithTargetPath
68+
Include="./lib/rl_ball_sym/mac-aarch64/librl_ball_sym.dylib"
69+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'"
70+
>
71+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
72+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
73+
<TargetPath>rl_ball_sym.dylib</TargetPath>
6274
</ContentWithTargetPath>
6375
</ItemGroup>
64-
65-
<Target Name="GenerateFlatBuffersWindows" BeforeTargets="PreBuildEvent" Condition=" '$(OS)' == 'Windows_NT' ">
76+
<Target
77+
Name="GenerateFlatBuffersWindows"
78+
BeforeTargets="PreBuildEvent"
79+
Condition=" '$(OS)' == 'Windows_NT' "
80+
>
6681
<Exec Command="call ../generate-flatbuffers.bat" />
6782
</Target>
68-
69-
<Target Name="GenerateFlatBuffersLinux" BeforeTargets="PreBuildEvent" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
83+
<Target
84+
Name="GenerateFlatBuffersLinux"
85+
BeforeTargets="PreBuildEvent"
86+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
87+
>
7088
<Exec Command="../generate-flatbuffers.sh" />
7189
</Target>
72-
7390
<ItemGroup>
7491
<Compile Include="..\FlatBuffer\RLBot.cs" />
7592
</ItemGroup>
76-
7793
<ItemGroup>
7894
<Reference Include="Bridge">
7995
<HintPath>lib\Bridge.dll</HintPath>
8096
</Reference>
8197
</ItemGroup>
82-
8398
</Project>

RLBotCSTests/ConfigParserTest.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,44 +197,44 @@ public void ConfigNotFound()
197197
ConfigParser parser = new ConfigParser();
198198
AssertThrowsInnerException<ArgumentNullException>(() => parser.LoadMatchConfig(null!));
199199

200-
AssertThrowsInnerException<FileNotFoundException>(
201-
() => parser.LoadMatchConfig("TestTomls/non-existent.toml")
200+
AssertThrowsInnerException<FileNotFoundException>(() =>
201+
parser.LoadMatchConfig("TestTomls/non-existent.toml")
202202
);
203203

204204
// Match toml exists, but refers to bot that does not exist
205205
Assert.IsTrue(Path.Exists("TestTomls/non-existent_bot.toml"));
206-
AssertThrowsInnerException<FileNotFoundException>(
207-
() => parser.LoadMatchConfig("TestTomls/non-existent_bot.toml")
206+
AssertThrowsInnerException<FileNotFoundException>(() =>
207+
parser.LoadMatchConfig("TestTomls/non-existent_bot.toml")
208208
);
209209

210210
// Match toml exists, but refers to script that does not exist
211211
Assert.IsTrue(Path.Exists("TestTomls/non-existent_script.toml"));
212-
AssertThrowsInnerException<FileNotFoundException>(
213-
() => parser.LoadMatchConfig("TestTomls/non-existent_script.toml")
212+
AssertThrowsInnerException<FileNotFoundException>(() =>
213+
parser.LoadMatchConfig("TestTomls/non-existent_script.toml")
214214
);
215215
}
216216

217217
[TestMethod]
218218
public void InvalidTomlConfig()
219219
{
220220
ConfigParser parser = new();
221-
AssertThrowsInnerException<Tomlyn.TomlException>(
222-
() => parser.LoadMatchConfig("TestTomls/not_a_toml.json")
221+
AssertThrowsInnerException<Tomlyn.TomlException>(() =>
222+
parser.LoadMatchConfig("TestTomls/not_a_toml.json")
223223
);
224224
}
225225

226226
[TestMethod]
227227
public void BadValues()
228228
{
229229
ConfigParser parser = new();
230-
AssertThrowsInnerException<InvalidCastException>(
231-
() => parser.LoadMatchConfig("TestTomls/bad_boolean.toml")
230+
AssertThrowsInnerException<InvalidCastException>(() =>
231+
parser.LoadMatchConfig("TestTomls/bad_boolean.toml")
232232
);
233-
AssertThrowsInnerException<InvalidCastException>(
234-
() => parser.LoadMatchConfig("TestTomls/bad_enum.toml")
233+
AssertThrowsInnerException<InvalidCastException>(() =>
234+
parser.LoadMatchConfig("TestTomls/bad_enum.toml")
235235
);
236-
AssertThrowsInnerException<InvalidCastException>(
237-
() => parser.LoadMatchConfig("TestTomls/bad_team.toml")
236+
AssertThrowsInnerException<InvalidCastException>(() =>
237+
parser.LoadMatchConfig("TestTomls/bad_team.toml")
238238
);
239239
}
240240
}

RLBotCSTests/RLBotCSTests.csproj

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,67 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<TargetFramework>net8.0</TargetFramework>
54
<Nullable>enable</Nullable>
6-
75
<IsPackable>false</IsPackable>
86
</PropertyGroup>
9-
107
<ItemGroup>
118
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
129
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
1310
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
1411
<PackageReference Include="coverlet.collector" Version="3.1.0" />
1512
</ItemGroup>
16-
1713
<ItemGroup>
1814
<ProjectReference Include="..\RLBotCS\RLBotCS.csproj" />
1915
</ItemGroup>
20-
2116
<ItemGroup>
2217
<Reference Include="Bridge">
2318
<HintPath>..\RLBotCS\lib\Bridge.dll</HintPath>
2419
</Reference>
2520
</ItemGroup>
26-
2721
<ItemGroup>
2822
<DirectPInvoke Include="rl_ball_sym" />
29-
3023
<!-- Statically linked for publishing -->
31-
<NativeLibrary Include="..\RLBotCS\lib\rl_ball_sym\win-x86_64\rl_ball_sym.lib" Condition="'$(OS)' == 'Windows_NT'" />
32-
<NativeLibrary Include="../RLBotCS/lib/rl_ball_sym/linux-x86_64/librl_ball_sym.a" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'" />
33-
<NativeLibrary Include="../RLBotCS/lib/rl_ball_sym/mac-aarch64/librl_ball_sym.a" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'" />
34-
24+
<NativeLibrary
25+
Include="..\RLBotCS\lib\rl_ball_sym\win-x86_64\rl_ball_sym.lib"
26+
Condition="'$(OS)' == 'Windows_NT'"
27+
/>
28+
<NativeLibrary
29+
Include="../RLBotCS/lib/rl_ball_sym/linux-x86_64/librl_ball_sym.a"
30+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
31+
/>
32+
<NativeLibrary
33+
Include="../RLBotCS/lib/rl_ball_sym/mac-aarch64/librl_ball_sym.a"
34+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'"
35+
/>
3536
<!-- Dynamically linked for development -->
36-
<ContentWithTargetPath Include="..\RLBotCS\lib\rl_ball_sym\win-x86_64\rl_ball_sym.dll" Condition="'$(OS)' == 'Windows_NT'">
37+
<ContentWithTargetPath
38+
Include="..\RLBotCS\lib\rl_ball_sym\win-x86_64\rl_ball_sym.dll"
39+
Condition="'$(OS)' == 'Windows_NT'"
40+
>
3741
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
3842
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3943
<TargetPath>rl_ball_sym.dll</TargetPath>
4044
</ContentWithTargetPath>
41-
42-
<ContentWithTargetPath Include="../RLBotCS/lib/rl_ball_sym/linux-x86_64/librl_ball_sym.so" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
45+
<ContentWithTargetPath
46+
Include="../RLBotCS/lib/rl_ball_sym/linux-x86_64/librl_ball_sym.so"
47+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"
48+
>
4349
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
4450
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4551
<TargetPath>rl_ball_sym.so</TargetPath>
4652
</ContentWithTargetPath>
47-
48-
<ContentWithTargetPath Include="../RLBotCS/lib/rl_ball_sym/mac-aarch64/librl_ball_sym.dylib" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'">
49-
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
50-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
51-
<TargetPath>rl_ball_sym.dylib</TargetPath>
53+
<ContentWithTargetPath
54+
Include="../RLBotCS/lib/rl_ball_sym/mac-aarch64/librl_ball_sym.dylib"
55+
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'"
56+
>
57+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
58+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
59+
<TargetPath>rl_ball_sym.dylib</TargetPath>
5260
</ContentWithTargetPath>
5361
</ItemGroup>
54-
5562
<ItemGroup>
5663
<Content Include="TestTomls\*">
5764
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5865
</Content>
5966
</ItemGroup>
60-
6167
</Project>

0 commit comments

Comments
 (0)