Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added artifact for html.dat #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[htmlnames]
git-tree-sha1 = "813db2bcdc4c5c4cc1cdbd6583e6c6bd7eaca024"
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ keywords = ["Entities", "HTML"]
license = "MIT"
desc = "Entities from HTML data tables"
authors = ["ScottPJones <[email protected]>"]
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"
Expand Down
12 changes: 12 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

println("Running HTML entity build in ", pwd())

using Artifacts
using Base.Filesystem
using StrTables

VER = UInt32(1)
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/HTML_Entities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __precompile__()
"""
module HTML_Entities
using StrTables, RelocatableFolders
using Artifacts

VER = UInt32(1)

Expand All @@ -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)...)
Expand Down
Loading