@@ -26,7 +26,7 @@ let () = Bsb_log.setup ()
26
26
27
27
let separator = " --"
28
28
29
- let watch_mode = ref false
29
+ let no_deps_mode = ref false
30
30
31
31
let do_install = ref false
32
32
@@ -84,13 +84,13 @@ let ninja_command_exit (type t) (ninja_args : string array) : t =
84
84
ninja -C _build
85
85
*)
86
86
let clean_usage =
87
- " Usage: rescript.exe clean <options>\n\n \
88
- `rescript clean` only cleans the current project \n "
87
+ " Usage: rescript clean <options>\n\n \
88
+ `rescript clean` cleans build artifacts. It is useful for edge-case reasons in case you get into a stale build \n "
89
89
90
90
let build_usage =
91
- " Usage: rescript.exe build <options> -- <ninja_options>\n\n \
92
- `rescript build` implicitly builds dependencies if they aren't built \n\n \
93
- `rescript.exe -- -h` for Ninja options (internal usage only; unstable)\n "
91
+ " Usage: rescript build <options> -- <ninja_options>\n\n \
92
+ `rescript build` builds the project with dependencies \n\n \
93
+ `rescript -- -h` for Ninja options (internal usage only; unstable)\n "
94
94
95
95
let install_target () =
96
96
let ( // ) = Filename. concat in
@@ -114,23 +114,24 @@ let build_subcommand ~start argv argv_len =
114
114
?finish:(if i < 0 then None else Some i)
115
115
~argv
116
116
[|
117
- (" -w" , unit_set_spec watch_mode, " Watch mode" );
117
+ (" -w" , unit_set_spec (ref false ), " Watch mode" );
118
+ ( " -ws" ,
119
+ string_set_spec (ref " " ),
120
+ " [host]:port set up host & port for WebSocket build notifications" );
121
+ (" -verbose" , call_spec Bsb_log. verbose, " Set the output to be verbose" );
118
122
(" -with-deps" , unit_set_spec (ref true ), " *deprecated* This is the default behavior now. This option will be removed in a future release" );
119
123
( " -install" ,
120
124
unit_set_spec do_install,
121
125
" *internal* Install public interface files for dependencies" );
122
126
(* This should be put in a subcommand
123
127
previously it works with the implication `bsb && bsb -install`
124
128
*)
125
- ( " -ws" ,
126
- string_set_spec (ref " " ),
127
- " [host]:port set up host & port for WebSocket build notifications" );
128
129
( " -regen" ,
129
130
unit_set_spec force_regenerate,
130
131
" *internal* \n \
131
132
Always regenerate build.ninja no matter bsconfig.json is changed or \
132
133
not" );
133
- (" -verbose " , call_spec Bsb_log. verbose , " Set the output to be verbose " );
134
+ (" -no-deps " , unit_set_spec no_deps_mode , " *internal* Needed for watcher to build without dependencies on file change " );
134
135
|]
135
136
failed_annon;
136
137
@@ -143,18 +144,17 @@ let build_subcommand ~start argv argv_len =
143
144
let config_opt =
144
145
Bsb_ninja_regen. regenerate_ninja ~package_kind: Toplevel
145
146
~per_proj_dir: Bsb_global_paths. cwd ~forced: ! force_regenerate in
146
- Bsb_world. make_world_deps Bsb_global_paths. cwd config_opt ninja_args;
147
+ if not ! no_deps_mode then Bsb_world. make_world_deps Bsb_global_paths. cwd config_opt ninja_args;
147
148
if ! do_install then install_target () ;
148
- if ! watch_mode then exit 0 (* let the watcher do the build*)
149
- else ninja_command_exit ninja_args
149
+ ninja_command_exit ninja_args
150
150
151
151
let clean_subcommand ~start argv =
152
152
Bsb_arg. parse_exn ~usage: clean_usage ~start ~argv
153
153
[|
154
+ (" -verbose" , call_spec Bsb_log. verbose, " Set the output to be verbose" );
154
155
( " -with-deps" ,
155
156
unit_set_spec (ref true ),
156
157
" *deprecated* This is the default behavior now. This option will be removed in a future release" );
157
- (" -verbose" , call_spec Bsb_log. verbose, " Set the output to be verbose" );
158
158
|]
159
159
failed_annon;
160
160
Bsb_clean. clean_bs_deps Bsb_global_paths. cwd;
0 commit comments