|
@@ -131,6 +131,7 @@ try
|
|
|
let hres = Hashtbl.create 0 in
|
|
|
let cmds = ref [] in
|
|
|
let excludes = ref [] in
|
|
|
+ let libs = ref [] in
|
|
|
let gen_hx = ref false in
|
|
|
Plugin.defines := base_defines;
|
|
|
Typer.check_override := false;
|
|
@@ -200,6 +201,7 @@ try
|
|
|
main_class := Some cpath;
|
|
|
classes := cpath :: !classes
|
|
|
),"<class> : select startup class");
|
|
|
+ ("-lib",Arg.String (fun l -> libs := l :: !libs),"<library[:version]> : use an haxelib library");
|
|
|
("-D",Arg.String (fun def ->
|
|
|
Plugin.define def;
|
|
|
),"<var> : define a conditional compilation flag");
|
|
@@ -274,6 +276,20 @@ try
|
|
|
classes := make_path cl :: !classes
|
|
|
in
|
|
|
Arg.parse_argv ~current args args_spec args_callback usage;
|
|
|
+ (match !libs with
|
|
|
+ | [] -> ()
|
|
|
+ | l ->
|
|
|
+ let cmd = "haxelib path " ^ String.concat " " l in
|
|
|
+ let p = Unix.open_process_in cmd in
|
|
|
+ let lines = Std.input_list p in
|
|
|
+ let ret = Unix.close_process_in p in
|
|
|
+ let lines = List.map (fun l ->
|
|
|
+ let p = String.length l - 1 in
|
|
|
+ if l.[p] = '\r' then String.sub l 0 p else l
|
|
|
+ ) lines in
|
|
|
+ if ret <> Unix.WEXITED 0 then failwith (String.concat "\n" lines);
|
|
|
+ Plugin.class_path := lines @ !Plugin.class_path;
|
|
|
+ );
|
|
|
(match !target with
|
|
|
| No ->
|
|
|
()
|