Skip to content

Commit e91fe6b

Browse files
nfrerebeauhadley
andauthored
Add check_mac_devel() (#2606)
--------- Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
1 parent 9756f25 commit e91fe6b

4 files changed

Lines changed: 67 additions & 8 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export(build_vignettes)
1313
export(check)
1414
export(check_built)
1515
export(check_dep_version)
16+
export(check_mac_devel)
1617
export(check_mac_release)
1718
export(check_man)
1819
export(check_rhub)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# devtools (development version)
22

3+
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
34
* `is_loading()` is now re-exported from pkgload (#2556).
45
* `load_all()` now errors if called recursively, i.e. if you accidentally include a `load_all()` call in one of your R source files (#2617).
56

R/check-mac.R

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#' Check a package on macOS
22
#'
3-
#' This function first bundles a source package, then uploads it to
4-
#' <https://mac.r-project.org/macbuilder/submit.html>. This function returns a
5-
#' link to the page where the check results will appear.
3+
#' Check on either the released or development versions of R, using
4+
#' <https://mac.r-project.org/macbuilder/>.
5+
#'
66
#'
77
#' @template devtools
88
#' @inheritParams check_win
@@ -21,11 +21,56 @@ check_mac_release <- function(
2121
) {
2222
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
2323

24+
check_mac(
25+
pkg = pkg,
26+
version = "R-release",
27+
dep_pkgs = dep_pkgs,
28+
args = args,
29+
manual = manual,
30+
quiet = quiet,
31+
...
32+
)
33+
}
34+
35+
#' @rdname check_mac_release
36+
#' @export
37+
check_mac_devel <- function(
38+
pkg = ".",
39+
dep_pkgs = character(),
40+
args = NULL,
41+
manual = TRUE,
42+
quiet = FALSE,
43+
...
44+
) {
45+
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
46+
47+
check_mac(
48+
pkg = pkg,
49+
version = "R-devel",
50+
dep_pkgs = dep_pkgs,
51+
args = args,
52+
manual = manual,
53+
quiet = quiet,
54+
...
55+
)
56+
}
57+
58+
check_mac <- function(
59+
pkg = ".",
60+
version = c("R-devel", "R-release"),
61+
dep_pkgs = character(),
62+
args = NULL,
63+
manual = TRUE,
64+
quiet = FALSE,
65+
...
66+
) {
2467
pkg <- as.package(pkg)
2568

69+
version <- match.arg(version, several.ok = FALSE)
70+
2671
if (!quiet) {
2772
cli::cli_inform(c(
28-
"Building macOS version of {.pkg {pkg$package}} ({pkg$version})",
73+
"Checking macOS version of {.pkg {pkg$package}} ({pkg$version})",
2974
i = "Using https://mac.r-project.org/macbuilder/submit.html."
3075
))
3176
}
@@ -56,7 +101,10 @@ check_mac_release <- function(
56101
url <- "https://mac.r-project.org/macbuilder/v1/submit"
57102

58103
rlang::check_installed("httr")
59-
body <- list(pkgfile = httr::upload_file(built_path))
104+
body <- list(
105+
pkgfile = httr::upload_file(built_path),
106+
rflavor = tolower(version)
107+
)
60108

61109
if (length(dep_built_paths) > 0) {
62110
uploads <- lapply(dep_built_paths, httr::upload_file)

man/check_mac_release.Rd

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)