| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/vendor.R |
| 3 |
\name{vendor} |
| 4 |
\alias{vendor} |
| 5 |
\title{Vendor renv in an R package} |
| 6 |
\usage{ |
| 7 |
vendor(version = "main", project = getwd()) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{version}{The version of renv to vendor. \code{renv} sources will be pulled |
| 11 |
from GitHub, and so \code{version} should refer to either a commit hash or a |
| 12 |
branch name.} |
| 13 |
|
| 14 |
\item{project}{The project in which renv should be vendored.} |
| 15 |
} |
| 16 |
\description{ |
| 17 |
Calling \code{renv:::vendor()} will: |
| 18 |
\itemize{ |
| 19 |
\item Compile a vendored copy of renv to \code{inst/vendor/renv.R}, |
| 20 |
\item Generate an renv auto-loader at \code{R/renv.R}. |
| 21 |
} |
| 22 |
|
| 23 |
Using this, projects can take a dependency on renv, and use renv |
| 24 |
internals, in a CRAN-compliant way. After vendoring renv, you can |
| 25 |
use renv APIs in your package via the embedded renv environment; |
| 26 |
for example, you could call the \code{\link[=dependencies]{dependencies()}} function with: |
| 27 |
|
| 28 |
\if{html}{\out{<div class="sourceCode">}}\preformatted{renv$dependencies() |
| 29 |
}\if{html}{\out{</div>}} |
| 30 |
|
| 31 |
Be aware that renv internals might change in future releases, so if you |
| 32 |
need to rely on renv internal functions, we strongly recommend testing |
| 33 |
your usages of these functions to avoid potential breakage. |
| 34 |
} |
| 35 |
\keyword{internal} |