diff --git a/.appveyor.yml b/.appveyor.yml index 141f2e1..fcef6d2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,9 +14,7 @@ install: build_script: - call %CYG_ROOT%\bin\bash.exe -l %APPVEYOR_BUILD_FOLDER%\appveyor-opam.sh - - call %CYG_ROOT%\bin\bash.exe -l -c 'opam pin 'opam pin add kicadsch.dev --kind=path . -n' - - call %CYG_ROOT%\bin\bash.exe -l -c 'opam pin 'opam pin add plotkicadsch.dev --kind=path . -n' - - call %CYG_ROOT%\bin\bash.exe -l -c 'opam install plotkicadsch.dev' + - call %CYG_ROOT%\bin\bash.exe -l -c 'opam install plotkicadsch' - mv %CYG_ROOT%\home\appveyor\.opam %APPVEYOR_BUILD_FOLDER%\opam artifacts: diff --git a/plotkicadsch.opam b/plotkicadsch.opam index 6e7cf6e..4451990 100644 --- a/plotkicadsch.opam +++ b/plotkicadsch.opam @@ -17,7 +17,7 @@ build: [ [ "dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>="4.07"} + "ocaml" {>="4.09"} "dune" {>= "1.0"} "kicadsch" {= version} "tyxml" {>= "4.0.0"} diff --git a/plotkicadsch/src/gitFs.ml b/plotkicadsch/src/gitFs.ml index 1c53c24..d2dd2eb 100644 --- a/plotkicadsch/src/gitFs.ml +++ b/plotkicadsch/src/gitFs.ml @@ -86,7 +86,7 @@ let make commitish = let find_dir_local t = let file_list = Store.Value.Tree.to_list t in - List.filter ~f:(fun entry -> entry.perm = `Dir) file_list + List.filter ~f:(fun entry -> let open Core_kernel.Poly in entry.perm = `Dir) file_list let rec recurse_dir ?dirname node pattern = let rename name = match dirname with diff --git a/plotkicadsch/src/kicadDiff.ml b/plotkicadsch/src/kicadDiff.ml index 2b0b3ab..744f37c 100644 --- a/plotkicadsch/src/kicadDiff.ml +++ b/plotkicadsch/src/kicadDiff.ml @@ -18,18 +18,6 @@ let fs_mod = function | GitFS r -> GitFs.make r | TrueFS r -> TrueFs.make r -let ends_with e s = - let ls = String.length s in - let le = String.length e in - if ls < le then false - else - let rec loop s e i = - if i = le then true - else if s.[ls - le + i] <> e.[i] then false - else loop s e (i + 1) - in - loop s e 0 - module L = Kicadsch.MakeSchPainter (ListPainter.L) module LP = struct @@ -45,7 +33,7 @@ module FSPainter (S : SchPainter) (F : Simple_FS) : sig val context_from : S.schContext Lwt.t -> S.schContext Lwt.t end = struct - let find_schematics () = F.list_files (ends_with ".sch") + let find_schematics () = F.list_files (String.is_suffix ~suffix:".sch") let process_file initctx filename = let parse c l = S.parse_line l c in @@ -57,7 +45,7 @@ end = struct S.output_context endctx let find_libs () = - F.list_files (ends_with "-cache.lib") >|= List.map ~f:(fun (n, _) -> n) + F.list_files (String.is_suffix ~suffix:"-cache.lib") >|= List.map ~f:fst let read_libs initial_ctx lib_list = Lwt_list.fold_left_s diff --git a/plotkicadsch/src/plotgitsch.ml b/plotkicadsch/src/plotgitsch.ml index e1dc9d5..2925e85 100644 --- a/plotkicadsch/src/plotgitsch.ml +++ b/plotkicadsch/src/plotgitsch.ml @@ -7,7 +7,7 @@ let pp_fs out fs = Format.fprintf out "%s" (doc fs) let get_fs s = - if String.length s > 4 && String.sub s ~pos:0 ~len:4 = "dir:" then + if String.length s > 4 && String.equal (String.sub s ~pos:0 ~len:4) "dir:" then true_fs (String.sub s ~pos:4 ~len:(String.length s - 4)) else git_fs s diff --git a/plotkicadsch/src/trueFs.ml b/plotkicadsch/src/trueFs.ml index e35009e..1a53ebc 100644 --- a/plotkicadsch/src/trueFs.ml +++ b/plotkicadsch/src/trueFs.ml @@ -7,7 +7,7 @@ let make rootname = let label = TrueFS rootname - let rootname = String.lstrip ~drop:(fun c -> c = '/') rootname + let rootname = String.lstrip ~drop:(Char.equal '/') rootname let rootlength = (String.length rootname) + 1 let get_content filename =