Builds a package source tar.gz using pkgbuild::build and moves it into a user-specified location (default docker/
).
Arguments
- pkg_path
Path to the package directory. Default is
"."
for the current working directory, which assumes developer is working in R package root. However, this can be set to another path as needed.- img_path
Path to the write the docker image definition contents. The default
NULL
will usedocker/
as a subdirectory of thepkg_path
.- ...
Additional optional arguments passed to pkgbuild::build.
Value
Invisibly returns a list of package info returned by pkg_info, tar.gz source and destination file paths.
Examples
if (FALSE) {
# Specify path to example package source and copy to tempdir()
# Note that in practice you do not need to copy to a tempdir()
# And in fact it may be easiest to use pracpac relative to your package directory root
ex_pkg_src <- system.file("hellow", package = "pracpac", mustWork = TRUE)
file.copy(from = ex_pkg_src, to = tempdir(), recursive = TRUE)
# Build the example package from tempdir()
build_pkg(pkg = file.path(tempdir(), "hellow"))
}