Skip to content

Commit

Permalink
Read version number from Project.toml during precompilation, fixes ds…
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Feb 20, 2023
1 parent a0032b5 commit ee18341
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Tulip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ using TOML

using TimerOutputs

const _TULIP_VERSION = Ref{VersionNumber}()

function __init__()
# Read Tulip version from Project.toml file
tlp_ver = VersionNumber(TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])
_TULIP_VERSION[] = tlp_ver
# Read Tulip version from Project.toml file
const TULIP_VERSION = let project = joinpath(@__DIR__, "..", "Project.toml")
Base.include_dependency(project)
VersionNumber(TOML.parsefile(project)["version"])
end

version() = _TULIP_VERSION[]
version() = TULIP_VERSION

include("utils.jl")

Expand Down

0 comments on commit ee18341

Please sign in to comment.