Skip to content

Commit

Permalink
Expect odoc to generate highlight.pack.js (#1557)
Browse files Browse the repository at this point in the history
See #1556.

Signed-off-by: Anton Bachin <antonbachin@yahoo.com>
  • Loading branch information
aantron authored Nov 20, 2018
1 parent 19893f7 commit f3caaaa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ next

- Add a `--stats` command line option to record resource usage (#1543, @diml)

- Fix `dune build @doc` deleting `highlight.pack.js` on rebuilds, after the
first build (#1557, @aantron).

1.5.1 (7/11/2018)
-----------------

Expand Down
1 change: 1 addition & 0 deletions dune.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build: [
]
conflicts: [
"jbuilder" {!= "transition"}
"odoc" {< "1.3.0"}
]

synopsis: "Fast, portable and opinionated build system"
Expand Down
7 changes: 4 additions & 3 deletions src/odoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ module Gen (S : sig val sctx : SC.t end) = struct
:: dune_keep))

let css_file = Paths.html_root ++ "odoc.css"
let highlight_pack_js = Paths.html_root ++ "highlight.pack.js"

let toplevel_index = Paths.html_root ++ "index.html"

Expand Down Expand Up @@ -220,8 +221,8 @@ module Gen (S : sig val sctx : SC.t end) = struct
(Build.run
~dir:context.build_dir
(Lazy.force odoc)
[ A "css"; A "-o"; Path Paths.html_root
; Hidden_targets [css_file]
[ A "support-files"; A "-o"; Path Paths.html_root
; Hidden_targets [css_file; highlight_pack_js]
])

let sp = Printf.sprintf
Expand Down Expand Up @@ -305,7 +306,7 @@ module Gen (S : sig val sctx : SC.t end) = struct
; source = Mld
}

let static_html = [ css_file; toplevel_index ]
let static_html = [ css_file; highlight_pack_js; toplevel_index ]

let odocs =
let odoc_glob =
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/multiple-private-libs/run.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This test checks that there is no clash when two private libraries have the same name

$ dune build --display short @doc-private
odoc _doc/_html/odoc.css
odoc _doc/_html/highlight.pack.js,_doc/_html/odoc.css
ocamldep a/.test.objs/test.ml.d
ocamlc a/.test.objs/test.{cmi,cmo,cmt}
odoc _doc/_odoc/lib/test@a/test.odoc
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/odoc-unique-mlds/run.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Duplicate mld's in the same scope
$ dune build @doc --display short --root ./same-scope
Entering directory 'same-scope'
odoc _doc/_html/odoc.css
odoc _doc/_html/highlight.pack.js,_doc/_html/odoc.css
ocamlc lib1/.root_lib1.objs/root_lib1.{cmi,cmo,cmt}
odoc _doc/_odoc/lib/root.lib1/root_lib1.odoc
ocamlc lib2/.root_lib2.objs/root_lib2.{cmi,cmo,cmt}
Expand All @@ -15,7 +15,7 @@ Duplicate mld's in different scope
$ rm -rf diff-scope/_build
$ dune build @doc --display short --root ./diff-scope
Entering directory 'diff-scope'
odoc _doc/_html/odoc.css
odoc _doc/_html/highlight.pack.js,_doc/_html/odoc.css
ocamlc scope1/.scope1.objs/scope1.{cmi,cmo,cmt}
odoc _doc/_odoc/lib/scope1/scope1.odoc
odoc _doc/_html/scope1/Scope1/.dune-keep,_doc/_html/scope1/Scope1/index.html
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/odoc/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
odoc _doc/_html/bar/Bar/.dune-keep,_doc/_html/bar/Bar/index.html
odoc _doc/_odoc/pkg/bar/page-index.odoc
odoc _doc/_html/bar/index.html
odoc _doc/_html/odoc.css
odoc _doc/_html/highlight.pack.js,_doc/_html/odoc.css
ocamldep .foo_byte.objs/foo_byte.ml.d
ocamlc .foo_byte.objs/foo_byte.{cmi,cmo,cmt}
odoc _doc/_odoc/lib/foo.byte/foo_byte.odoc
Expand Down

0 comments on commit f3caaaa

Please sign in to comment.