diff --git a/module3/exo3/Tools.jl b/module3/exo3/Tools.jl new file mode 100644 index 0000000000000000000000000000000000000000..c507a3ab7b887a0ff34183a9daf171585aed08fe --- /dev/null +++ b/module3/exo3/Tools.jl @@ -0,0 +1,25 @@ +cd(@__DIR__) + +module Tools + +function run_julia(args...) + cd(@__DIR__) + julia = Base.julia_cmd()[1] + run(`$julia --color=yes --startup-file=no --project $args`) + nothing +end + +setup() = run_julia("setup.jl") + +compile() = run_julia("compile.jl") + +function weave() + cd(@__DIR__) + + opts = String[] + isfile("Exercice.so") && push!(opts, "-JExercice.so") + + run_julia(opts..., "make.jl") +end + +end diff --git a/module3/exo3/utils.jl b/module3/exo3/utils.jl index b998954c6819b4ffc770d9f1bfdf9a2475cc89c9..5f222946fe3bca4f3c7e35719bb87a6d97d48e6b 100644 --- a/module3/exo3/utils.jl +++ b/module3/exo3/utils.jl @@ -93,28 +93,3 @@ function disp() m.captures[1] end |> print end - - -module Exercice - -function run_julia(args...) - cd(@__DIR__) - julia = Base.julia_cmd()[1] - run(`$julia --color=yes --startup-file=no --project $args`) - nothing -end - -setup() = run_julia("setup.jl") - -compile() = run_julia("compile.jl") - -function weave() - cd(@__DIR__) - - opts = String[] - isfile("Exercice.so") && push!(opts, "-JExercice.so") - - run_julia(opts..., "make.jl") -end - -end