diff --git a/Cargo.lock b/Cargo.lock index a2a296e..6e44d46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,3 +5,18 @@ version = 3 [[package]] name = "advent_of_code_2024" version = "0.1.0" +dependencies = [ + "part_1", + "solver_base", +] + +[[package]] +name = "part_1" +version = "0.1.0" +dependencies = [ + "solver_base", +] + +[[package]] +name = "solver_base" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 57d6f63..230ca6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,15 @@ name = "advent_of_code_2024" version = "0.1.0" edition = "2021" +[workspace] +resolver = "2" # Important! wgpu/Bevy needs this! +members = ["crates/solver_base", "crates/part_1"] + [dependencies] +solver_base = { workspace = true } +part_1 = { workspace = true } + + +[workspace.dependencies] +solver_base = { path = "crates/solver_base" } +part_1 = { path = "crates/part_1" } \ No newline at end of file diff --git a/crates/part_1/Cargo.toml b/crates/part_1/Cargo.toml new file mode 100644 index 0000000..90c00d1 --- /dev/null +++ b/crates/part_1/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "part_1" +description = "Part 1 of the Advent of Code 2024" +version = "0.1.0" +edition = "2021" + +[dependencies] +solver_base = { workspace = true } \ No newline at end of file diff --git a/crates/part_1/src/lib.rs b/crates/part_1/src/lib.rs new file mode 100644 index 0000000..9912fe6 --- /dev/null +++ b/crates/part_1/src/lib.rs @@ -0,0 +1,3 @@ + + +pub mod part_1; \ No newline at end of file diff --git a/crates/part_1/src/part_1.rs b/crates/part_1/src/part_1.rs new file mode 100644 index 0000000..77bdd86 --- /dev/null +++ b/crates/part_1/src/part_1.rs @@ -0,0 +1,8 @@ + +use solver_base::solver_base; + +pub fn part_1_test_print() +{ + println!("PART 1 TEST PRINT"); + solver_base::print_test(); +} \ No newline at end of file diff --git a/crates/solver_base/Cargo.toml b/crates/solver_base/Cargo.toml new file mode 100644 index 0000000..f96a0b2 --- /dev/null +++ b/crates/solver_base/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "solver_base" +description = "Defines the traits used by each problem solver" +version = "0.1.0" +edition = "2021" + +# [dependencies] \ No newline at end of file diff --git a/crates/solver_base/src/lib.rs b/crates/solver_base/src/lib.rs new file mode 100644 index 0000000..d798100 --- /dev/null +++ b/crates/solver_base/src/lib.rs @@ -0,0 +1,2 @@ + +pub mod solver_base; \ No newline at end of file diff --git a/crates/solver_base/src/solver_base.rs b/crates/solver_base/src/solver_base.rs new file mode 100644 index 0000000..4aad84b --- /dev/null +++ b/crates/solver_base/src/solver_base.rs @@ -0,0 +1,6 @@ + + +pub fn print_test() +{ + println!("SOLVER BASE PRINT TEST"); +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e7a11a9..e97fea2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,9 @@ -fn main() { + + +use part_1; + +fn main() +{ println!("Hello, world!"); + part_1::part_1::part_1_test_print(); }