@@ -109,7 +109,12 @@ struct Features(HashSet<Feature>);
109109
110110impl Default for Features {
111111 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+ ] )
113118 }
114119}
115120
@@ -147,7 +152,11 @@ impl Features {
147152 if self . 0 . is_empty ( ) {
148153 vec ! [ ]
149154 } 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+ ]
151160 }
152161 }
153162
@@ -574,14 +583,21 @@ impl Xtasks {
574583
575584 let mut args = vec ! [ ] ;
576585 args. push ( command. to_owned ( ) ) ;
577- args. push ( "--workspace" . to_owned ( ) ) ;
586+
587+ if command != "fmt" {
588+ args. push ( "--workspace" . to_owned ( ) ) ;
589+ }
578590
579591 if let Some ( profile) = app_settings. profile . as_ref ( ) {
580592 args. push ( "--profile" . to_owned ( ) ) ;
581593 args. push ( profile. clone ( ) ) ;
582594 }
583595
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+
585601 args. extend ( add_args. into_iter ( ) . map ( |s| {
586602 s. as_ref ( )
587603 . to_str ( )
@@ -647,10 +663,11 @@ impl Xtasks {
647663 }
648664
649665 // run cargo fmt checks
650- Self :: run_system_command (
651- "cargo" ,
666+ Self :: run_workspace_command (
667+ & app_settings,
668+ "fmt" ,
652669 "Failed to run cargo fmt" ,
653- vec ! [ "fmt" , " --all", "--" , "--check" ] ,
670+ vec ! [ "--all" , "--" , "--check" ] ,
654671 None ,
655672 ) ?;
656673
@@ -730,7 +747,11 @@ impl Xtasks {
730747 . map ( |s| Feature :: from_str ( s) . expect ( "invalid feature" ) )
731748 . collect :: < Vec < _ > > ( ) ;
732749
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+
734755 app_settings. features = features;
735756
736757 let mut args = Vec :: default ( ) ;
0 commit comments