Skip to main content

aoc_toolkit/project/
config.rs

1use serde::Deserialize;
2use std::path::PathBuf;
3
4pub const SCHEMA_VERSION: u32 = 1;
5
6#[derive(Debug, Deserialize)]
7pub struct ProjectConfig {
8    pub schema_version: u32,
9    pub project: ProjectSettings,
10    pub runner: RunnerConfig,
11}
12
13#[derive(Debug, Deserialize)]
14pub struct ProjectSettings {
15    pub language: Language,
16    pub solutions: PathBuf,
17
18    #[serde(default = "default_year_prefix")]
19    pub year_prefix: String,
20}
21
22fn default_year_prefix() -> String {
23    String::new()
24}
25
26#[derive(Debug, Deserialize)]
27pub struct RunnerConfig {
28    pub manifest: PathBuf,
29    pub binary: Option<String>,
30    pub profile: String,
31}
32
33#[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq)]
34#[serde(rename_all = "lowercase")]
35pub enum Language {
36    Rust,
37}