@@ -109,7 +109,12 @@ struct Features(HashSet<Feature>);
109
109
110
110
impl Default for Features {
111
111
fn default ( ) -> Self {
112
- Features :: new ( vec ! [ Feature :: Lua54 ] )
112
+ // should be kept up to date with the default feature + lua54
113
+ Features :: new ( vec ! [
114
+ Feature :: Lua54 ,
115
+ Feature :: CoreFunctions ,
116
+ Feature :: BevyBindings ,
117
+ ] )
113
118
}
114
119
}
115
120
@@ -147,7 +152,11 @@ impl Features {
147
152
if self . 0 . is_empty ( ) {
148
153
vec ! [ ]
149
154
} else {
150
- vec ! [ "--features" . to_owned( ) , self . to_string( ) ]
155
+ vec ! [
156
+ "--no-default-features" . to_owned( ) ,
157
+ "--features" . to_owned( ) ,
158
+ self . to_string( ) ,
159
+ ]
151
160
}
152
161
}
153
162
@@ -574,14 +583,21 @@ impl Xtasks {
574
583
575
584
let mut args = vec ! [ ] ;
576
585
args. push ( command. to_owned ( ) ) ;
577
- args. push ( "--workspace" . to_owned ( ) ) ;
586
+
587
+ if command != "fmt" {
588
+ args. push ( "--workspace" . to_owned ( ) ) ;
589
+ }
578
590
579
591
if let Some ( profile) = app_settings. profile . as_ref ( ) {
580
592
args. push ( "--profile" . to_owned ( ) ) ;
581
593
args. push ( profile. clone ( ) ) ;
582
594
}
583
595
584
- args. extend ( app_settings. features . to_cargo_args ( ) ) ;
596
+ if command != "fmt" {
597
+ // fmt doesn't care about features
598
+ args. extend ( app_settings. features . to_cargo_args ( ) ) ;
599
+ }
600
+
585
601
args. extend ( add_args. into_iter ( ) . map ( |s| {
586
602
s. as_ref ( )
587
603
. to_str ( )
@@ -647,10 +663,11 @@ impl Xtasks {
647
663
}
648
664
649
665
// run cargo fmt checks
650
- Self :: run_system_command (
651
- "cargo" ,
666
+ Self :: run_workspace_command (
667
+ & app_settings,
668
+ "fmt" ,
652
669
"Failed to run cargo fmt" ,
653
- vec ! [ "fmt" , " --all", "--" , "--check" ] ,
670
+ vec ! [ "--all" , "--" , "--check" ] ,
654
671
None ,
655
672
) ?;
656
673
@@ -730,7 +747,11 @@ impl Xtasks {
730
747
. map ( |s| Feature :: from_str ( s) . expect ( "invalid feature" ) )
731
748
. collect :: < Vec < _ > > ( ) ;
732
749
733
- let features = Features :: new ( string_list) ;
750
+ // include default features
751
+ let default_features = Features :: default ( ) ;
752
+ let mut features = Features :: new ( string_list) ;
753
+ features. 0 . extend ( default_features. 0 ) ;
754
+
734
755
app_settings. features = features;
735
756
736
757
let mut args = Vec :: default ( ) ;
0 commit comments