diff --git a/Cargo.lock b/Cargo.lock index 1990bf4..12577c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,9 +3,14 @@ version = 3 [[package]] -name = "adventofcode2022" +name = "aoc" +version = "2022.1.0" + +[[package]] +name = "aoc22-clap" version = "2022.1.0" dependencies = [ + "aoc", "clap", ] @@ -118,9 +123,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.137" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "linux-raw-sys" @@ -184,9 +189,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" dependencies = [ "bitflags", "errno", diff --git a/Cargo.toml b/Cargo.toml index 4de8ea2..482001c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,6 @@ -[package] -name = "adventofcode2022" -version = "2022.1.0" -edition = "2021" +[workspace] - -[dependencies] -clap = { version = "4.0.29", features = ["derive"] } +members = [ +"aoc22-clap", +"aoc" +] \ No newline at end of file diff --git a/aoc/Cargo.toml b/aoc/Cargo.toml new file mode 100644 index 0000000..8739003 --- /dev/null +++ b/aoc/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aoc" +version = "2022.1.0" +edition = "2021" + +[dependencies] diff --git a/aoc/src/lib.rs b/aoc/src/lib.rs new file mode 100644 index 0000000..cd57476 --- /dev/null +++ b/aoc/src/lib.rs @@ -0,0 +1,4 @@ +pub mod year2022; +pub mod util; + +pub use year2022::*; diff --git a/src/util.rs b/aoc/src/util.rs similarity index 100% rename from src/util.rs rename to aoc/src/util.rs diff --git a/src/cli/commands/day001.rs b/aoc/src/year2022/day001.rs similarity index 100% rename from src/cli/commands/day001.rs rename to aoc/src/year2022/day001.rs diff --git a/src/cli/commands/day002.rs b/aoc/src/year2022/day002.rs similarity index 100% rename from src/cli/commands/day002.rs rename to aoc/src/year2022/day002.rs diff --git a/src/cli/commands/day003.rs b/aoc/src/year2022/day003.rs similarity index 100% rename from src/cli/commands/day003.rs rename to aoc/src/year2022/day003.rs diff --git a/src/cli/commands/day004.rs b/aoc/src/year2022/day004.rs similarity index 100% rename from src/cli/commands/day004.rs rename to aoc/src/year2022/day004.rs diff --git a/src/cli/commands/day005.rs b/aoc/src/year2022/day005.rs similarity index 100% rename from src/cli/commands/day005.rs rename to aoc/src/year2022/day005.rs diff --git a/src/cli/commands/day006.rs b/aoc/src/year2022/day006.rs similarity index 100% rename from src/cli/commands/day006.rs rename to aoc/src/year2022/day006.rs diff --git a/src/cli/commands/day007.rs b/aoc/src/year2022/day007.rs similarity index 100% rename from src/cli/commands/day007.rs rename to aoc/src/year2022/day007.rs diff --git a/src/cli/commands/day008.rs b/aoc/src/year2022/day008.rs similarity index 100% rename from src/cli/commands/day008.rs rename to aoc/src/year2022/day008.rs diff --git a/src/cli/commands/day009.rs b/aoc/src/year2022/day009.rs similarity index 100% rename from src/cli/commands/day009.rs rename to aoc/src/year2022/day009.rs diff --git a/src/cli/commands/day010.rs b/aoc/src/year2022/day010.rs similarity index 100% rename from src/cli/commands/day010.rs rename to aoc/src/year2022/day010.rs diff --git a/src/cli/commands/day011.rs b/aoc/src/year2022/day011.rs similarity index 100% rename from src/cli/commands/day011.rs rename to aoc/src/year2022/day011.rs diff --git a/src/cli/commands/day012.rs b/aoc/src/year2022/day012.rs similarity index 100% rename from src/cli/commands/day012.rs rename to aoc/src/year2022/day012.rs diff --git a/src/cli/commands/day013.rs b/aoc/src/year2022/day013.rs similarity index 100% rename from src/cli/commands/day013.rs rename to aoc/src/year2022/day013.rs diff --git a/src/cli/commands/day014.rs b/aoc/src/year2022/day014.rs similarity index 100% rename from src/cli/commands/day014.rs rename to aoc/src/year2022/day014.rs diff --git a/src/cli/commands/day015.rs b/aoc/src/year2022/day015.rs similarity index 100% rename from src/cli/commands/day015.rs rename to aoc/src/year2022/day015.rs diff --git a/src/cli/commands/day016.rs b/aoc/src/year2022/day016.rs similarity index 100% rename from src/cli/commands/day016.rs rename to aoc/src/year2022/day016.rs diff --git a/src/cli/commands/day017.rs b/aoc/src/year2022/day017.rs similarity index 100% rename from src/cli/commands/day017.rs rename to aoc/src/year2022/day017.rs diff --git a/src/cli/commands/day018.rs b/aoc/src/year2022/day018.rs similarity index 100% rename from src/cli/commands/day018.rs rename to aoc/src/year2022/day018.rs diff --git a/src/cli/commands/day019.rs b/aoc/src/year2022/day019.rs similarity index 100% rename from src/cli/commands/day019.rs rename to aoc/src/year2022/day019.rs diff --git a/src/cli/commands/day020.rs b/aoc/src/year2022/day020.rs similarity index 100% rename from src/cli/commands/day020.rs rename to aoc/src/year2022/day020.rs diff --git a/src/cli/commands/day021.rs b/aoc/src/year2022/day021.rs similarity index 100% rename from src/cli/commands/day021.rs rename to aoc/src/year2022/day021.rs diff --git a/src/cli/commands/day022.rs b/aoc/src/year2022/day022.rs similarity index 100% rename from src/cli/commands/day022.rs rename to aoc/src/year2022/day022.rs diff --git a/src/cli/commands/day023.rs b/aoc/src/year2022/day023.rs similarity index 100% rename from src/cli/commands/day023.rs rename to aoc/src/year2022/day023.rs diff --git a/src/cli/commands/day024.rs b/aoc/src/year2022/day024.rs similarity index 100% rename from src/cli/commands/day024.rs rename to aoc/src/year2022/day024.rs diff --git a/src/cli/commands/day025.rs b/aoc/src/year2022/day025.rs similarity index 100% rename from src/cli/commands/day025.rs rename to aoc/src/year2022/day025.rs diff --git a/src/cli/commands/mod.rs b/aoc/src/year2022/mod.rs similarity index 100% rename from src/cli/commands/mod.rs rename to aoc/src/year2022/mod.rs diff --git a/aoc22-clap/Cargo.toml b/aoc22-clap/Cargo.toml new file mode 100644 index 0000000..19afcd9 --- /dev/null +++ b/aoc22-clap/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "aoc22-clap" +version = "2022.1.0" +edition = "2021" + + +[dependencies] +clap = { version = "4.0.29", features = ["derive"] } +aoc = {path= "../aoc"} \ No newline at end of file diff --git a/src/cli/mod.rs b/aoc22-clap/src/cli/mod.rs similarity index 98% rename from src/cli/mod.rs rename to aoc22-clap/src/cli/mod.rs index a506aca..462e509 100644 --- a/src/cli/mod.rs +++ b/aoc22-clap/src/cli/mod.rs @@ -1,6 +1,5 @@ -mod commands; use clap::{arg, Parser, Subcommand}; -use commands::*; +use aoc::*; //use std::ffi::OsString; use std::path::PathBuf; diff --git a/src/main.rs b/aoc22-clap/src/main.rs similarity index 82% rename from src/main.rs rename to aoc22-clap/src/main.rs index 634bff3..11d70e6 100644 --- a/src/main.rs +++ b/aoc22-clap/src/main.rs @@ -1,4 +1,3 @@ -pub mod util; mod cli; use cli::execute_cli;