Import from internal git
This commit is contained in:
42
Core/Settings/DotnetConfig.cs
Normal file
42
Core/Settings/DotnetConfig.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Core.SpecConfig;
|
||||
|
||||
namespace Core.Settings;
|
||||
|
||||
public class DotnetConfig : BaseConfig
|
||||
{
|
||||
public GenerationType Type { get; set; } = GenerationType.Server;
|
||||
public required string GenerationImage { init; get; }
|
||||
public required string BuildImage { init; get; }
|
||||
public required string PackageFile { init; get; }
|
||||
public required string PackageFolder { init; get; }
|
||||
public required Location SpecFile { init; get; }
|
||||
public required Location OpenApi { init; get; }
|
||||
public required Location ServerFolder { init; get; }
|
||||
public required Location CommonFolder { init; get; }
|
||||
public required Location ClientFolder { init; get; }
|
||||
public required Location ConfigFile { init; get; }
|
||||
public required Location IgnoreFile { init; get; }
|
||||
public required Location ServerConfigTemplate { init; get; }
|
||||
public required Location ClientConfigTemplate { init; get; }
|
||||
public required Location ServerIgnoreTemplate { init; get; }
|
||||
public required Location ClientIgnoreTemplate { init; get; }
|
||||
public required string Registry;
|
||||
public required string AuthorizationToken;
|
||||
|
||||
public Location OutputFolder()
|
||||
=> Type switch
|
||||
{
|
||||
GenerationType.Server => ServerFolder,
|
||||
GenerationType.Common => CommonFolder,
|
||||
GenerationType.Client => ClientFolder,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(Type), Type, null)
|
||||
};
|
||||
|
||||
public Location PackageFolderPath() => OutputFolder().ConcatenateWith([PackageFolder, PackageFile]);
|
||||
public Location OpenApiFolder() => new ([OutputFolder(), OpenApi]);
|
||||
public Location OpenApiSpecFile() => new Location([OutputFolder(), OpenApi, OpenApi]).ConcatenateWith("openapi.yaml");
|
||||
public Location OpenApiConfigFile() => new Location([OutputFolder()]).ConcatenateWith("openapi-generator-config.yaml");
|
||||
public Location ConfigFilePath() => new ([OutputFolder(), ConfigFile]);
|
||||
public Location IgnoreFilePath() => new ([OutputFolder(), IgnoreFile]);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user