Boilerplate for core library and CLI binary.

This commit is contained in:
alexiondev
2026-04-27 23:45:02 +00:00
parent 4f4035b391
commit 5bd5839ecf
10 changed files with 78 additions and 0 deletions

4
.devcontainer/Dockerfile Normal file
View File

@@ -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

View File

@@ -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"
}

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

7
cli/Cargo.lock generated Normal file
View File

@@ -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"

6
cli/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "cli"
version = "0.1.0"
edition = "2024"
[dependencies]

3
cli/src/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

7
core/Cargo.lock generated Normal file
View File

@@ -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"

6
core/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "core"
version = "0.1.0"
edition = "2024"
[dependencies]

14
core/src/lib.rs Normal file
View File

@@ -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);
}
}

13
justfile Normal file
View File

@@ -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"