diff --git a/NAMESPACE b/NAMESPACE index fb68041eb..46884560e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/NEWS.md b/NEWS.md index 698c98a8d..9c2d1d782 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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). diff --git a/R/check-mac.R b/R/check-mac.R index b4ed56d06..ebfd616ca 100644 --- a/R/check-mac.R +++ b/R/check-mac.R @@ -1,8 +1,8 @@ #' Check a package on macOS #' -#' This function first bundles a source package, then uploads it to -#' . 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 +#' . +#' #' #' @template devtools #' @inheritParams check_win @@ -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." )) } @@ -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) diff --git a/man/check_mac_release.Rd b/man/check_mac_release.Rd index baa5793d7..7ace23b63 100644 --- a/man/check_mac_release.Rd +++ b/man/check_mac_release.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/check-mac.R \name{check_mac_release} \alias{check_mac_release} +\alias{check_mac_devel} \title{Check a package on macOS} \usage{ check_mac_release( @@ -12,6 +13,15 @@ check_mac_release( quiet = FALSE, ... ) + +check_mac_devel( + pkg = ".", + dep_pkgs = character(), + args = NULL, + manual = TRUE, + quiet = FALSE, + ... +) } \arguments{ \item{pkg}{The package to use, can be a file path to the package or a @@ -34,9 +44,8 @@ or \verb{R CMD install} if \code{binary = TRUE}.} The url with the check results (invisibly) } \description{ -This function first bundles a source package, then uploads it to -\url{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 +\url{https://mac.r-project.org/macbuilder/}. } \seealso{ Other build functions: