Crate aoc_input_build

Crate aoc_input_build 

Source
Expand description

AoC input build is helper library to download input files for Advent of Code.

Provides single function download_inputs. This function needs to be called from build.rs build script. It will download all necessary input files for given Advent of Code year.

use aoc_input_build::download_inputs;

fn main() {
    let root_dir = env!("CARGO_MANIFEST_DIR"); // root of the project, should always be set to CARGO_MANIFEST_DIR env var
    let token = env!("AOC_TOKEN"); // session cookie from https://adventofcode.com/
    let year = 2025; // which year of Advent of Code to use
    download_inputs(root_dir, token, year);
}

This snippet should be placed inside build.rs. It will download input file for each dayXX.rs inside root_dir/src/ to root_dir/input/dayXX.txt. If the input file already exists, it does not re-download it.

Functions§

download_inputs
Downloads input files for year’s Advent of Code. Should be called from build.rs build script.