Skip to content

Latest commit

 

History

History

gazelle

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gazelle Extension for R

The Go library in this directory provides an extension to the Gazelle build file generator. This can be used in lieu of the razel R script for generating BUILD files for individual packages in your repo.

r_repository and r_repository_list continue to use razel for generating BUILD files as the Gazelle extension is tuned more towards the end user.

Please see the Extending Gazelle guide on how to integrate this with your Gazelle binary.

When integrated, the Gazelle binary will have additional flags that will control the global behavior for this extension. These flags are:

Flags
r_generate_rules

Bool, default true

Enable rule generation for R language.

r_external_dep_prefix

String; default "R_"

Prefix to append to repo names of external packages.

r_add_test_rules

Bool; default true

Whether to add r_unit_test and r_pkg_test rules.

r_installed_pkgs

String; default "base,compiler,datasets,graphics,grDevices,grid,methods,parallel,splines,stats,stats4,tcltk,tools,translations,utils"

R packages that are to be assumed installed on the build machine (comma-separated).

r_srcs_use_globs

Bool; default false

Whether to use glob expressions for the srcs attribute.

r_roclets

String; ""

The roclets to run for building the source archive (comma-separated).

r_roclets_deps

String; "@R_roxygen2"

Additional dependencies for running roclets (comma-separated).

r_roclets_include_pkg_deps

Bool; default true

Whether to also include pkg deps when running roclets.

r_delete_assignments

String; default ""

(in `gazelle fix` mode only) Delete these variable assignments in the BUILD files (comma-separated).

You can override the global behavior specified by the above flags, through gazelle directives in BUILD files. Any directive in a BUILD file will apply to that directory and all its subdirectories. The following directives are available:

  • r_generate_rules
  • r_external_dep_prefix
  • r_add_test_rules
  • r_srcs_use_globs
  • r_roclets
  • r_roclets_deps
  • r_roclets_include_pkg_deps