https://github.com/netique/buildr
Organize & Run Build Scripts Comfortably
https://github.com/netique/buildr
addin buildr cran keyboard-shortcut r r-package rpackage rstats rstats-package rstudio-addin
Last synced: 8 months ago
JSON representation
Organize & Run Build Scripts Comfortably
- Host: GitHub
- URL: https://github.com/netique/buildr
- Owner: netique
- License: gpl-3.0
- Created: 2020-05-06T16:12:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T07:28:52.000Z (about 2 years ago)
- Last Synced: 2025-10-22T03:56:05.599Z (8 months ago)
- Topics: addin, buildr, cran, keyboard-shortcut, r, r-package, rpackage, rstats, rstats-package, rstudio-addin
- Language: R
- Homepage: https://netique.github.io/buildr
- Size: 4.3 MB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r setup, echo = FALSE}
knitr::opts_chunk$set(
echo = TRUE, eval = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# buildr 
[](https://CRAN.R-project.org/package=buildr)
[](https://netique.r-universe.dev)
[](https://github.com/netique/buildr)
[](https://github.com/netique/buildr/actions/workflows/R-CMD-check.yaml)
[](https://cranlogs.r-pkg.org/)
[](https://lifecycle.r-lib.org/articles/stages.html#maturing/)
> Organize & Run Build Scripts Comfortably
Working with reproducible reports or any other similar projects often requires to run the script that "builds" the output file in a specified way. `{buildr}` can help you organize, modify and comfortably run those scripts. The package provides a set of functions that **interactively guides you through the process** and that are available as [RStudio Addin](https://rstudio.github.io/rstudioaddins/), meaning you can set up the **keyboard shortcuts**, enabling you to choose and run the desired build script with **one keystroke anywhere anytime.**
## Installation
You can install the stable version of `{buildr}` ([](https://CRAN.R-project.org/package=buildr)) from [CRAN](https://CRAN.R-project.org/package=buildr) with:
```{r}
install.packages("buildr")
```
And the development version ([](https://github.com/netique/buildr)) from [GitHub](https://github.com/netique/buildr) with:
```{r}
if (!require(remotes)) {install.packages("remotes")}
remotes::install_github("netique/buildr")
```
## Load the package
First, load the package with:
```{r init}
library(buildr)
```
You can skip the step above and prepend `buildr::` to every function call. That could be handy if you use `{buildr}` functions only occasionally.
## Use `{buildr}` in three steps
1. First, call `init()`, which initializes a special `Makefile` in project root with automatically discovered build scripts that share a common prefix and separator ("build" and "_", by default). `Makefile` is a standard "recipe book" which tells the software how it should be compiled. It's so general it can serve perfectly for our purposes. See the [documentation for GNU Make](https://www.gnu.org/software/make/manual/html_node/) or read `vignette("know_your_buildr")` vignette of `{buildr}`.
2. If you have only one build script, you may just proceed by calling `build()`. However, **the strength of `{buildr}` lies in the ease with which you can choose the desired script and run it when your project is populated with many of them**. To do so, call `aim()` and choose among the scripts `{buildr}` discovered for you. `aim()` will set one of the `Makefile` targets to be recognized by RStudio Build pane.
3. The last step that you'll need and use most of the time is the actual "building". Simply call `build()` to run the first `Makefile` entry that you have previously set with `aim()`.
That's it! To learn more about `{buildr}`, `Makefile`s or other relevant stuff, please refer yourself to the `vignette("know_your_buildr")` vignette, which describes how to use `{buildr}` as an Addin, **how to define your keyboard shortcut** and much more.
Happy building!
## License
This program is free software and you can redistribute it and or modify it under the terms of the [GNU GPL 3](https://www.gnu.org/licenses/gpl-3.0.en.html).