diff --git a/doc/Makefile b/doc/Makefile index 05819848..2b53edb8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -14,34 +14,23 @@ PIP_INSTALL ?= pip3 install --user help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help pip3 npm Makefile doxygen-c doxygen-java - -doxygen-c: - cd ../ && doxygen doc/doxygen-c.conf - -doxygen-java: - cd ../ && doxygen doc/doxygen-java.conf - -doxygen-dotnet: - cd ../ && doxygen doc/doxygen-dotnet.conf +.PHONY: help pip3 Makefile pip3: $(PIP_INSTALL) -r ../taskcluster/docs-requirements.txt -npm: - npm install typedoc@0.17.4 typescript@3.8.3 @types/node@13.9.x - submodule: git submodule update --init --remote # Add submodule update dependency to Sphinx's "html" target -html: Makefile submodule pip3 npm doxygen-c doxygen-java doxygen-dotnet - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +html: Makefile submodule pip3 + @PATH=$$HOME/.local/bin:`pwd`/../node_modules/.bin/:$$PATH \ + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) dist: html cd $(BUILDDIR)/html/ && zip -r9 ../../html.zip * # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile pip3 npm doxygen-c doxygen-java doxygen-dotnet +%: Makefile pip3 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/conf.py b/doc/conf.py index b95d4c96..bb64d77e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,13 +26,14 @@ sys.path.insert(0, os.path.abspath('../')) autodoc_mock_imports = ['deepspeech'] -read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' -if read_the_docs_build: - import subprocess - subprocess.call('cd ../ && npm install typedoc@0.17.4 typescript@3.8.3 @types/node@13.9.x', shell=True) - subprocess.call('cd ../ && doxygen doc/doxygen-c.conf', shell=True) - subprocess.call('cd ../ && doxygen doc/doxygen-java.conf', shell=True) - subprocess.call('cd ../ && doxygen doc/doxygen-dotnet.conf', shell=True) +# This is in fact only relevant on ReadTheDocs, but we want to run the same way +# on our CI as in RTD to avoid regressions on RTD that we would not catch on +# TaskCluster +import subprocess +subprocess.check_call('cd ../ && npm install typedoc@0.17.4 typescript@3.8.3 @types/node@13.9.x', shell=True) +subprocess.check_call('cd ../ && doxygen doc/doxygen-c.conf', shell=True) +subprocess.check_call('cd ../ && doxygen doc/doxygen-java.conf', shell=True) +subprocess.check_call('cd ../ && doxygen doc/doxygen-dotnet.conf', shell=True) # -- General configuration ------------------------------------------------ diff --git a/taskcluster/docs-build.sh b/taskcluster/docs-build.sh index 27d207c9..04ed8a85 100644 --- a/taskcluster/docs-build.sh +++ b/taskcluster/docs-build.sh @@ -5,6 +5,5 @@ set -xe THIS=$(dirname "$0") pushd ${THIS}/../ - export PATH=$HOME/.local/bin:${THIS}/../doc/node_modules/.bin/:$PATH make -C doc/ dist popd