Permalink
Browse files

[feature] compiler,options: --conf-opa-files, use opa files from the …

…conf files
  • Loading branch information...
1 parent 670d506 commit 0bc807e8eb608c3d3d5feb26b4b42d1b6a2846fb @OpaOnWindowsNow OpaOnWindowsNow committed Feb 27, 2012
Showing with 24 additions and 3 deletions.
  1. +9 −1 compilerlib/objectFiles.ml
  2. +6 −1 compilerlib/objectFiles.mli
  3. +9 −1 opalib/opaEnv.ml
View
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -99,6 +99,8 @@ type package = Package.t
*)
let conftable : (filename, package) Hashtbl.t = Hashtbl.create 10
+let conf_opa_files_state = ref ([] : string list)
+
(*
Extra import specified in conf files
*)
@@ -231,6 +233,7 @@ let load_conf conffile =
#<End>
in
Hashtbl.add conftable filename (package_name, position) ;
+ conf_opa_files_state := filename :: (!conf_opa_files_state) ;
) filenames ;
List.iter (
fun import ->
@@ -269,6 +272,11 @@ let load_conf conffile =
in
let _ = File.lines_foldi_offset process_line None conffile in
()
+
+let conf_opa_files () = List.rev (!conf_opa_files_state)
+
+
+
(*------------------------------*)
(*---- command line options ----*)
(*------------------------------*)
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -117,6 +117,11 @@ val expand_glob :
val load_conf : filename -> unit
(**
+ [conf_opa_files ()] returns all opa file present the loaded conf files
+*)
+val conf_opa_files : unit -> filename list
+
+(**
[load filename content code]
check the validity of the 'Package' declarations from the code, and removes them
loads the dependency of the given code, and update the current package
View
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -480,6 +480,14 @@ struct
("--constant-sharing-client", Arg.Set constant_sharing, " Activate the constant sharing pass on javascript code");
("--no-constant-sharing", Arg.Clear constant_sharing, " Deactivate the constant sharing pass");
("--no-constant-sharing-client", Arg.Clear constant_sharing, " Deactivate the constant sharing pass on javascript code");
+
+
+ ("--conf-opa-files",
+ Arg.Unit (fun () -> List.iter add_any_file (ObjectFiles.conf_opa_files ())),
+ "Use conf content to determine opa files"
+ );
+
+
("--dump-dbgen-schema", Arg.Set dump_dbgen_schema, " Dump the inferred dbgen schema (to files %.dot and %.png)");
("--extra-lib", Arg.String add_full_extra_lib, "\"*.cm*,*.js,...\" Add lib(s) to link the generated server");
("--extra-path", Arg.String add_full_extra_path, "\"dir,...\" Add path(s) to link the generated server");

0 comments on commit 0bc807e

Please sign in to comment.