Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(build_vignettes)
export(check)
export(check_built)
export(check_dep_version)
export(check_mac_devel)
export(check_mac_release)
export(check_man)
export(check_rhub)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# devtools (development version)

* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
* `is_loading()` is now re-exported from pkgload (#2556).
* `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).

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

check_mac(
pkg = pkg,
version = "R-release",
dep_pkgs = dep_pkgs,
args = args,
manual = manual,
quiet = quiet,
...
)
}

#' @rdname check_mac_release
#' @export
check_mac_devel <- function(
pkg = ".",
dep_pkgs = character(),
args = NULL,
manual = TRUE,
quiet = FALSE,
...
) {
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))

check_mac(
pkg = pkg,
version = "R-devel",
dep_pkgs = dep_pkgs,
args = args,
manual = manual,
quiet = quiet,
...
)
}

check_mac <- function(
pkg = ".",
version = c("R-devel", "R-release"),
dep_pkgs = character(),
args = NULL,
manual = TRUE,
quiet = FALSE,
...
) {
pkg <- as.package(pkg)

version <- match.arg(version, several.ok = FALSE)

if (!quiet) {
cli::cli_inform(c(
"Building macOS version of {.pkg {pkg$package}} ({pkg$version})",
"Checking macOS version of {.pkg {pkg$package}} ({pkg$version})",
i = "Using https://mac.r-project.org/macbuilder/submit.html."
))
}
Expand Down Expand Up @@ -56,7 +101,10 @@ check_mac_release <- function(
url <- "https://mac.r-project.org/macbuilder/v1/submit"

rlang::check_installed("httr")
body <- list(pkgfile = httr::upload_file(built_path))
body <- list(
pkgfile = httr::upload_file(built_path),
rflavor = tolower(version)
)

if (length(dep_built_paths) > 0) {
uploads <- lapply(dep_built_paths, httr::upload_file)
Expand Down
15 changes: 12 additions & 3 deletions man/check_mac_release.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.