Skip to content

Commit 5a33ee5

Browse files
committed
Put RTools on the path when necessary
This avoids users needing to manually add the RTools location to their PATH; which is error prone as you then have to update it for newer RTools versions and ensure the unix tools bundled with RTools don't conflict with other tools on your PATH.
1 parent 4eb8264 commit 5a33ee5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

DESCRIPTION

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ Suggests:
2626
covr,
2727
git2r (>= 0.23.0),
2828
mockery,
29-
pkgbuild,
29+
pkgbuild (>= 1.0.0.9000),
3030
pingr,
3131
testthat,
3232
withr
3333
Depends:
3434
R (>= 3.0.0)
35+
Remotes:
36+
r-lib/pkgbuild
3537
RoxygenNote: 6.1.0
3638
SystemRequirements: Subversion for install_svn, git for install_git
3739
Encoding: UTF-8

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
# Development
1010

11+
* `install_()*` functions now temporally put Rtools on the PATH when necessary,
12+
as long as the pkgbuild package is installed.
13+
1114
* `standardise_dep()` exported, for use in devtools.
1215

1316
* Remotes can be forced to use only its internal code by setting the

R/install.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
install <- function(pkgdir, dependencies, quiet, build, build_opts, upgrade,
22
repos, type, ...) {
33

4-
if (file.exists(file.path(pkgdir, "src")) && ! has_devel()) {
5-
missing_devel_warning(pkgdir)
4+
if (file.exists(file.path(pkgdir, "src"))) {
5+
if (has_package("pkgbuild")) {
6+
pkgbuild::local_build_tools(required = TRUE)
7+
} else if (!has_devel()) {
8+
missing_devel_warning(pkgdir)
9+
}
610
}
711

812
## Check for circular dependencies. We need to know about the root

0 commit comments

Comments
 (0)