Accessors
On this page
A accessor is everything that pulls data (mostly files to be precise) from a remote source / repository.
There are three builtin accessors:
package://xxx
: nittos builtin package management solution; see also heredownload://xxx
: downloads any given file from the web; see belowfolder://
: just specifies a folder to use
Accessors can be used in both the source
and use
command inside an target. Both commands also allow for an block which a accessor then can scan for commands it allows.
It’s also to note that when a block is supplied, and a buildsystem
command is found inside, a buildsystem is invoked onto the local data from the remote before continued. For more about (foreign-) buildsystems see their documentation.
Download accessor
The download accessor can be used to access sources from the web and is a great help for projects that distrubute their source or artifacts via archives such as tarballs.
Example:
target "ruby" {
# ...
sources "download://$(opt.ruby-download-url)" {
path "ruby-3.1.3"
unpack "tgz"
# ...
}
}
It allows following two commands in it’s block:
path
Specifies a sub-path to be used; also used when unpacking.
Arguments | |||
---|---|---|---|
# | Name | Type | Info |
0 |
subpath
|
str
|
Expanded?: ✅ |
unpack
Unpacks the downloaded file by treating it as an archive. The first argument is the type of archive the downloaded file is, while the optional second is the destination where to extract to.
Allowed values for the type are:
tar.gz
/tgz
Arguments | |||
---|---|---|---|
# | Name | Type | Info |
0 |
type
|
str
|
Expanded?: ❌ |
1 |
destination
(optional)
|
str
|
The destination to extract to; will be resolved against the cachepath of the accessor. Expanded?: ❌ |