From 576053c6b1766ced742d6293c20d422d6cc7ac96 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Mon, 22 Jan 2024 10:35:30 -0600 Subject: [PATCH 1/3] sample_component_hello_world --- .github/workflows/clippy.yml | 1 + .github/workflows/test.yml | 1 + Cargo.toml | 1 + crates/samples/components/hello_world/Cargo.toml | 8 ++++++++ crates/samples/components/hello_world/src/lib.rs | 4 ++++ 5 files changed, 15 insertions(+) create mode 100644 crates/samples/components/hello_world/Cargo.toml create mode 100644 crates/samples/components/hello_world/src/lib.rs diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 9f69a9da0c..2c9460330e 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -37,6 +37,7 @@ jobs: cargo clippy -p riddle && cargo clippy -p sample_bits && cargo clippy -p sample_com_uri && + cargo clippy -p sample_component_hello_world && cargo clippy -p sample_consent && cargo clippy -p sample_core_app && cargo clippy -p sample_counter && diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f1d9777ad..502246fc44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,7 @@ jobs: cargo test -p riddle && cargo test -p sample_bits && cargo test -p sample_com_uri && + cargo test -p sample_component_hello_world && cargo test -p sample_consent && cargo test -p sample_core_app && cargo test -p sample_counter && diff --git a/Cargo.toml b/Cargo.toml index 4cb7f88c48..0babf1a2aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "crates/libs/*", "crates/samples/windows-sys/*", "crates/samples/windows/*", + "crates/samples/components/*", "crates/targets/*", "crates/tests/*", "crates/tools/*", diff --git a/crates/samples/components/hello_world/Cargo.toml b/crates/samples/components/hello_world/Cargo.toml new file mode 100644 index 0000000000..566bddc6ce --- /dev/null +++ b/crates/samples/components/hello_world/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "sample_component_hello_world" +version = "0.0.0" +edition = "2021" +publish = false + +[lib] +crate-type = ["cdylib"] diff --git a/crates/samples/components/hello_world/src/lib.rs b/crates/samples/components/hello_world/src/lib.rs new file mode 100644 index 0000000000..bb832afa85 --- /dev/null +++ b/crates/samples/components/hello_world/src/lib.rs @@ -0,0 +1,4 @@ +#[no_mangle] +extern "system" fn HelloWorld() -> i32 { + 123 +} From f04c68c50ffb66af323965c491e512c3bc3f4341 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Mon, 22 Jan 2024 10:47:21 -0600 Subject: [PATCH 2/3] readme --- crates/samples/components/hello_world/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 crates/samples/components/hello_world/readme.md diff --git a/crates/samples/components/hello_world/readme.md b/crates/samples/components/hello_world/readme.md new file mode 100644 index 0000000000..925acf4a04 --- /dev/null +++ b/crates/samples/components/hello_world/readme.md @@ -0,0 +1 @@ +Sample for [Creating your first DLL in Rust](https://kennykerr.ca/rust-getting-started/creating-your-first-dll.html#creating-your-first-dll-in-rust) in [Getting Started with Rust](https://kennykerr.ca/rust-getting-started). From 5b1f2480ef2ac773e35e2c956b1b774bba5dee5d Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Mon, 22 Jan 2024 10:59:24 -0600 Subject: [PATCH 3/3] readme link --- crates/samples/components/hello_world/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/samples/components/hello_world/readme.md b/crates/samples/components/hello_world/readme.md index 925acf4a04..99f3599817 100644 --- a/crates/samples/components/hello_world/readme.md +++ b/crates/samples/components/hello_world/readme.md @@ -1 +1 @@ -Sample for [Creating your first DLL in Rust](https://kennykerr.ca/rust-getting-started/creating-your-first-dll.html#creating-your-first-dll-in-rust) in [Getting Started with Rust](https://kennykerr.ca/rust-getting-started). +Sample for [Creating your first DLL in Rust](https://kennykerr.ca/rust-getting-started/creating-your-first-dll.html) in [Getting Started with Rust](https://kennykerr.ca/rust-getting-started).