Skip to main content

aoc_toolkit/project/
mod.rs

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