output_type: T.output_kind;
input_ext: string;
remove_lines: int;
+ excludes: string list;
includes: (string * string) list;
coercions: (string * string) list;
files: string list;
let set_files st =
let eof ich = try Some (input_line ich) with End_of_file -> None in
let trim l = Filename.chop_extension (Str.string_after l 2) in
- let cmd = Printf.sprintf "cd %s && find -name *%s" st.input_path st.input_ext in
+ let cmd = Printf.sprintf "cd %s && find -name '*%s'" st.input_path st.input_ext in
let ich = Unix.open_process_in cmd in
- let rec aux files =
- match eof ich with
- | None -> List.rev files
- | Some l -> aux (trim l :: files)
+ let rec aux files = match eof ich with
+ | None -> List.rev files
+ | Some l ->
+ let l = trim l in
+ if List.mem l st.excludes then aux files else aux (l :: files)
in
let files = aux [] in
let _ = Unix.close_process_in ich in
in
load_registry registry;
let input_type, input_ext = get_input_type "package.input_type" in
+ let excludes = match input_type with
+ | T.Grafite -> ["theory"]
+ | T.Gallina8 -> []
+ in
let st = {
heading_path = R.get_string "transcript.heading_path";
heading_lines = R.get_int "transcript.heading_lines";
output_type = get_output_type "package.output_type";
input_ext = input_ext;
remove_lines = R.get_int "package.heading_lines";
+ excludes = excludes;
includes = get_pairs "package.include";
coercions = get_pairs "package.coercion";
files = [];