Skip to content

Commit

Permalink
new_includer_file
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 16, 2020
1 parent 7ddcc2d commit d2fb8dc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/bot/precompile_include.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,27 @@ function precompile_pather_multios(package_name::String)
end
################################################################
"""
create_includer_file(package_path::String, precompile_path::String)
new_includer_file(package_path::String, precompile_path::String)
Creates a "precompile_includer.jl" file if it doesn't exist.
create_includer_file(package_path, precompile_path)
"""
function create_includer_file(package_path::String, precompile_path::String)
function new_includer_file(package_path::String, precompile_path::String, overwrite::Bool)
includer_file = joinpath(dirname(package_path), "precompile_includer.jl")
if isfile(includer_file)
if isfile(includer_file) && !overwrite
@info "$includer_file already exists"
return nothing
else
@info "$includer_file file will be created"
@info """$includer_file file will be $(!overwrite ? "created" : "overwritten")"""
enclusure = """
# precompile_enclusre (don't edit the following!)
should_precompile = true
ismultios = false
@static if should_precompile
@static if !ismultios
include($precompile_path)
end
end # precompile_enclusure
_precompile_()
"""
Base.write(includer_file, enclusure)
end
Expand Down

0 comments on commit d2fb8dc

Please sign in to comment.