[website] code to publish current docs

Summary:
Fix `make doc-publish` and make it publish the documentation to
website/static/{man,doc}/next/.

Reviewed By: ngorogiannis

Differential Revision: D21552291

fbshipit-source-id: fb6d07cfc
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent bc22604830
commit 5f2eb41df8

@ -858,32 +858,22 @@ ifeq ($(filter doc-publish,${MAKECMDGOALS}),)
endif endif
.PHONY: doc-publish .PHONY: doc-publish
doc-publish: doc $(INFER_GROFF_MANUALS) doc-publish: $(INFER_GROFF_MANUALS)
ifeq ($(GHPAGES),no) $(QUIET)$(MKDIR_P) "$(WEBSITE_DIR)"/static/man/next "$(WEBSITE_DIR)"/static/odoc/next
$(QUIET)echo "$(TERM_ERROR)Please set GHPAGES to a checkout of the gh-pages branch of the GitHub repo of infer$(TERM_RESET)" >&2
$(QUIET)exit 1
endif
# sanity check to avoid cryptic error messages and potentially annoying side-effects
$(QUIET)if ! [ -d "$(GHPAGES)"/static/man ]; then \
echo "$(TERM_ERROR)ERROR: GHPAGES doesn't seem to point to a checkout of the gh-pages branch of the GitHub repo of infer:$(TERM_RESET)" >&2; \
echo "$(TERM_ERROR)ERROR: '$(GHPAGES)/static/man' not found or not a directory.$(TERM_RESET)" >&2; \
echo "$(TERM_ERROR)ERROR: Please fix this and try again.$(TERM_RESET)" >&2; \
exit 1; \
fi
$(QUIET)$(call silent_on_success,Copying man pages,\ $(QUIET)$(call silent_on_success,Copying man pages,\
$(REMOVE_DIR) "$(GHPAGES)"/static/man/*; \ $(REMOVE) "$(WEBSITE_DIR)"/static/man/*; \
for man in $(INFER_GROFF_MANUALS); do \ for man in $(INFER_GROFF_MANUALS); do \
groff -Thtml "$$man" > "$(GHPAGES)"/static/man/$$(basename "$$man").html; \ groff -Thtml "$$man" > "$(WEBSITE_DIR)"/static/man/next/$$(basename "$$man").html; \
done) done)
ifeq ($(IS_FACEBOOK_TREE),no) ifeq ($(IS_FACEBOOK_TREE),yes)
$(QUIET)$(call silent_on_success,Copying OCaml modules documentation,\ $(QUIET)$(call silent_on_success,Cleaning up FB-only files,\
version=$$($(INFER_BIN) --version | head -1 | cut -d ' ' -f 3 | cut -c 2-); \ $(MAKE) -C $(SRC_DIR) clean; \
rsync -a --delete $(SRC_DIR)/_build/default/_doc/_html/ "$(GHPAGES)"/static/odoc/"$$version"; \ $(MAKE) -C facebook clean)
$(REMOVE) "$(GHPAGES)"/static/odoc/latest; \
$(LN_S) "$$version" "$(GHPAGES)"/static/odoc/latest)
else
$(QUIET)echo "Not an open-source tree, skipping the API docs generation"
endif endif
$(QUIET)$(call silent_on_success,Building OCaml modules documentation,\
$(MAKE) IS_FACEBOOK_TREE=no doc)
$(QUIET)$(call silent_on_success,Copying OCaml modules documentation,\
rsync -a --delete $(BUILD_DIR)/default/_doc/_html/ "$(WEBSITE_DIR)"/static/odoc/next/)
# print list of targets # print list of targets
.PHONY: show-targets .PHONY: show-targets

@ -30,6 +30,7 @@ INFER_DIR = $(ABSOLUTE_ROOT_DIR)/infer
FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins
M4_DIR = $(ABSOLUTE_ROOT_DIR)/m4 M4_DIR = $(ABSOLUTE_ROOT_DIR)/m4
SCRIPT_DIR = $(ABSOLUTE_ROOT_DIR)/scripts SCRIPT_DIR = $(ABSOLUTE_ROOT_DIR)/scripts
WEBSITE_DIR = $(ABSOLUTE_ROOT_DIR)/website
FCP_CLANG_OCAML_DIR = $(FCP_DIR)/clang-ocaml FCP_CLANG_OCAML_DIR = $(FCP_DIR)/clang-ocaml

Loading…
Cancel
Save