@@ -116,7 +116,7 @@ let output_ninja_and_namespace_map
116116 namespace ;
117117 warning;
118118 gentype_config;
119- number_of_dev_groups;
119+
120120 } : Bsb_config_types. t ) : unit
121121 =
122122 let lib_artifacts_dir = ! Bsb_global_backend. lib_artifacts_dir in
@@ -160,48 +160,34 @@ let output_ninja_and_namespace_map
160160 bs_dev_dependencies
161161 (fun x -> x.package_install_path));
162162 Bsb_ninja_global_vars. g_ns , g_ns_flg ;
163- Bsb_build_schemas. bsb_dir_group, " 0" (* TODO: avoid name conflict in the future *)
164163 |] oc
165164 in
166165 let bs_groups, bsc_lib_dirs, static_resources =
167- if number_of_dev_groups = 0 then
168- let bs_group, source_dirs,static_resources =
169- Ext_list. fold_left bs_file_groups (Map_string. empty,[] ,[] )
170- (fun (acc , dirs ,acc_resources ) ({sources ; dir; resources } as x )
171- ->
172- Bsb_db_util. merge acc sources ,
173- (if Bsb_file_groups. is_empty x then dirs else dir::dirs) ,
174- ( if resources = [] then acc_resources
175- else Ext_list. map_append resources acc_resources (fun x -> dir // x ) )
176- ) in
177- Bsb_db_util. sanity_check bs_group;
178- [|bs_group|], source_dirs, static_resources
179- else
180- let bs_groups = Array. init (number_of_dev_groups + 1 ) (fun _ -> Map_string. empty) in
181- let source_dirs = Array. init (number_of_dev_groups + 1 ) (fun _ -> [] ) in
166+ (* number_of_dev_groups = 1 -- all devs share the same group *)
167+ let bs_groups = Array. init 2 (fun _ -> Map_string. empty) in
168+ let source_dirs = Array. init 2 (fun _ -> [] ) in
182169 let static_resources =
183- Ext_list. fold_left bs_file_groups [] (fun (acc_resources : string list ) {sources; dir; resources; dir_index }
170+ Ext_list. fold_left bs_file_groups [] (fun (acc_resources : string list ) {sources; dir; resources; dev_index }
184171 ->
185- let dir_index = (dir_index :> int ) in
172+ let dir_index = if dev_index then 1 else 0 in
186173 bs_groups.(dir_index) < - Bsb_db_util. merge bs_groups.(dir_index) sources ;
187174 source_dirs.(dir_index) < - dir :: source_dirs.(dir_index);
188175 Ext_list. map_append resources acc_resources (fun x -> dir// x)
189176 ) in
190- let lib = bs_groups.(( Bsb_dir_index. lib_dir_index :> int ) ) in
177+ let lib = bs_groups.(0 ) in
191178 Bsb_db_util. sanity_check lib;
192- for i = 1 to number_of_dev_groups do
193- let c = bs_groups.(i) in
194- Bsb_db_util. sanity_check c;
195- Map_string. iter c
196- (fun k a ->
197- if Map_string. mem lib k then
198- Bsb_db_util. conflict_module_info k a (Map_string. find_exn lib k)
199- ) ;
200- Bsb_ninja_targets. output_kv
201- (Bsb_dir_index. (string_of_bsb_dev_include (of_int i)))
202- (Bsb_build_util. include_dirs source_dirs.(i)) oc
203- done ;
204- bs_groups,source_dirs.((Bsb_dir_index. lib_dir_index:>int )), static_resources
179+ let c = bs_groups.(1 ) in
180+ Bsb_db_util. sanity_check c;
181+ Map_string. iter c
182+ (fun k a ->
183+ if Map_string. mem lib k then
184+ Bsb_db_util. conflict_module_info k a (Map_string. find_exn lib k)
185+ ) ;
186+ Bsb_ninja_targets. output_kv
187+ Bsb_ninja_global_vars. g_dev_incls
188+ (Bsb_build_util. include_dirs source_dirs.(1 )) oc
189+ ;
190+ bs_groups,source_dirs.(0 ), static_resources
205191 in
206192
207193 let digest = Bsb_db_encode. write_build_cache ~dir: cwd_lib_bs bs_groups in
0 commit comments