move backend to subfolder

This commit is contained in:
Vinzenz Schroeter 2024-04-21 12:38:03 +02:00
parent d4d1f2f981
commit 8d09663eff
80 changed files with 98 additions and 88 deletions

View file

@ -1,48 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<PropertyGroup>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CA1805,CA1848</NoWarn>
</PropertyGroup>
<PropertyGroup>
<IsAotCompatible>true</IsAotCompatible>
<PublishAot>true</PublishAot>
<IlcDisableReflection>false</IlcDisableReflection>
<StaticExecutable>true</StaticExecutable>
<StripSymbols>true</StripSymbols>
<StaticallyLinked>true</StaticallyLinked>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0"/>
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3"/>
<ProjectReference Include="../DisplayCommands/DisplayCommands.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="./assets/tank.png" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always"/>
<Content Include="../Dockerfile">
<Link>Dockerfile</Link>
</Content>
<Content Include="../.dockerignore">
<Link>Dockerfile</Link>
</Content>
<Content Include="../Makefile"/>
<Content Include="../.editorconfig"/>
<Content Include="../README.md"/>
<None Include="assets\maps\**" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
</Project>

View file

@ -1,18 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsAotCompatible>true</IsAotCompatible>
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
</PropertyGroup>
<Import Project="../shared.props" />
<PropertyGroup>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CA1805,CA1848</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
</PropertyGroup>
<ItemGroup>

View file

@ -199,7 +199,8 @@ public class StructEndiannessSourceGenerator : ISourceGenerator
)
)))
.WithSemicolonToken(Token(SyntaxKind.SemicolonToken))
])));
]))
);
}
private static SyntaxToken GeneratePropertyName(string fieldName)

View file

@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../shared.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
@ -9,6 +11,7 @@
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<IsRoslynComponent>true</IsRoslynComponent>
<PackageId>EndiannessSourceGenerator</PackageId>
<IsAotCompatible>false</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
@ -17,7 +20,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2"/>
</ItemGroup>
</Project>

View file

@ -0,0 +1,9 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"Generators": {
"commandName": "DebugRoslynComponent",
"targetProject": "../DisplayCommands/DisplayCommands.csproj"
}
}
}

View file

@ -6,6 +6,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisplayCommands", "DisplayC
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndiannessSourceGenerator", "EndiannessSourceGenerator\EndiannessSourceGenerator.csproj", "{D77FE880-F2B8-43B6-8B33-B6FA089CC337}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{12DB7D48-1BB2-488B-B4D9-4126087D2F8C}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
shared.props = shared.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View file

@ -75,5 +75,4 @@ internal static class Endpoints
return Results.Ok();
});
}
}

View file

@ -20,7 +20,7 @@ internal sealed class TankSpawnQueue(
_spawnTimes.AddOrUpdate(player, DateTime.MinValue, (_, _) => DateTime.Now + _spawnDelay);
}
public bool TryDequeueNext([MaybeNullWhen(false)] out Player player)
private bool TryDequeueNext([MaybeNullWhen(false)] out Player player)
{
if (!_queue.TryDequeue(out player))
return false; // no one on queue

View file

@ -14,7 +14,7 @@ internal sealed record class NameId(string Name, Guid Id);
public static class Program
{
public static void Main(string[] args)
public static async Task Main(string[] args)
{
var app = Configure(args);
@ -24,7 +24,7 @@ public static class Program
Endpoints.MapEndpoints(app);
app.Run();
await app.RunAsync();
}
private static WebApplication Configure(string[] args)

View file

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="../shared.props" />
<PropertyGroup>
<PublishAot>true</PublishAot>
<IlcDisableReflection>false</IlcDisableReflection>
<StaticExecutable>true</StaticExecutable>
<StripSymbols>true</StripSymbols>
<StaticallyLinked>true</StaticallyLinked>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0"/>
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4"/>
<ProjectReference Include="../DisplayCommands/DisplayCommands.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="./assets/tank.png" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always"/>
<!-- TODO include maps in release -->
<None Include="./assets/maps/**" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View file

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View file

@ -10,5 +10,8 @@ GET localhost/map
###
POST localhost/map?index=0
POST localhost/map?name=chaosknoten.png
###
POST localhost/map?name=tanks.txt

View file

@ -0,0 +1,20 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<IsAotCompatible>true</IsAotCompatible>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<PropertyGroup>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CA1805,CA1848</NoWarn>
</PropertyGroup>
</Project>