forked from JuliaGraphics/QML.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunexamples.jl
38 lines (36 loc) · 1.29 KB
/
runexamples.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import QML
import LibGit2
withenv("JULIA_LOAD_PATH" => nothing, "JULIA_GR_PROVIDER" => "BinaryBuilder") do
mktempdir() do tmpd
cd(tmpd) do
examplesdir = mkdir("QmlJuliaExamples")
LibGit2.clone("https://github.com/barche/QmlJuliaExamples.git", examplesdir)
cd(examplesdir) do
for d in ["basic", "images", "opengl", "plots"]
cd(d) do
allowmakie = true
if get(ENV, "CI", "false") == "true" && (Sys.isapple() || Sys.iswindows())
allowmakie = false
filtered = filter(l -> !contains(l, "Makie"), collect(eachline("Project.toml")))
open("Project.toml", "w") do output
for l in filtered
println(output, l)
end
end
end
qmlpath = replace(dirname(dirname(pathof(QML))), "\\" => "/")
cxxpath = replace(dirname(dirname(pathof(QML.CxxWrap))), "\\" => "/")
updatecommand = """
using Pkg
Pkg.develop([PackageSpec(path="$qmlpath"), PackageSpec(path="$cxxpath")])
Pkg.precompile()
"""
run(`$(Base.julia_cmd()) --project -e "$updatecommand"`)
QML.runexamples(allowmakie)
end
end
end
end
println(pwd())
end
end