perf: 支持.net9 (#21)

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-11-25 17:01:15 +08:00
committed by GitHub
parent 7557cb0538
commit b32fe597dd
23 changed files with 250 additions and 165 deletions

View File

@ -1,5 +1,8 @@
<#@ template language="C#" #>
<#@ output encoding="utf-8" extension="resx" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
@ -25,15 +28,12 @@
</value>
</resheader>
<#
var regex = new System.Text.RegularExpressions.Regex(@"^\d", System.Text.RegularExpressions.RegexOptions.Compiled);
foreach (var file in System.IO.Directory.GetFiles("../assets/res/", "*.ln"))
var regex = new Regex(@"^\d", RegexOptions.Compiled);
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct())
{
foreach (var line in System.IO.File.ReadLines(file))
{
#>
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
<#
}
}
#>
</root>