Skip to content

Commit 92d99fd

Browse files
authored
chore: improve xtask integration with vscode (#435)
1 parent 786a3e0 commit 92d99fd

File tree

12 files changed

+69
-14
lines changed

12 files changed

+69
-14
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
TARGET_DIR = { value = "target", relative = true }
33

44
[alias]
5-
xtask = "run --package xtask --"
5+
xtask = "run --manifest-path xtask/Cargo.toml --package xtask --"

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ members = [
115115
"crates/languages/bevy_mod_scripting_rhai",
116116
# "crates/languages/bevy_mod_scripting_rune",
117117
"crates/bevy_mod_scripting_functions",
118-
"crates/xtask",
119118
"crates/testing_crates/test_utils",
120119
"crates/testing_crates/script_integration_test_harness",
121120
"crates/bevy_mod_scripting_derive",
@@ -125,7 +124,7 @@ members = [
125124
"crates/bevy_system_reflection",
126125
]
127126
resolver = "2"
128-
exclude = ["crates/bevy_api_gen", "crates/macro_tests"]
127+
exclude = ["crates/bevy_api_gen", "crates/macro_tests", "xtask"]
129128

130129
[profile.dev]
131130
debug = 1

check.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
#!/usr/bin/env pwsh
2-
Set-Location -Path (Split-Path -Parent $MyInvocation.MyCommand.Definition)
3-
cargo xtask check --ide-mode
1+
#!/bin/bash
2+
WORKSPACE_DIR="$PWD"
3+
4+
cd "$(dirname "$0")"
5+
# if the path is in /bevy_api_gen then we run the codegen check
6+
7+
if [[ "$WORKSPACE_DIR" == *"/bevy_api_gen"* ]]; then
8+
# save output to file as well as stdout and stderr
9+
cargo xtask check --ide-mode --kind codegen
10+
elif [[ "$WORKSPACE_DIR" == *"/xtask"* ]]; then
11+
cd "$WORKSPACE_DIR"
12+
cargo clippy --workspace --message-format=json --all-targets -- -D warnings
13+
else
14+
cd "$WORKSPACE_DIR"
15+
cargo xtask check --ide-mode --kind main
16+
fi

check.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
#!/bin/bash
2+
WORKSPACE_DIR="$PWD"
3+
24
cd "$(dirname "$0")"
3-
cargo xtask check --ide-mode
5+
# if the path is in /bevy_api_gen then we run the codegen check
6+
7+
if [[ "$WORKSPACE_DIR" == *"/bevy_api_gen"* ]]; then
8+
# save output to file as well as stdout and stderr
9+
cargo xtask check --ide-mode --kind codegen
10+
elif [[ "$WORKSPACE_DIR" == *"/xtask"* ]]; then
11+
cd "$WORKSPACE_DIR"
12+
cargo check --quiet --workspace --message-format=json --all-targets
13+
else
14+
cd "$WORKSPACE_DIR"
15+
cargo xtask check --ide-mode --kind main
16+
fi

codegen_bevy_features.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bevy_asset,bevy_animation,bevy_core_pipeline,bevy_ui,bevy_pbr,bevy_render,bevy_text,bevy_sprite,file_watcher,multi_threaded

crates/bevy_api_gen/src/passes/cache_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
DEF_PATHS_GET_TYPE_REGISTRATION, DEF_PATHS_REFLECT, STD_SOURCE_TRAITS,
99
};
1010

11-
fn dump_traits(tcx: &TyCtxt) -> String{
11+
fn dump_traits(tcx: &TyCtxt) -> String {
1212
let mut buffer = String::new();
1313
for t in tcx.all_traits() {
1414
buffer.push_str(&tcx.def_path_str(t));
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)