Skip to content

Commit

Permalink
build: cargo workspace at the project root (flybywiresim#3346)
Browse files Browse the repository at this point in the history
By having the cargo workspace at the project root, one can develop in
our whole codebase at the same time. Earlier one needed to have two
instances of e.g. vscode open to work on both.
  • Loading branch information
davidwalschots authored Feb 6, 2021
1 parent 05c4136 commit 542b984
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 24 deletions.
File renamed without changes.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
!.prettierignore
!.npmrc
!manifest-base.json
!Cargo.lock
!Cargo.toml
!/.cargo/config.toml
.DS_Store
node_modules
/src/sound/.cache
/src/instruments/src/EFB/dist
/A32NX/SimObjects/AirPlanes/Asobo_A320_NEO/model/*.gltf
/A32NX/SimObjects/AirPlanes/Asobo_A320_NEO/model/*.bin
*.wasm
/src/systems/target
/target
/src/instruments/src/EFB/web/
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "matklad.rust-analyzer", "vadimcn.vscode-lldb"]
}
File renamed without changes.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]

members = [
"src/systems/a320",
"src/systems/systems"
]
4 changes: 1 addition & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ build_manifests() {
}

build_systems() {
cd src/systems/a320
cargo build --target wasm32-wasi --release
cd ../../..
cp src/systems/target/wasm32-wasi/release/systems.wasm A32NX/SimObjects/AirPlanes/Asobo_A320_NEO/panel/
cp target/wasm32-wasi/release/systems.wasm A32NX/SimObjects/AirPlanes/Asobo_A320_NEO/panel/
}

build_metadata() {
Expand Down
2 changes: 0 additions & 2 deletions scripts/lint-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -ex

cd src/systems

cargo fmt -- --check

cargo clippy --all-targets --all-features -- -D warnings
2 changes: 0 additions & 2 deletions scripts/test-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

set -ex

cd src/systems

cargo test
3 changes: 0 additions & 3 deletions src/systems/.vscode/extensions.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/systems/.vscode/settings.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/systems/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/systems/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Follow the steps below if you want to build the content of this folder without u

1. Install the `wasm32-wasi` target by running: `rustup target add wasm32-wasi`.
2. Install LLVM 11 which can be found [here](https://releases.llvm.org/download.html), ensure to add it to your PATH.
3. Run `cargo build --target wasm32-wasi` in the console.
3. Run `cargo build --target wasm32-wasi` in the console at the top-level of the a32nx repository.
4. The `lib.rs` file is built as `target/wasm32-wasi/debug/a320.wasm`.

0 comments on commit 542b984

Please sign in to comment.