Add initial defination of the hello package

This commit is contained in:
WildCat 2022-01-08 21:08:02 +08:00
parent 10ea7fed38
commit 643804cb22
8 changed files with 27 additions and 17 deletions

17
hello/Cargo.toml Normal file
View File

@ -0,0 +1,17 @@
[package]
name = "hello"
version = "0.1.0"
edition = "2021"
authors = ["Daohan Chong <wildcat.name@gmail.com>"]
[lib]
crate-type = ["cdylib"]
name = "hello"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
uniffi = "0.16.0"
[build-dependencies]
uniffi_build = "0.16.0"

3
hello/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
uniffi_build::generate_scaffolding("./src/hello.udl").unwrap();
}

3
hello/src/hello.udl Normal file
View File

@ -0,0 +1,3 @@
namespace Hello {
void say_hello(string name);
};

4
hello/src/lib.rs Normal file
View File

@ -0,0 +1,4 @@
pub fn say_hello(name: &str) {
println!("Hello, {}!", name);
}

View File

@ -1,9 +0,0 @@
[package]
name = "todo_list_shared"
version = "0.1.0"
edition = "2021"
author = "Daohan Chong <wildcat.name@gmail.com>"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -1,8 +0,0 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}