diff --git a/Artifacts.toml b/Artifacts.toml new file mode 100644 index 0000000..538f6ae --- /dev/null +++ b/Artifacts.toml @@ -0,0 +1,2 @@ +[htmlnames] +git-tree-sha1 = "813db2bcdc4c5c4cc1cdbd6583e6c6bd7eaca024" diff --git a/Project.toml b/Project.toml index 49d72cd..8a32cf1 100644 --- a/Project.toml +++ b/Project.toml @@ -4,16 +4,18 @@ keywords = ["Entities", "HTML"] license = "MIT" desc = "Entities from HTML data tables" authors = ["ScottPJones "] -version = "1.0.2" +version = "1.0.3" [deps] +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00" StrTables = "9700d1a9-a7c8-5760-9816-a99fda30bb8f" [compat] +Artifacts = "1" RelocatableFolders = "1" StrTables = "1" -julia = "1" +julia = "1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/deps/build.jl b/deps/build.jl index 8fe0bbd..52d0b35 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -4,6 +4,8 @@ println("Running HTML entity build in ", pwd()) +using Artifacts +using Base.Filesystem using StrTables VER = UInt32(1) @@ -99,3 +101,13 @@ else println(sprint(showerror, ex, catch_backtrace())) end end + +if isfile(savfile) + artifact_toml = joinpath(@__DIR__, "..", "Artifacts.toml") + hash = artifact_hash("htmlnames", artifact_toml) + path = artifact_path(hash) + isdir(path) || mkpath(path) + cp(savfile, joinpath(path, basename(savfile)), force=true) + + println("Artifact had created at ", path) +end diff --git a/src/HTML_Entities.jl b/src/HTML_Entities.jl index 7da96dd..59d0269 100644 --- a/src/HTML_Entities.jl +++ b/src/HTML_Entities.jl @@ -9,6 +9,7 @@ __precompile__() """ module HTML_Entities using StrTables, RelocatableFolders +using Artifacts VER = UInt32(1) @@ -28,7 +29,7 @@ struct HTML_Table{T} <: AbstractEntityTable ind2c::Vector{UInt16} end -const DATA_PATH = @path joinpath(@__DIR__, "../data", "html.dat") +const DATA_PATH = @path joinpath(artifact"htmlnames", "html.dat") function __init__() global default = HTML_Table(StrTables.load(DATA_PATH)...)