[odoc] fix doc generation, no need for public names

Summary:
All dune libraries in infer/src/ were declared with their own public
names, each one needing its own .opam file. There's no need for that:
they can all be part of the `infer` library by calling them `infer.Foo`.

One wrinkle: now we need to explicitly point at their .mld files in the
generated documentation.

Reviewed By: jberdine

Differential Revision: D20798914

fbshipit-source-id: 64b64261c
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent efc59b1cdf
commit c1818c0c1c

@ -851,7 +851,7 @@ doc: src_build_common
# do not call the browser if we are publishing the docs # do not call the browser if we are publishing the docs
ifeq ($(filter doc-publish,${MAKECMDGOALS}),) ifeq ($(filter doc-publish,${MAKECMDGOALS}),)
$(QUIET)$(call silent_on_success,Opening in browser,\ $(QUIET)$(call silent_on_success,Opening in browser,\
browse $(SRC_DIR)/_build/default/_doc/_html/index.html) browse $(INFER_DIR)/_build/default/_doc/_html/index.html)
$(QUIET)echo "Tip: you can generate the doc for all the opam dependencies of infer like this:" $(QUIET)echo "Tip: you can generate the doc for all the opam dependencies of infer like this:"
$(QUIET)echo $(QUIET)echo
$(QUIET)echo " odig odoc # takes a while, run it only when the dependencies change" $(QUIET)echo " odig odoc # takes a while, run it only when the dependencies change"

@ -2,4 +2,10 @@
; ;
; This source code is licensed under the MIT license found in the ; This source code is licensed under the MIT license found in the
; LICENSE file in the root directory of this source tree. ; LICENSE file in the root directory of this source tree.
(dirs src bin) (dirs src bin)
(documentation
(package infer)
(mld_files :standard)
)

@ -0,0 +1,7 @@
{1 Infer Libraries}
- {{:infer.html}infer}: most of the modules: capture, analysis, integrations, ...
- {{:IR.html}IR}: the intermediate language used by the analysis
- {{:base.html}base}: configuration and utilities
- {{:atd.html}atd}: auto-generated datatypes
- {{:istd.html}}: additions to the Core standard library

@ -50,7 +50,7 @@ Tips & Tricks:
{2 eradicate/ } {2 eradicate/ }
Eradicate [@Nullable] Checker Eradicate [@Nullable] Checker
Eradicate is a type checker for [@Nullable] annotations for Java. The goal is to eradicate null pointer exceptions. See the online docs at {:http://fbinfer.com/docs/eradicate.html}. Eradicate is a type checker for [@Nullable] annotations for Java. The goal is to eradicate null pointer exceptions. See the online docs at {:http://fbinfer.com/docs/eradicate}.
The main entry point is module {!module-InferModules.Eradicate}. The main entry point is module {!module-InferModules.Eradicate}.

@ -5,14 +5,10 @@
(library (library
(name InferIR) (name InferIR)
(public_name InferIR) (public_name infer.InferIR)
(flags (flags
(:standard -open Core -open InferStdlib -open IStd -open InferGenerated (:standard -open Core -open InferStdlib -open IStd -open InferGenerated
-open InferBase)) -open InferBase))
(libraries core zarith InferStdlib InferGenerated InferBase) (libraries core zarith InferStdlib InferGenerated InferBase)
(preprocess (preprocess
(pps ppx_compare))) (pps ppx_compare)))
(documentation
(package InferIR)
(mld_files index))

@ -95,7 +95,7 @@ test: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST)
.PHONY: doc .PHONY: doc
doc: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST) doc: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST)
$(QUIET)$(DUNE_BUILD) @doc $(QUIET)cd .. && $(DUNE_BUILD) @doc
.PHONY: check .PHONY: check
check: src_build_common check: src_build_common

@ -5,17 +5,13 @@
(library (library
(name InferGenerated) (name InferGenerated)
(public_name InferGenerated) (public_name infer.InferGenerated)
(flags (flags
(:standard -w -27-32-34-35-39)) (:standard -w -27-32-34-35-39))
(libraries atdgen core) (libraries atdgen core)
(preprocess (preprocess
(pps ppx_compare))) (pps ppx_compare)))
(documentation
(package InferGenerated)
(mld_files index))
; Rules below are boilerplatey, but this is benign and very easy to ; Rules below are boilerplatey, but this is benign and very easy to
; understand boilerplate. ; understand boilerplate.

@ -5,14 +5,10 @@
(library (library
(name InferBase) (name InferBase)
(public_name InferBase) (public_name infer.InferBase)
(flags (flags
(:standard -open Core -open InferStdlib -open IStd -open InferGenerated)) (:standard -open Core -open InferStdlib -open IStd -open InferGenerated))
(libraries cmdliner core mtime.clock.os parmap re sqlite3 zip InferGenerated (libraries cmdliner core mtime.clock.os parmap re sqlite3 zip InferGenerated
InferStdlib) InferStdlib)
(preprocess (preprocess
(pps ppx_compare ppx_enumerate))) (pps ppx_compare ppx_enumerate)))
(documentation
(package InferBase)
(mld_files index))

@ -1,24 +0,0 @@
(* -*- tuareg -*- *)
(*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
(* NOTE: prepend dune.common to this file! *)
;;
Format.sprintf
{|
(library
(name InferBase)
(public_name InferBase)
(flags (:standard -open Core -open InferStdlib -open IStd -open InferGenerated))
(libraries InferStdlib InferGenerated core)
(preprocess (pps ppx_compare ppx_enumerate)))
(documentation
(package InferBase)
(mld_files index))
|}
|> Jbuild_plugin.V1.send

@ -5,7 +5,7 @@
(library (library
(name InferCStubs) (name InferCStubs)
(public_name InferCStubs) (public_name infer.InferCStubs)
(foreign_stubs (foreign_stubs
(language c) (language c)
(names fnv64_hash))) (names fnv64_hash)))

@ -1,2 +0,0 @@
(lang dune 2.0)
(name CStubs)

@ -91,13 +91,6 @@ let main_lib_stanza =
(String.concat " " infer_binaries) (String.concat " " infer_binaries)
let docs_stanza = {|
(documentation
(package infer)
(mld_files index)
)
|}
let infer_exe_stanza = let infer_exe_stanza =
Format.sprintf Format.sprintf
{| {|
@ -150,8 +143,7 @@ let flatten_sources_stanzas =
(** The build stanzas to be passed to dune *) (** The build stanzas to be passed to dune *)
let stanzas = let stanzas =
env_stanza :: main_lib_stanza :: infer_exe_stanza :: infertop_stanza :: docs_stanza (env_stanza :: main_lib_stanza :: infer_exe_stanza :: infertop_stanza :: clang_lexer_stanzas)
:: clang_lexer_stanzas
@ topl_stanzas @ flatten_sources_stanzas @ topl_stanzas @ flatten_sources_stanzas

@ -5,13 +5,9 @@
(library (library
(name InferStdlib) (name InferStdlib)
(public_name InferStdlib) (public_name infer.InferStdlib)
(flags (flags
(:standard -open Core)) (:standard -open Core))
(libraries ANSITerminal core str yojson) (libraries ANSITerminal core str yojson)
(preprocess (preprocess
(pps ppx_compare))) (pps ppx_compare)))
(documentation
(package InferStdlib)
(mld_files index))

Loading…
Cancel
Save