Cargo project scaffolding

Change-Id: Ibe888b1d8f202c026ea4885208e7a49ed7c98d9f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/qg/+/118752
Reviewed-by: Erik Gilling <konkers@google.com>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a5ff07f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+/target
+
+
+# Added by cargo
+#
+# already existing elements were commented out
+
+#/target
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..3c79c74
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,14 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "qg"
+version = "0.1.0"
+
+[[package]]
+name = "qg-cli"
+version = "0.1.0"
+dependencies = [
+ "qg",
+]
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..1b78267
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,6 @@
+[workspace]
+
+members = [
+    "qg",
+    "qg-cli",
+]
\ No newline at end of file
diff --git a/qg-cli/Cargo.toml b/qg-cli/Cargo.toml
new file mode 100644
index 0000000..54dafb8
--- /dev/null
+++ b/qg-cli/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "qg-cli"
+author = "The Pigweed Authors"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+qg = { path = "../qg" }
\ No newline at end of file
diff --git a/qg-cli/src/main.rs b/qg-cli/src/main.rs
new file mode 100644
index 0000000..a357e1f
--- /dev/null
+++ b/qg-cli/src/main.rs
@@ -0,0 +1,17 @@
+// Copyright 2022 The Pigweed Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+fn main() {
+    println!("Hello, {}!", qg::name());
+}
diff --git a/qg/Cargo.toml b/qg/Cargo.toml
new file mode 100644
index 0000000..911d92c
--- /dev/null
+++ b/qg/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "qg"
+version = "0.1.0"
+author = "The Pigweed Authors"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/qg/src/lib.rs b/qg/src/lib.rs
new file mode 100644
index 0000000..0d10554
--- /dev/null
+++ b/qg/src/lib.rs
@@ -0,0 +1,27 @@
+// Copyright 2022 The Pigweed Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+pub fn name() -> &'static str {
+    "qg"
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn it_works() {
+        assert_eq!(name(), "qg");
+    }
+}