mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-06 21:29:44 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0f997fadd | ||
|
|
0ce3c9892d | ||
|
|
9743565285 | ||
|
|
fcfe9e4790 | ||
|
|
be36432296 |
6
.github/workflows/build_and_test.yml
vendored
6
.github/workflows/build_and_test.yml
vendored
@@ -27,12 +27,6 @@ jobs:
|
||||
- name: Run publish script
|
||||
run: ./publish-nix.sh -d
|
||||
|
||||
- name: Upload package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: "*.nupkg,*.snupkg"
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.8.4</Version>
|
||||
<Version>1.8.6</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Support All Frameworks -->
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.8.5</Version>
|
||||
<Version>1.8.6</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
<Description>Serialization and deserialization helpers for various types</Description>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2019-2024</Copyright>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2019-2025</Copyright>
|
||||
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Serialization</RepositoryUrl>
|
||||
|
||||
@@ -749,11 +749,6 @@ namespace SabreTools.Serialization.Wrappers
|
||||
/// </summary>
|
||||
private Models.PortableExecutable.VersionInfo? _versionInfo = null;
|
||||
|
||||
/// <summary>
|
||||
/// Cached version info strings data
|
||||
/// </summary>
|
||||
private readonly Dictionary<string, string?> _versionInfoStrings = [];
|
||||
|
||||
/// <summary>
|
||||
/// Cached assembly manifest data
|
||||
/// </summary>
|
||||
@@ -850,50 +845,38 @@ namespace SabreTools.Serialization.Wrappers
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return null;
|
||||
|
||||
lock (_sourceDataLock)
|
||||
{
|
||||
// If we have the value cached
|
||||
if (_versionInfoStrings.ContainsKey(key))
|
||||
return _versionInfoStrings[key];
|
||||
// Ensure that we have the resource data cached
|
||||
if (ResourceData == null)
|
||||
return null;
|
||||
|
||||
// Ensure that we have the resource data cached
|
||||
if (ResourceData == null)
|
||||
return null;
|
||||
// If we don't have string version info in this executable
|
||||
var stringTable = _versionInfo?.StringFileInfo?.Children;
|
||||
if (stringTable == null || stringTable.Length == 0)
|
||||
return null;
|
||||
|
||||
// If we don't have string version info in this executable
|
||||
var stringTable = _versionInfo?.StringFileInfo?.Children;
|
||||
if (stringTable == null || stringTable.Length == 0)
|
||||
return null;
|
||||
|
||||
// Try to find a key that matches
|
||||
// Try to find a key that matches
|
||||
#if NET20
|
||||
Models.PortableExecutable.StringData? match = null;
|
||||
foreach (var st in stringTable)
|
||||
{
|
||||
if (st?.Children == null)
|
||||
continue;
|
||||
Models.PortableExecutable.StringData? match = null;
|
||||
foreach (var st in stringTable)
|
||||
{
|
||||
if (st?.Children == null)
|
||||
continue;
|
||||
|
||||
// Return the match if found
|
||||
match = Array.Find(st.Children, sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
|
||||
if (match != null)
|
||||
{
|
||||
_versionInfoStrings[key] = match.Value?.TrimEnd('\0');
|
||||
return _versionInfoStrings[key];
|
||||
}
|
||||
}
|
||||
|
||||
_versionInfoStrings[key] = null;
|
||||
return _versionInfoStrings[key];
|
||||
#else
|
||||
var match = stringTable
|
||||
.SelectMany(st => st?.Children ?? [])
|
||||
.FirstOrDefault(sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// Return either the match or null
|
||||
_versionInfoStrings[key] = match?.Value?.TrimEnd('\0');
|
||||
return _versionInfoStrings[key];
|
||||
#endif
|
||||
// Return the match if found
|
||||
match = Array.Find(st.Children, sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
|
||||
if (match != null)
|
||||
return match.Value?.TrimEnd('\0');
|
||||
}
|
||||
|
||||
return null;
|
||||
#else
|
||||
var match = stringTable
|
||||
.SelectMany(st => st?.Children ?? [])
|
||||
.FirstOrDefault(sd => sd != null && key.Equals(sd.Key, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// Return either the match or null
|
||||
return match?.Value?.TrimEnd('\0');
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user