Version 17.0 + Generate 1.33 (#1626)

* generated based on 1.33

* Update version to 17.0 in version.json

* Remove extra API endpoint from swagger.json

* Remove ModelConverter and related AutoMapper components

* Update package versions

* Refactor code to use ConfigureAwait(false) for asynchronous calls and update target framework to net9.0

* Remove ConfigureAwait(false) from OidcAuthTests for consistency in async calls

* Update SDK version in README to reflect support for net8.0 and net9.0

* Update dotnet SDK version to 9.0.x in build workflow

* Revert Fractions package version to 7.3.0 in Directory.Packages.props

* Update target framework to netstandard2.1 for improved compatibility

* Update package references for Microsoft.CodeAnalysis in Directory.Packages.props and LibKubernetesGenerator.target

* Refactor Worker class constructor documentation and standardize Dictionary type declaration in Program.cs
This commit is contained in:
Boshi Lian
2025-04-27 12:55:24 -07:00
committed by GitHub
parent dfdf0b70d2
commit 001189de77
30 changed files with 10666 additions and 864 deletions

View File

@@ -1,12 +1,6 @@
using Autofac;
using Microsoft.CodeAnalysis;
using NSwag;
#if GENERATE_AUTOMAPPER
using System.Collections.Generic;
using System;
using System.IO;
using System.Linq;
#endif
namespace LibKubernetesGenerator
{
@@ -68,7 +62,6 @@ namespace LibKubernetesGenerator
builder.RegisterType<ModelGenerator>();
builder.RegisterType<ApiGenerator>();
builder.RegisterType<VersionConverterStubGenerator>();
builder.RegisterType<VersionConverterAutoMapperGenerator>();
builder.RegisterType<VersionGenerator>();
return builder.Build();
@@ -90,33 +83,6 @@ namespace LibKubernetesGenerator
});
#endif
#if GENERATE_AUTOMAPPER
var automappersrc = generatorContext.CompilationProvider.Select((c, _) => c.SyntaxTrees.First(s => PathSuffixMath(s.FilePath, "AutoMapper/VersionConverter.cs")));
generatorContext.RegisterSourceOutput(automappersrc, (ctx, srctree) =>
{
var (swagger, container) = BuildContainer();
container.Resolve<VersionConverterAutoMapperGenerator>().Generate(swagger, ctx, srctree);
});
#endif
}
#if GENERATE_AUTOMAPPER
private IEnumerable<string> PathSplit(string path)
{
var p = path;
while (!string.IsNullOrEmpty(p))
{
yield return Path.GetFileName(p);
p = Path.GetDirectoryName(p);
}
}
private bool PathSuffixMath(string path, string suffix)
{
var s = PathSplit(suffix).ToList();
return PathSplit(path).Take(s.Count).SequenceEqual(s);
}
#endif
}
}