Explorar el Código

[java/cs] Force compilation of all -net-libs and -java-libs when running --gen-hx-classes

Cauê Waneck hace 10 años
padre
commit
551c6d6631
Se han modificado 2 ficheros con 11 adiciones y 2 borrados
  1. 5 2
      gencs.ml
  2. 6 0
      main.ml

+ 5 - 2
gencs.ml

@@ -4128,13 +4128,16 @@ let add_net_lib com file std =
 			close_in (r.PeReader.ch);
 			if PMap.mem "net_loader_debug" com.defines then
 				print_endline ("for lib " ^ file);
+			let il_typedefs = Hashtbl.copy meta.il_typedefs in
+			Hashtbl.clear meta.il_typedefs;
+
 			Hashtbl.iter (fun _ td ->
 				let path = IlMetaTools.get_path (TypeDef td) in
 				if PMap.mem "net_loader_debug" com.defines then
 					Printf.printf "found %s\n" (path_s (netpath_to_hx path));
-				Hashtbl.add com.net_path_map (netpath_to_hx path) path;
+				Hashtbl.replace com.net_path_map (netpath_to_hx path) path;
 				Hashtbl.replace meta.il_typedefs path td
-			) meta.il_typedefs;
+			) il_typedefs;
 			let meta = { nstd = std; ncom = com; nil = meta } in
 			ilctx := Some meta;
 			meta

+ 6 - 0
main.ml

@@ -1182,6 +1182,12 @@ try
 				List.iter (fun (_,_,extract) ->
 					Hashtbl.iter (fun n _ -> classes := n :: !classes) (extract())
 				) com.swf_libs;
+				List.iter (fun (_,_,_,all_files,_) ->
+					List.iter (fun path -> classes := path :: !classes) (all_files())
+				) com.java_libs;
+				List.iter (fun (_,_,all_files,_) ->
+					List.iter (fun path -> classes := path :: !classes) (all_files())
+				) com.net_libs;
 			) :: !pre_compilation;
 			xml_out := Some "hx"
 		),": generate hx headers for all input classes");