mirror of
https://github.com/MSWS/TTT.git
synced 2025-12-05 22:20:25 -08:00
- Add conditional exclusion for test language files in `Release` builds in `Locale.csproj` - Simplify `dotnet` commands in GitHub Actions workflow
38 lines
1.5 KiB
XML
38 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.328"/>
|
|
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.3"/>
|
|
<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 "$(LocaleDllPath)" @(LangFiles->'"%(FullPath)"', ' ') --out "$(MasterJsonPath)""/>
|
|
</Target>
|
|
|
|
|
|
</Project>
|