Skip to content

Commit

Permalink
Improve generator script a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcom committed Jul 5, 2023
1 parent 1386bf4 commit 7508430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gen/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Clang
using Clang.Generators
using ViennaRNA_jll

pkgver(mod::Module) = Pkg.TOML.parsefile(joinpath(pkgdir(mod), "Project.toml"))["version"]
pkgver(mod::Module) = VersionNumber(Pkg.TOML.parsefile(joinpath(pkgdir(mod), "Project.toml"))["version"])
# this version can only deal with dependencies from the top active
# environment, but not ones stacked below
#pkgver(name) = filter(p -> p.name == name, collect(values(Pkg.dependencies()))) |> only |> p -> p.version
Expand All @@ -27,11 +27,14 @@ version_ViennaRNA_jll = pkgver(ViennaRNA_jll)
println("Clang version = $version_Clang")
println("ViennaRNA_jll version = $version_ViennaRNA_jll")
open("./prologue.jl", "w") do io
println(io, "#### begin prologue.jl")
println(io, "# this file was autogenerated by gen/generator.jl")
println(io)
println(io, "# package versions used to generate this file")
println(io, "const VERSION_GEN_Clang = v\"", version_Clang, "\"")
println(io, "const VERSION_GEN_ViennaRNA_jll = v\"", version_ViennaRNA_jll, "\"")
println(io, "const VERSION_GEN_Clang = $(repr(version_Clang))")
println(io, "const VERSION_GEN_ViennaRNA_jll = $(repr(version_ViennaRNA_jll))")
println(io)
println(io, "#### end prologue.jl")
end

include_dir = normpath(ViennaRNA_jll.artifact_dir, "include")
Expand Down
3 changes: 3 additions & 0 deletions lib/LibRNA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ export ViennaRNA_jll

using CEnum

#### begin prologue.jl
# this file was autogenerated by gen/generator.jl

# package versions used to generate this file
const VERSION_GEN_Clang = v"0.17.6"
const VERSION_GEN_ViennaRNA_jll = v"2.6.2+0"

#### end prologue.jl


"""
vrna_md_s
Expand Down

0 comments on commit 7508430

Please sign in to comment.