87 lines
3.0 KiB
C#
87 lines
3.0 KiB
C#
namespace Sdt.Config;
|
|
|
|
public sealed class DevToolConfig
|
|
{
|
|
public string Name { get; init; } = "SDT Project";
|
|
public string Version { get; init; } = "0.1.0";
|
|
public List<BuildTarget> Targets { get; init; } = [];
|
|
public List<EnvVarDef> Env { get; init; } = [];
|
|
public ToolchainConfig? Toolchains { get; init; }
|
|
}
|
|
|
|
public sealed class BuildTarget
|
|
{
|
|
public string Id { get; init; } = "";
|
|
public string Label { get; init; } = "";
|
|
public string Description { get; init; } = "";
|
|
public string Group { get; init; } = "General";
|
|
|
|
/// <summary>Executable name. Null = virtual aggregator (runs DependsOn only).</summary>
|
|
public string? Command { get; init; }
|
|
|
|
public List<string> Args { get; init; } = [];
|
|
|
|
/// <summary>Working directory relative to project root.</summary>
|
|
public string WorkingDir { get; init; } = ".";
|
|
|
|
public List<string> DependsOn { get; init; } = [];
|
|
}
|
|
|
|
public sealed class EnvVarDef
|
|
{
|
|
public string Key { get; init; } = "";
|
|
public string Description { get; init; } = "";
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("default")]
|
|
public string DefaultValue { get; init; } = "";
|
|
|
|
/// <summary>If non-empty, shown as a dropdown. Otherwise free-text input.</summary>
|
|
public List<string> Options { get; init; } = [];
|
|
}
|
|
|
|
// ── Toolchain config ──────────────────────────────────────────────────────────
|
|
|
|
public sealed class ToolchainConfig
|
|
{
|
|
public PythonToolchain? Python { get; init; }
|
|
public NodeToolchain? Node { get; init; }
|
|
}
|
|
|
|
public sealed class PythonToolchain
|
|
{
|
|
/// <summary>Python executable (e.g. "python3.14", "python").</summary>
|
|
public string Executable { get; init; } = "python";
|
|
|
|
/// <summary>Windows-specific override (e.g. "py" when using the launcher).</summary>
|
|
public string? WindowsExecutable { get; init; }
|
|
|
|
/// <summary>Optional version flag to pass (e.g. "-3.14" for py launcher).</summary>
|
|
public string? LauncherVersion { get; init; }
|
|
|
|
/// <summary>Venv directory relative to project root.</summary>
|
|
public string VenvDir { get; init; } = ".venv";
|
|
|
|
public List<PythonProfile> Profiles { get; init; } = [];
|
|
|
|
/// <summary>Optional path to a pip wrapper script (relative to project root).</summary>
|
|
public string? PipScript { get; init; }
|
|
}
|
|
|
|
public sealed class PythonProfile
|
|
{
|
|
public string Id { get; init; } = "";
|
|
public string Label { get; init; } = "";
|
|
public string RequirementsFile { get; init; } = "";
|
|
public string? ExtraIndexUrl { get; init; }
|
|
public List<string> PostInstallCommands { get; init; } = [];
|
|
}
|
|
|
|
public sealed class NodeToolchain
|
|
{
|
|
/// <summary>Package manager: "npm", "pnpm", or "yarn".</summary>
|
|
public string PackageManager { get; init; } = "npm";
|
|
|
|
/// <summary>Working directory for the frontend (relative to project root).</summary>
|
|
public string WorkingDir { get; init; } = ".";
|
|
}
|