[generators][modules] use module xml filename without path in dependencies

This commit is contained in:
Felix Ruess
2014-12-08 10:59:05 +01:00
parent 8be5c426b6
commit 884b1f68c1
3 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -24,7 +24,7 @@
open Printf
type module_conf = { xml : Xml.xml; file : string; vpath : string option; param : Xml.xml list; extra_targets : string list; }
type module_conf = { xml : Xml.xml; file : string; filename : string; vpath : string option; param : Xml.xml list; extra_targets : string list; }
let (//) = Filename.concat
@@ -98,9 +98,10 @@ let rec get_modules_of_airframe = fun xml ->
let dir = if Filename.is_relative dir then Env.paparazzi_home // dir else "" in
(dir, Some dir)
with _ -> (modules_dir, None) in
let file = dir // ExtXml.attrib m "name" in
let filename = ExtXml.attrib m "name" in
let file = dir // filename in
let targets = singletonize (t @ targets_of_field m "") in
{ xml = ExtXml.parse_file file; file = file; vpath = vpath; param = Xml.children m; extra_targets = targets }
{ xml = ExtXml.parse_file file; file = file; filename = filename; vpath = vpath; param = Xml.children m; extra_targets = targets }
in
let modules_list = List.map (fun m ->
if compare (Xml.tag m) "load" <> 0 then Xml2h.xml_error "load";
+3 -2
View File
@@ -24,12 +24,13 @@
(* Module configuration:
* Xml node
* file name
* file (with path)
* file name only
* optional vpath
* parameters
* extrat targets
*)
type module_conf = { xml : Xml.xml; file : string; vpath : string option; param : Xml.xml list; extra_targets : string list; }
type module_conf = { xml : Xml.xml; file : string; filename : string; vpath : string option; param : Xml.xml list; extra_targets : string list; }
(* Modules directory *)
val modules_dir : string
+1 -1
View File
@@ -399,7 +399,7 @@ let () =
(* Extract modules names (file name and module name) *)
let modules_name =
(List.map (fun m -> try Xml.attrib m.GC.xml "name" with _ -> "") modules) @
(List.map (fun m -> m.GC.file) modules) in
(List.map (fun m -> m.GC.filename) modules) in
(* Extract xml modules nodes *)
let modules_list = List.map (fun m -> m.GC.xml) modules in
check_dependencies modules_list modules_name;