Files
TTT/Locale/Locale.csproj
2025-11-10 03:53:14 -08:00

39 lines
1.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>TTT.Locale</RootNamespace>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.346"/>
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.3"/>
<PackageReference Include="System.Text.Json" Version="8.0.5"/>
<PackageReference Include="YamlDotNet" Version="16.3.0"/>
</ItemGroup>
<Target Name="PreprocessYaml" AfterTargets="Build;VSTest">
<PropertyGroup>
<LocaleDllPath>$(MSBuildProjectDirectory)\bin\$(Configuration)\net8.0\$(AssemblyName).dll</LocaleDllPath>
<MasterJsonPath>$(MSBuildProjectDirectory)\..\lang\en.json</MasterJsonPath>
</PropertyGroup>
<ItemGroup>
<LangFiles Include="..\**\lang\*.yml"/>
<!-- Exclude Test/lang/en.yml only in Release config -->
<LangFiles Remove="..\TTT\Test\lang\en.yml" Condition="'$(Configuration)' == 'Release'"/>
</ItemGroup>
<Message Importance="high" Text="Combining YAML files into $(MasterJsonPath)"/>
<Message Importance="high" Text="Included YAML files:"/>
<Message Importance="high" Text=" %(LangFiles.FullPath)" Condition="'%(LangFiles.FullPath)' != ''"/>
<Exec Command="dotnet &quot;$(LocaleDllPath)&quot; @(LangFiles->'&quot;%(FullPath)&quot;', ' ') --out &quot;$(MasterJsonPath)&quot;"/>
</Target>
</Project>