From eb28b9bbadec2e6b410c63410875104874b2ba54 Mon Sep 17 00:00:00 2001 From: Danny McGee Date: Wed, 27 Sep 2023 10:48:41 -0400 Subject: [PATCH] Bootstrap hello-world app --- .gitignore | 1 + Cargo.lock | 7 ++++++ Cargo.toml | 4 ++++ hello-world/Cargo.toml | 8 +++++++ hello-world/project.json | 35 ++++++++++++++++++++++++++++++ hello-world/src/main.rs | 3 +++ nx.json | 46 +++++++++++++++++++++------------------- rust-toolchain.toml | 2 ++ rustfmt.toml | 0 9 files changed, 84 insertions(+), 22 deletions(-) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 hello-world/Cargo.toml create mode 100644 hello-world/project.json create mode 100644 hello-world/src/main.rs create mode 100644 rust-toolchain.toml create mode 100644 rustfmt.toml diff --git a/.gitignore b/.gitignore index 51b9af5..2857433 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ testem.log # System Files .DS_Store Thumbs.db +/target \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3496d5a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_world" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..dbe6961 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,4 @@ +[workspace] +members = [ + "./hello-world" +] diff --git a/hello-world/Cargo.toml b/hello-world/Cargo.toml new file mode 100644 index 0000000..624cb06 --- /dev/null +++ b/hello-world/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "hello_world" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/hello-world/project.json b/hello-world/project.json new file mode 100644 index 0000000..d91b738 --- /dev/null +++ b/hello-world/project.json @@ -0,0 +1,35 @@ +{ + "name": "hello_world", + "$schema": "../node_modules/nx/schemas/project-schema.json", + "projectType": "application", + "sourceRoot": "./hello-world/src", + "targets": { + "build": { + "executor": "@nxrs/cargo:build", + "options": { + "release": false + }, + "configurations": { + "production": { + "release": true + } + } + }, + "launch": { + "executor": "@nxrs" + }, + "test": { + "executor": "@nxrs/cargo:test", + "options": {} + }, + "lint": { + "executor": "@nxrs/cargo:clippy", + "options": { + "fix": false, + "failOnWarnings": true, + "noDeps": true + } + } + }, + "tags": [] +} diff --git a/hello-world/src/main.rs b/hello-world/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/hello-world/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/nx.json b/nx.json index 61d4b81..15bc2e9 100644 --- a/nx.json +++ b/nx.json @@ -1,17 +1,16 @@ { - "$schema": "./node_modules/nx/schemas/nx-schema.json", - "tasksRunnerOptions": { - "default": { - "runner": "nx/tasks-runners/default", - "options": { - "cacheableOperations": [ - "build", - "lint", - "test", - "e2e" - ] - } - } + "plugins": [ + "@nxrs/cargo" + ], + "namedInputs": { + "default": [ + "{projectRoot}/**/*", + "sharedGlobals" + ], + "production": [ + "default" + ], + "sharedGlobals": [] }, "targetDefaults": { "build": { @@ -24,14 +23,17 @@ ] } }, - "namedInputs": { - "default": [ - "{projectRoot}/**/*", - "sharedGlobals" - ], - "production": [ - "default" - ], - "sharedGlobals": [] + "tasksRunnerOptions": { + "default": { + "runner": "nx/tasks-runners/default", + "options": { + "cacheableOperations": [ + "build", + "lint", + "test", + "e2e" + ] + } + } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..292fe49 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..e69de29