prj_lock_env: Locks the project environment.

Description Usage Arguments Details See Also Examples

Description

It collects all dependencies' versions and stores them in lock file to enforce exact dependency versions in the future.

Usage

1

Arguments

prj

project object to be locked. If not passed the loaded project will be locked or the default whichever exists. Will init default project from the working directory if no default project exists. (type: rsuite_project, default: NULL)

Details

The lock file is saved in <my_project>/deployment/ under 'env.lock' name. It is in dcf format with information about packages installed in local project environment together with their versions. A sample record from the lock file:

Package: RSuite
Version: 0.26.235

When dependencies are being installed (using prj_install_deps) the 'env.lock' file will be used to detect whether any package will change versions. If that's the case a warning message will be displayed like this:

...:rsuite: The following packages will be updated from the last lock: colorspace

The feature allows preventing errors caused by newer versions of packages which might work differently than previous versions used in the project.

See Also

Other in project management: prj_build, prj_clean_deps, prj_init, prj_install_deps, prj_load, prj_pack, prj_start_package, prj_start, prj_unload, prj_zip

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  # create exemplary project base folder
  prj_base <- tempfile("example_")
  dir.create(prj_base, recursive = TRUE, showWarnings = FALSE)

  # start project
  prj <- prj_start("my_project", skip_rc = TRUE, path = prj_base)

  # build project local environment
  prj_install_deps(prj = prj)

  # lock project environment
  prj_lock_env(prj = prj)

  # present contents of lock file created
  cat(readLines(file.path(prj$path, "deployment", "env.lock")), sep = "\n")

RSuite documentation built on June 10, 2019, 5:03 p.m.