|
@@ -27,6 +27,7 @@ type target =
|
|
let prompt = ref false
|
|
let prompt = ref false
|
|
let alt_format = ref false
|
|
let alt_format = ref false
|
|
let has_error = ref false
|
|
let has_error = ref false
|
|
|
|
+let auto_xml = ref false
|
|
|
|
|
|
let normalize_path p =
|
|
let normalize_path p =
|
|
let l = String.length p in
|
|
let l = String.length p in
|
|
@@ -250,6 +251,7 @@ try
|
|
),"<file> : generate hx headers from SWF9 file");
|
|
),"<file> : generate hx headers from SWF9 file");
|
|
("--next", Arg.Unit (fun() -> assert false), ": separate several haxe compilations");
|
|
("--next", Arg.Unit (fun() -> assert false), ": separate several haxe compilations");
|
|
("--altfmt", Arg.Unit (fun() -> alt_format := true),": use alternative error output format");
|
|
("--altfmt", Arg.Unit (fun() -> alt_format := true),": use alternative error output format");
|
|
|
|
+ ("--auto-xml", Arg.Unit (fun() -> auto_xml := true),": automatically create an XML for each target");
|
|
] in
|
|
] in
|
|
let current = ref 0 in
|
|
let current = ref 0 in
|
|
let args = Array.of_list ("" :: params) in
|
|
let args = Array.of_list ("" :: params) in
|
|
@@ -325,16 +327,20 @@ try
|
|
List.iter (fun cpath -> ignore(Typer.load ctx cpath Ast.null_pos)) (List.rev !classes);
|
|
List.iter (fun cpath -> ignore(Typer.load ctx cpath Ast.null_pos)) (List.rev !classes);
|
|
Typer.finalize ctx;
|
|
Typer.finalize ctx;
|
|
if !has_error then do_exit();
|
|
if !has_error then do_exit();
|
|
|
|
+ let do_auto_xml file = if !auto_xml then xml_out := Some (file ^ ".xml") in
|
|
let types = Typer.types ctx (!main_class) (!excludes) in
|
|
let types = Typer.types ctx (!main_class) (!excludes) in
|
|
(match !target with
|
|
(match !target with
|
|
| No -> ()
|
|
| No -> ()
|
|
| Swf file ->
|
|
| Swf file ->
|
|
|
|
+ do_auto_xml file;
|
|
if !Plugin.verbose then print_endline ("Generating swf : " ^ file);
|
|
if !Plugin.verbose then print_endline ("Generating swf : " ^ file);
|
|
Genswf.generate file (!swf_version) (!swf_header) (!swf_in) types hres
|
|
Genswf.generate file (!swf_version) (!swf_header) (!swf_in) types hres
|
|
| Neko file ->
|
|
| Neko file ->
|
|
|
|
+ do_auto_xml file;
|
|
if !Plugin.verbose then print_endline ("Generating neko : " ^ file);
|
|
if !Plugin.verbose then print_endline ("Generating neko : " ^ file);
|
|
Genneko.generate file types hres !libs
|
|
Genneko.generate file types hres !libs
|
|
| Js file ->
|
|
| Js file ->
|
|
|
|
+ do_auto_xml file;
|
|
if !Plugin.verbose then print_endline ("Generating js : " ^ file);
|
|
if !Plugin.verbose then print_endline ("Generating js : " ^ file);
|
|
Genjs.generate file types hres
|
|
Genjs.generate file types hres
|
|
);
|
|
);
|