# Adding processed artefacts to a package

**URL:** https://discourse.julialang.org/t/adding-processed-artefacts-to-a-package/123804
**Category:** General Usage
**Tags:** artefacts
**Created:** [December 13, 2024, 8:23am UTC](https://discourse.julialang.org/t/adding-processed-artefacts-to-a-package/123804 "2024-12-13T08:23:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rssdev10](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rssdev10](https://discourse.julialang.org/u/rssdev10)
#### Post date: [December 13, 2024, 8:23am UTC](https://discourse.julialang.org/t/adding-processed-artefacts-to-a-package/123804/1 "2024-12-13T08:23:48Z")

</div>

Hi, I found an old package with an internal data dependency that breaks the use of an executable binary built with PackageCompiler.

In this package there is an explicit dependency for a file calculated during the package build stage.

```julia
const DATA_PATH = @path joinpath(@ __DIR__ , "../data", "html.dat")

```

The package has `deps/build.jl` logic with creation of this `html.dat` file.

I haven’t found an example in the [documentation](https://pkgdocs.julialang.org/v1/artifacts/#Artifacts.toml-files) of how to add a processed artifact. And added this logic to the end of build.jl. But this explicit copy of the file is a bit odd.

Is any way to do it better?

```julia
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

```

I created the PR [added artifact for html.dat by rssdev10 · Pull Request #19 · JuliaString/HTML\_Entities.jl · GitHub](https://github.com/JuliaString/HTML_Entities.jl/pull/19)
