From 44826a7edd68c0111273dac0ac4a3a705a6534cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9gory=20Burri?= Date: Thu, 15 Aug 2019 11:28:31 +0200 Subject: [PATCH] Add a common crate --- .gitignore | 1 + Cargo.toml | 21 ++++++--------------- Cargo.lock => backend/Cargo.lock | 0 backend/Cargo.toml | 15 +++++++++++++++ conf.ron => backend/conf.ron | 0 {src => backend/src}/consts.rs | 0 {src => backend/src}/main.rs | 0 {static => backend/static}/style.css | 0 {templates => backend/templates}/main.html | 0 common/Cargo.toml | 9 +++++++++ common/src/main.rs | 3 +++ 11 files changed, 34 insertions(+), 15 deletions(-) rename Cargo.lock => backend/Cargo.lock (100%) create mode 100644 backend/Cargo.toml rename conf.ron => backend/conf.ron (100%) rename {src => backend/src}/consts.rs (100%) rename {src => backend/src}/main.rs (100%) rename {static => backend/static}/style.css (100%) rename {templates => backend/templates}/main.html (100%) create mode 100644 common/Cargo.toml create mode 100644 common/src/main.rs diff --git a/.gitignore b/.gitignore index c41e4eb..220423d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/*.rs.bk key.secret WebSharper/key +/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 2a429cb..4608e1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,6 @@ -[package] -name = "recipes" -version = "1.0.0" -authors = ["Grégory Burri "] -edition = "2018" - -[dependencies] -actix-web = "1.0" -actix-files = "0.1" -askama = "0.8" # Template system -serde = { version = "1.0", features = ["derive"] } -listenfd = "0.3" # To watch file modifications and automatically launch a build process (only used in dev/debug). -ron = "0.5" # Rust object notation, to load configuration files. -itertools = "0.8" -sqlite = "0.25" +[workspace] + +members = [ + "backend", + "common", +] \ No newline at end of file diff --git a/Cargo.lock b/backend/Cargo.lock similarity index 100% rename from Cargo.lock rename to backend/Cargo.lock diff --git a/backend/Cargo.toml b/backend/Cargo.toml new file mode 100644 index 0000000..2a429cb --- /dev/null +++ b/backend/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "recipes" +version = "1.0.0" +authors = ["Grégory Burri "] +edition = "2018" + +[dependencies] +actix-web = "1.0" +actix-files = "0.1" +askama = "0.8" # Template system +serde = { version = "1.0", features = ["derive"] } +listenfd = "0.3" # To watch file modifications and automatically launch a build process (only used in dev/debug). +ron = "0.5" # Rust object notation, to load configuration files. +itertools = "0.8" +sqlite = "0.25" diff --git a/conf.ron b/backend/conf.ron similarity index 100% rename from conf.ron rename to backend/conf.ron diff --git a/src/consts.rs b/backend/src/consts.rs similarity index 100% rename from src/consts.rs rename to backend/src/consts.rs diff --git a/src/main.rs b/backend/src/main.rs similarity index 100% rename from src/main.rs rename to backend/src/main.rs diff --git a/static/style.css b/backend/static/style.css similarity index 100% rename from static/style.css rename to backend/static/style.css diff --git a/templates/main.html b/backend/templates/main.html similarity index 100% rename from templates/main.html rename to backend/templates/main.html diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 0000000..7874825 --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "common" +version = "0.1.0" +authors = ["Grégory Burri "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/common/src/main.rs b/common/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/common/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} -- 2.45.2