@@ -36,6 +36,34 @@ function download_nightly()
36
36
return julia_exec, commit
37
37
end
38
38
39
+ function makedocs (julia_exec)
40
+ @sync begin
41
+ builder = @async begin
42
+ withenv (" TRAVIS_REPO_SLUG" => nothing , # workaround Documenter bugs and julia#26314
43
+ " BUILDROOT" => nothing ) do
44
+ run (` make -C $(JULIA_SOURCE) /doc pdf texplatform=docker JULIA_EXECUTABLE=$(julia_exec) ` )
45
+ end
46
+ end
47
+ @async begin
48
+ while ! istaskdone (builder)
49
+ sleep (60 )
50
+ @info " building pdf ..."
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ function copydocs (path)
57
+ output = " $(JULIA_SOURCE) /doc/_build/pdf/en"
58
+ for f in readdir (output)
59
+ if startswith (f, " TheJuliaLanguage" ) && endswith (f, " .pdf" )
60
+ cp (" $(output) /$(f) " , path; force= true )
61
+ @info " finished, output file copied to $(path) ."
62
+ break
63
+ end
64
+ end
65
+ end
66
+
39
67
function build_release_pdf (v:: VersionNumber )
40
68
x, y, z = v. major, v. minor, v. patch
41
69
@info " building PDF for Julia v$(x) .$(y) .$(z) ."
@@ -53,24 +81,15 @@ function build_release_pdf(v::VersionNumber)
53
81
@info " downloading release tarball."
54
82
julia_exec = download_release (v)
55
83
56
- # checkout relevant tag and build the PDF
84
+ # checkout relevant tag and clean repo
57
85
run (` git -C $(JULIA_SOURCE) checkout v$(x) .$(y) .$(z) ` )
58
86
run (` git -C $(JULIA_SOURCE) clean -fdx` )
59
- withenv (" DOCUMENTER_VERBOSE" => " true" ,
60
- " TRAVIS_REPO_SLUG" => nothing , # workaround Documenter bugs and julia#26314
61
- " BUILDROOT" => nothing ) do
62
- run (` make -C $(JULIA_SOURCE) /doc pdf texplatform=docker JULIA_EXECUTABLE=$(julia_exec) ` )
63
- end
87
+
88
+ # invoke makedocs
89
+ makedocs (julia_exec)
64
90
65
91
# copy built PDF to JULIA_DOCS
66
- output = " $(JULIA_SOURCE) /doc/_build/pdf/en"
67
- for f in readdir (output)
68
- if startswith (f, " TheJuliaLanguage" ) && endswith (f, " .pdf" )
69
- cp (" $(output) /$(f) " , path)
70
- @info " finished, output file copied to $(path) ."
71
- break
72
- end
73
- end
92
+ copydocs (path)
74
93
end
75
94
76
95
function build_nightly_pdf ()
@@ -79,25 +98,19 @@ function build_nightly_pdf()
79
98
# output is "julia version 1.1.0-DEV"
80
99
_, _, v = split (readchomp (` $(julia_exec) --version` ))
81
100
@info " commit determined to $(commit) and version determined to $(v) ."
101
+
82
102
file = " julia-$(v) .pdf"
83
103
path = " $JULIA_DOCS /$file "
104
+
105
+ # checkout correct commit and clean repo
84
106
run (` git -C $(JULIA_SOURCE) checkout $(commit) ` )
85
107
run (` git -C $(JULIA_SOURCE) clean -fdx` )
86
- withenv (" DOCUMENTER_VERBOSE" => " true" ,
87
- " TRAVIS_REPO_SLUG" => nothing , # workaround Documenter bugs and julia#26314
88
- " BUILDROOT" => nothing ) do
89
- run (` make -C $(JULIA_SOURCE) /doc pdf texplatform=docker JULIA_EXECUTABLE=$(julia_exec) ` )
90
- end
108
+
109
+ # invoke makedocs
110
+ makedocs (julia_exec)
91
111
92
112
# copy the built PDF to JULIA_DOCS
93
- output = " $(JULIA_SOURCE) /doc/_build/pdf/en"
94
- for f in readdir (output)
95
- if startswith (f, " TheJuliaLanguage" ) && endswith (f, " .pdf" )
96
- cp (" $(output) /$(f) " , path)
97
- @info " finished, output file copied to $(path) ."
98
- break
99
- end
100
- end
113
+ copydocs (path)
101
114
end
102
115
103
116
# find all tags in the julia repo
0 commit comments