Skip to content

Commit

Permalink
add docstring for add_artifact!
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Oct 6, 2020
1 parent 21c61b3 commit 05e729f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CurrentModule = ArtifactUtils
# ArtifactUtils

```@index
add_artifact!
```

```@autodocs
Expand Down
27 changes: 27 additions & 0 deletions src/ArtifactUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ function sha256sum(tarball_path)
end


"""
function add_artifact!(
artifacts_toml::String, name::String, tarball_url::String;
clear=true,
platform::Union{Platform,Nothing} = nothing,
download_info::Union{Vector{Tuple},Nothing} = nothing,
lazy::Bool = false,
force::Bool = false
)
Downloads tarball from `tarball_url`, extracts it and adds it as an artifact with name
`name` to the file `artifacts_toml`. If `clear` is true, the artifact itself is deleted
afterwards. The rest of the keyword arguments are passed to `Pkg.Artifacts.bind_artifact!`.
From [its docstring](https://julialang.github.io/Pkg.jl/dev/api/#Pkg.Artifacts.bind_artifact!):
> If `platform` is not `nothing`, this artifact is marked as platform-specific, and will be
> a multi-mapping. It is valid to bind multiple artifacts with the same name, but
> different `platform`s and `hash`'es within the same `artifacts_toml`. If `force` is set
> to `true`, this will overwrite a pre-existant mapping, otherwise an error is raised.
>
> `download_info` is an optional vector that contains tuples of URLs and a hash. These
> URLs will be listed as possible locations where this artifact can be obtained. If `lazy`
> is set to `true`, even if download information is available, this artifact will not be
> downloaded until it is accessed via the `artifact"name"` syntax, or
> `ensure_artifact_installed()` is called upon it.
"""
function add_artifact!(
artifacts_toml::String,
name::String,
Expand Down

2 comments on commit 05e729f

@simeonschaub
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/22499

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 05e729f2494bb4a9614638a90ed2366cf8d546f2
git push origin v0.1.0

Please sign in to comment.