Skip to content

Commit

Permalink
Update dependencies and upgrade code
Browse files Browse the repository at this point in the history
 * ocaml 4.09
 * Janestreet libs to 0.13.0
  • Loading branch information
jnavila committed May 31, 2020
1 parent 24b82ba commit 1e57774
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
4 changes: 1 addition & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion plotkicadsch.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion plotkicadsch/src/gitFs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions plotkicadsch/src/kicadDiff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plotkicadsch/src/plotgitsch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion plotkicadsch/src/trueFs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 1e57774

Please sign in to comment.