Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Dec 21, 2024
2 parents f8e81ca + 180c832 commit 315a6e1
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.3
with:
versionSpec: '6.x'
versionSpec: '6.0.5'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v3.0.3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.3
with:
versionSpec: '6.x'
versionSpec: '6.0.5'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v3.0.3
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.3
with:
versionSpec: '6.x'
versionSpec: '6.0.5'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v3.0.3
Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
<Exec Condition="'$(IsWindows)'=='true' And $(PackageId) != ''" Command="RD /S /Q &quot;%25USERPROFILE%25\.nuget\packages\$(PackageId)&quot;" />
<Exec Condition="'$(IsLinux)'=='true' And $(PackageId) != ''" Command="rm -rf &quot;%25USERPROFILE%25\.nuget\packages\$(PackageId)&quot;" />
</Target>

<PropertyGroup>
<GitVersion_NuGetVersion Condition="'$(GitVersion_NuGetVersion)' == ''">0.0.0</GitVersion_NuGetVersion>
</PropertyGroup>

</Project>
20 changes: 10 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<ItemGroup>
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="GitVersion.MsBuild" Version="6.0.5" />
<PackageVersion Include="Loqui" Version="2.69.0" />
<PackageVersion Include="Loqui" Version="2.70.0-alpha.2" />
<PackageVersion Include="Loqui.Generation">
<Version>2.64.1</Version>
<Version>2.70.0-alpha.2</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Mutagen.Bethesda.Core" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Fallout4" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Skyrim" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Starfield" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Oblivion" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Testing" Version="0.48.0" />
<PackageVersion Include="Mutagen.Bethesda.Core" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Fallout4" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Skyrim" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Starfield" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Oblivion" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Testing" Version="0.49.0-alpha.34" />
<PackageVersion Include="Mutagen.Bethesda.Serialization" Version="[$(GitVersion_NuGetVersion)]" />
<PackageVersion Include="Mutagen.Bethesda.Serialization.Newtonsoft" Version="[$(GitVersion_NuGetVersion)]" />
<PackageVersion Include="Mutagen.Bethesda.Serialization.SourceGenerator" Version="[$(GitVersion_NuGetVersion)]" />
Expand All @@ -26,8 +26,8 @@
<PackageVersion Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageVersion>
<PackageVersion Include="Noggog.CSharpExt" Version="2.69.0" />
<PackageVersion Include="Noggog.Testing" Version="2.69.0" />
<PackageVersion Include="Noggog.CSharpExt" Version="2.70.0-alpha.12" />
<PackageVersion Include="Noggog.Testing" Version="2.70.0-alpha.12" />
<PackageVersion Include="StrongInject" Version="1.4.4" />
<PackageVersion Include="System.Data.HashFunction.xxHash" Version="2.0.0" />
<PackageVersion Include="System.IO.Abstractions" Version="21.1.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,47 @@ private void SkipArray(JsonReadingUnit reader)
public float? ReadFloat(JsonReadingUnit reader)
{
SkipPropertyName(reader);
if (reader.Reader.Value is null or "") return null;
return (float)(double)reader.Reader.Value!;
switch (reader.Reader.Value)
{
case null:
case "":
return null;
case float f:
return f;
case double d:
return (float)d;
case decimal m:
return (float)m;
case int i:
return (float)i;
case long l:
return (float)l;
default:
throw new NotImplementedException();
}
}

public double? ReadDouble(JsonReadingUnit reader)
{
SkipPropertyName(reader);
if (reader.Reader.Value is null or "") return null;
return (double)reader.Reader.Value!;
switch (reader.Reader.Value)
{
case null:
case "":
return null;
case float f:
return (double)f;
case double d:
return d;
case decimal m:
return (double)m;
case int i:
return (double)i;
case long l:
return (double)l;
default:
throw new NotImplementedException();
}
}

public ModKey? ReadModKey(JsonReadingUnit reader)
Expand Down Expand Up @@ -455,10 +487,9 @@ private void SkipArray(JsonReadingUnit reader)

public Percent? ReadPercent(JsonReadingUnit reader)
{
SkipPropertyName(reader);
if (reader.Reader.Value is null or "") return null;
var d = (double)reader.Reader.Value!;
return new Percent(d);
var d = ReadDouble(reader);
if (d == null) return null;
return new Percent(d.Value);
}

public TimeOnly? ReadTimeOnly(JsonReadingUnit reader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Names GetNames(string name)
{
name = name.Substring(1);
}
name = name.TrimEnd("Getter");
name = name.TrimStringFromEnd("Getter");
return new Names(
name,
$"I{name}Getter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static void FillDefaults(LoquiTypeSet obj, PropertyCollection collection
{
if (!field.IsStatic || !field.IsReadOnly) continue;
if (!field.Name.EndsWith("Default")) continue;
if (collection.Lookup.TryGetValue(field.Name.TrimEnd("Default"), out var prop))
if (collection.Lookup.TryGetValue(field.Name.TrimStringFromEnd("Default"), out var prop))
{
prop.Default = field;
}
Expand Down

0 comments on commit 315a6e1

Please sign in to comment.