Skip to main content

aoc_toolkit/project/
mod.rs

1mod config;
2mod discovery;
3mod error;
4
5use std::path::PathBuf;
6
7pub use config::{Language, ProjectConfig, ProjectSettings, RunnerConfig};
8
9pub use error::ProjectError;
10
11#[derive(Debug)]
12pub struct Project {
13    pub root: PathBuf,
14    pub config: ProjectConfig,
15}
16
17impl Project {
18    #[must_use]
19    pub fn solutions_dir(&self) -> PathBuf {
20        self.root.join(&self.config.project.solutions)
21    }
22
23    #[must_use]
24    pub fn manifest_path(&self) -> PathBuf {
25        self.root.join(&self.config.runner.manifest)
26    }
27
28    #[must_use]
29    pub fn year_dir(&self, year: usize) -> PathBuf {
30        self.solutions_dir()
31            .join(format!("{}{year}", self.config.project.year_prefix))
32    }
33}