From f638218463e80325f7d87dabb6522194edd4a641 Mon Sep 17 00:00:00 2001 From: copygirl Date: Sat, 30 Nov 2024 20:35:06 +0100 Subject: [PATCH] Initial commit --- .gitignore | 1 + .vscode/launch.json | 27 +++++++++++++++++++++++++++ Cargo.lock | 21 +++++++++++++++++++++ Cargo.toml | 9 +++++++++ client/Cargo.toml | 7 +++++++ client/src/main.rs | 3 +++ common/Cargo.toml | 6 ++++++ common/src/lib.rs | 14 ++++++++++++++ server/Cargo.toml | 7 +++++++ server/src/main.rs | 3 +++ 10 files changed, 98 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 client/Cargo.toml create mode 100644 client/src/main.rs create mode 100644 common/Cargo.toml create mode 100644 common/src/lib.rs create mode 100644 server/Cargo.toml create mode 100644 server/src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..dcf2609 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug client", + "cargo": { + "args": [ "build", "--bin=gaemstone-client", "--package=gaemstone-client" ], + "filter": { "name": "gaemstone-client", "kind": "bin" }, + }, + "cwd": "${workspaceFolder}", + "args": [], + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug server", + "cargo": { + "args": [ "build", "--bin=gaemstone-server", "--package=gaemstone-server" ], + "filter": { "name": "gaemstone-server", "kind": "bin" }, + }, + "cwd": "${workspaceFolder}", + "args": [], + } + ] +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e11a07b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,21 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "gaemstone-client" +version = "0.1.0" +dependencies = [ + "gaemstone-common", +] + +[[package]] +name = "gaemstone-common" +version = "0.1.0" + +[[package]] +name = "gaemstone-server" +version = "0.1.0" +dependencies = [ + "gaemstone-common", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7f5b51a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] +resolver = "2" +members = [ + "client", + "common", + "server", +] + +[workspace.dependencies] diff --git a/client/Cargo.toml b/client/Cargo.toml new file mode 100644 index 0000000..fcf48a2 --- /dev/null +++ b/client/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "gaemstone-client" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { package = "gaemstone-common", path = "../common" } diff --git a/client/src/main.rs b/client/src/main.rs new file mode 100644 index 0000000..b179521 --- /dev/null +++ b/client/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, client!"); +} diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 0000000..a371a93 --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gaemstone-common" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/server/Cargo.toml b/server/Cargo.toml new file mode 100644 index 0000000..e348f71 --- /dev/null +++ b/server/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "gaemstone-server" +version = "0.1.0" +edition = "2021" + +[dependencies] +common = { package = "gaemstone-common", path = "../common" } diff --git a/server/src/main.rs b/server/src/main.rs new file mode 100644 index 0000000..6f1793c --- /dev/null +++ b/server/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, server!"); +}