diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e013ea7 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,4 @@ +FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm + +# Install 'just' as root during the build process +RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..b8bbbb4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "Gingko Development", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "vadimcn.vscode-lldb", + "mutuhun.just" + ] + } + }, + "remoteUser": "vscode" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/cli/Cargo.lock b/cli/Cargo.lock new file mode 100644 index 0000000..c3957db --- /dev/null +++ b/cli/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "cli" +version = "0.1.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..16d2db2 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cli" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/cli/src/main.rs b/cli/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/cli/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/core/Cargo.lock b/core/Cargo.lock new file mode 100644 index 0000000..3f34dcb --- /dev/null +++ b/core/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "core" +version = "0.1.0" diff --git a/core/Cargo.toml b/core/Cargo.toml new file mode 100644 index 0000000..143436c --- /dev/null +++ b/core/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "core" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/core/src/lib.rs b/core/src/lib.rs new file mode 100644 index 0000000..2cc1a43 --- /dev/null +++ b/core/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} \ No newline at end of file diff --git a/justfile b/justfile new file mode 100644 index 0000000..25f255b --- /dev/null +++ b/justfile @@ -0,0 +1,13 @@ +default: + @just --list --justfile {{justfile()}} + +build: build-core build-cli + +build-core: + cargo build --manifest-path "core/Cargo.toml" --target-dir "target" + +build-cli: build-core + cargo build --manifest-path "cli/Cargo.toml" --target-dir "target" + +run: + cargo run --manifest-path "cli/Cargo.toml" --target-dir "target"