From 5b4d0d3632435f7bc498392c56fe130177aaf522 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 26 Oct 2018 01:03:26 +0200 Subject: [PATCH] Fix out-of-tree build of docs, fix #29757. (#29760) (cherry picked from commit ffaf849f36b9fd4f1c63b6fed4c56aca8a3f06af) --- doc/Makefile | 2 +- doc/make.jl | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 89b79880d1277..3d0773342fc1d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -20,7 +20,7 @@ help: @echo "To fix outdated doctests, use 'make doctest=fix'" -DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) +DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) buildroot=$(call cygpath_w,$(BUILDROOT)) UnicodeData.txt: $(JLDOWNLOAD) http://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt diff --git a/doc/make.jl b/doc/make.jl index 6b99bb030fcb0..f58c7a80b9a25 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -147,8 +147,12 @@ for stdlib in STDLIB_DOCS end const render_pdf = "pdf" in ARGS +let r = r"buildroot=(.+)", i = findfirst(x -> occursin(r, x), ARGS) + global const buildroot = i === nothing ? (@__DIR__) : first(match(r, ARGS[i]).captures) +end + makedocs( - build = joinpath(@__DIR__, "_build", (render_pdf ? "pdf" : "html"), "en"), + build = joinpath(buildroot, "doc", "_build", (render_pdf ? "pdf" : "html"), "en"), modules = [Base, Core, BuildSysImg, [Base.root_module(Base, stdlib.stdlib) for stdlib in STDLIB_DOCS]...], clean = true, doctest = ("doctest=fix" in ARGS) ? (:fix) : ("doctest=true" in ARGS) ? true : false, @@ -171,7 +175,7 @@ makedocs( if "deploy" in ARGS && Sys.ARCH === :x86_64 && Sys.KERNEL === :Linux deploydocs( repo = "github.com/JuliaLang/julia.git", - target = "_build/html/en", + target = joinpath(buildroot, "doc", "_build", "html", "en"), dirname = "en", devurl = "v1.1-dev", versions = ["v#.#", "v1.1-dev" => "v1.1-dev"]