This is an automated email from the git hooks/post-receive script. glondu pushed a commit to branch master in repository jbuilder.
commit 9b859742648829ab2c8f211d6583ad98511a0a03 Author: Stephane Glondu <st...@glondu.net> Date: Thu Oct 12 10:15:29 2017 +0200 New upstream version 1.0~beta13 --- CHANGES.md | 9 +++++++++ appveyor.yml | 4 ++-- bin/main.ml | 6 +++--- install_ocaml.cmd | 36 ++++++++++++++++++++++++++++++++++++ jbuilder.opam | 2 +- src/gen_rules.ml | 26 +++++++++++++++++++++++++- src/odoc.ml | 43 ++++++++++++++++++++++++++++++++++++++++++- src/odoc.mli | 2 ++ src/ordered_set_lang.ml | 5 ++++- src/path.ml | 4 ++++ src/path.mli | 3 +++ 11 files changed, 131 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 80c7437..bd6fb55 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +1.0+beta13 (05/09/2017) +----------------------- + +- Generate toplevel html index for documentation (#224, Thomas Gazagnaire) + +- Fix recompilation of native artifacts. Regression introduced in the last + version (1.0+beta12) when digests replaces timestamps for checking staleness + (#238, David Allsopp) + 1.0+beta12 (18/08/2017) ----------------------- diff --git a/appveyor.yml b/appveyor.yml index 6cfc496..7830c5c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,8 @@ # AppVeyor config using https://github.com/Chris00/ocaml-appveyor install: - - appveyor DownloadFile "https://raw.githubusercontent.com/Chris00/ocaml-appveyor/master/install_ocaml.cmd" -FileName "C:\install_ocaml.cmd" - - C:\install_ocaml.cmd + - cd "%APPVEYOR_BUILD_FOLDER%" + - install_ocaml.cmd build_script: - cd "%APPVEYOR_BUILD_FOLDER%" diff --git a/bin/main.ml b/bin/main.ml index 87f4856..b48ab19 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -857,7 +857,7 @@ let subst = ; `P {|Substitute $(b,%%ID%%) strings in source files, in a similar fashion to what topkg does in the default configuration.|} ; `P {|This command is only meant to be called when a user pins a package to - its development version. Especially it replaces $(b,1.0+beta12) strings + its development version. Especially it replaces $(b,1.0+beta13) strings by the version obtained from the vcs. Currently only git is supported and the version is obtained from the output of:|} ; `Pre {| \$ git describe --always --dirty|} @@ -865,7 +865,7 @@ let subst = the defatult configuration:|} ; var "NAME" "the name of the package" ; var "VERSION" "output of $(b,git describe --always --dirty)" - ; var "VERSION_NUM" "same as $(b,1.0+beta12) but with a potential leading \ + ; var "VERSION_NUM" "same as $(b,1.0+beta13) but with a potential leading \ 'v' or 'V' dropped" ; var "VCS_COMMIT_ID" "commit hash from the vcs" ; opam "maintainer" @@ -953,7 +953,7 @@ let all = let default = let doc = "composable build system for OCaml" in ( Term.(ret (const (fun _ -> `Help (`Pager, None)) $ common)) - , Term.info "jbuilder" ~doc ~version:"1.0+beta12" + , Term.info "jbuilder" ~doc ~version:"1.0+beta13" ~man: [ `S "DESCRIPTION" ; `P {|Jbuilder is a build system designed for OCaml projects only. It diff --git a/install_ocaml.cmd b/install_ocaml.cmd new file mode 100644 index 0000000..372ec8e --- /dev/null +++ b/install_ocaml.cmd @@ -0,0 +1,36 @@ +REM Download and install OCaml and flexlink (unless it was already done). +REM Prepare the environment variables,... to use it. OCaml is installed +REM at %OCAMLROOT% +REM +REM If you are using Cygwin, install it in C:\cygwin first and then +REM execute this script. Execute bash with the option "-l". + +REM set OCAMLROOT=%PROGRAMFILES%/OCaml +set OCAMLROOT=C:/PROGRA~1/OCaml + +set OCAMLURL=https://github.com/Chris00/ocaml-appveyor/releases/download/0.1/ocaml-4.03.zip + +REM Cygwin is always installed on AppVeyor. Its path must come +REM before the one of Git but after those of MSCV and OCaml. +set Path=C:\cygwin\bin;%Path% + +call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 + +set Path=%OCAMLROOT%\bin;%OCAMLROOT%\bin\flexdll;%Path% +set CAML_LD_LIBRARY_PATH=%OCAMLROOT%/lib/stublibs + +set CYGWINBASH=C:\cygwin\bin\bash.exe + +if not exist "%OCAMLROOT%/bin/ocaml.exe" ( + echo Downloading OCaml... + appveyor DownloadFile "%OCAMLURL%" -FileName "C:\PROGRA~1\ocaml.zip" + %CYGWINBASH% -lc "cd /cygdrive/c/Program\ Files && unzip -q ocaml.zip" + del C:\PROGRA~1\ocaml.zip +) + +if exist %CYGWINBASH% ( + REM Make sure that "link" is the MSVC one and not the Cynwin one. + %CYGWINBASH% -lc "eval $(/cygdrive/c/Program\ Files/OCaml/tools/msvs-promote-path)"> ~/.bash_profile" +) + +set <NUL /p=Ready to use OCaml & ocamlc -version diff --git a/jbuilder.opam b/jbuilder.opam index 86d2cac..0db02df 100644 --- a/jbuilder.opam +++ b/jbuilder.opam @@ -1,4 +1,4 @@ -version: "1.0+beta12" +version: "1.0+beta13" opam-version: "1.2" maintainer: "opensou...@janestreet.com" authors: ["Jane Street Group, LLC <opensou...@janestreet.com>"] diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 699013c..022a63e 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -86,6 +86,12 @@ module Gen(P : Params) = struct else fun x -> x in + let objs (cm, _, _, _) = + if mode = Mode.Byte then + [] + else + List.map ~f:(Path.change_extension ~ext:ctx.ext_obj) cm + in SC.add_rule sctx (Build.fanout4 (dep_graph >>> @@ -100,6 +106,8 @@ module Gen(P : Params) = struct (Ocaml_flags.get flags mode) (SC.expand_and_eval_set sctx ~scope ~dir lib.library_flags ~standard:[]) >>> + Build.dyn_paths (Build.arr objs) + >>> Build.run ~context:ctx (Dep compiler) ~extra_targets:( match mode with @@ -376,6 +384,8 @@ module Gen(P : Params) = struct let src = lib_archive lib ~dir ~ext:(Mode.compiled_lib_ext Native) in let dst = lib_archive lib ~dir ~ext:".cmxs" in let build = + Build.dyn_paths (Build.arr (fun () -> [lib_archive lib ~dir ~ext:ctx.ext_lib])) + >>> Ocaml_flags.get flags Native >>> Build.run ~context:ctx @@ -440,8 +450,21 @@ module Gen(P : Params) = struct ~mode [String.capitalize_ascii name])) in + let objs (libs, cm) = + if mode = Mode.Byte then + [] + else + let libs = + let f = function + | Lib.Internal (dir, lib) -> Some (Path.relative dir (lib.name ^ ctx.ext_lib)) + | External _ -> None + in + List.filter_map ~f libs + in + libs @ List.map ~f:(Path.change_extension ~ext:ctx.ext_obj) cm + in SC.add_rule sctx - (libs_and_cm + ((libs_and_cm >>> Build.dyn_paths (Build.arr objs)) &&& Build.fanout (Ocaml_flags.get flags mode) @@ -726,6 +749,7 @@ Add it to your jbuild file to remove this warning. let () = SC.add_rules sctx (Js_of_ocaml_rules.setup_separate_compilation_rules sctx) let () = Odoc.setup_css_rule sctx + let () = Odoc.setup_toplevel_index_rule sctx (* +-----------------------------------------------------------------+ | META | diff --git a/src/odoc.ml b/src/odoc.ml index 6aa401c..7e4ef03 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -112,6 +112,8 @@ let doc_dir ~context = Path.relative context.Context.build_dir "_doc" let css_file ~doc_dir = doc_dir ++ "odoc.css" +let toplevel_index ~doc_dir = doc_dir ++ "index.html" + let setup_library_rules sctx (lib : Library.t) ~dir ~modules ~requires ~(dep_graph:Ocamldep.dep_graph) = Option.iter lib.public ~f:(fun public -> @@ -164,6 +166,7 @@ let setup_library_rules sctx (lib : Library.t) ~dir ~modules ~requires in Alias.add_deps (SC.aliases sctx) (Alias.doc ~dir) (css_file ~doc_dir + :: toplevel_index ~doc_dir :: lib_index_html :: html_files)) @@ -175,4 +178,42 @@ let setup_css_rule sctx = ~dir:context.build_dir ~extra_targets:[css_file ~doc_dir] (get_odoc sctx) - [ A "css"; A "-o"; Path doc_dir ]); + [ A "css"; A "-o"; Path doc_dir ]) + +let sp = Printf.sprintf + +let setup_toplevel_index_rule sctx = + let packages = + String_map.fold ~f:(fun ~key ~data pkgs -> + let name = sp {|<a href="%s/index.html">%s</a>|} key key in + let pkg = match data.Package.version_from_opam_file with + | None -> name + | Some v -> sp {|%s <span class="version">%s</span>|} name v + in + sp "<li>%s</li>" pkg :: pkgs + ) ~init:[] (SC.packages sctx) + |> List.rev + in + let packages = String.concat ~sep:"\n " packages in + let html = + sp {|<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>index</title> + <link rel="stylesheet" href="./odoc.css"/> + <meta charset="utf-8"/> + <meta name="viewport" content="width=device-width,initial-scale=1.0"/> + </head> + <body> + <div class="by-name"> + <h2>OCaml package documentation</h2> + <ol> + %s + </ol> + </body> + </html> +|} packages + in + let context = SC.context sctx in + let doc_dir = doc_dir ~context in + SC.add_rule sctx @@ Build.write_file (toplevel_index ~doc_dir) html diff --git a/src/odoc.mli b/src/odoc.mli index ec088f7..cbd8082 100644 --- a/src/odoc.mli +++ b/src/odoc.mli @@ -13,3 +13,5 @@ val setup_library_rules -> unit val setup_css_rule : Super_context.t -> unit + +val setup_toplevel_index_rule: Super_context.t -> unit diff --git a/src/ordered_set_lang.ml b/src/ordered_set_lang.ml index 415bc52..7a7797d 100644 --- a/src/ordered_set_lang.ml +++ b/src/ordered_set_lang.ml @@ -82,9 +82,12 @@ module Unexpanded = struct let open Ast in match t with | Element s -> Element s - | Special (l, s) -> Special (l, s) | Union [Special (_, "include"); Element fn] -> Include (Sexp.Of_sexp.string fn) + | Union [Special (loc, "include"); _] + | Special (loc, "include") -> + Loc.fail loc "(:include expects a single element (do you need to quote the filename?)" + | Special (l, s) -> Special (l, s) | Union l -> Union (List.map l ~f:map) | Diff (l, r) -> diff --git a/src/path.ml b/src/path.ml index 5e66310..a260a4c 100644 --- a/src/path.ml +++ b/src/path.ml @@ -411,3 +411,7 @@ let rm_rf = match Unix.lstat fn with | exception Unix.Unix_error(ENOENT, _, _) -> () | _ -> loop fn + +let change_extension ~ext t = + let t = try Filename.chop_extension t with Not_found -> t in + t ^ ext diff --git a/src/path.mli b/src/path.mli index e2a45fe..57bed82 100644 --- a/src/path.mli +++ b/src/path.mli @@ -101,3 +101,6 @@ val rmdir : t -> unit val unlink : t -> unit val unlink_no_err : t -> unit val rm_rf : t -> unit + +(** Changes the extension of the filename (or adds an extension if there was none) *) +val change_extension : ext:string -> t -> t -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/jbuilder.git _______________________________________________ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits