1010# '   the package.
1111# ' @family build functions
1212# ' @return The url with the check results (invisibly)
13+ # ' @name check_mac
14+ NULL 
15+ 
16+ # ' @describeIn check_mac Check package on the development version of R.
17+ # ' @export
18+ check_mac_devel  <-  function (pkg  =  " ."  , dep_pkgs  =  character (), args  =  NULL , manual  =  TRUE , quiet  =  FALSE , ... ) {
19+   check_dots_used(action  =  getOption(" devtools.ellipsis_action"  , rlang :: warn ))
20+ 
21+   check_mac(
22+     pkg  =  pkg , version  =  " R-devel"  , dep_pkgs  =  dep_pkgs ,
23+     args  =  args , manual  =  manual , quiet  =  quiet , ... 
24+   )
25+ }
26+ 
27+ # ' @describeIn check_mac Check package on the released version of R.
1328# ' @export
1429check_mac_release  <-  function (pkg  =  " ."  , dep_pkgs  =  character (), args  =  NULL , manual  =  TRUE , quiet  =  FALSE , ... ) {
1530  check_dots_used(action  =  getOption(" devtools.ellipsis_action"  , rlang :: warn ))
1631
32+   check_mac(
33+     pkg  =  pkg , version  =  " R-release"  , dep_pkgs  =  dep_pkgs ,
34+     args  =  args , manual  =  manual , quiet  =  quiet , ... 
35+   )
36+ }
37+ 
38+ check_mac  <-  function (pkg  =  " ."  , version  =  c(" R-devel"  , " R-release"  ),
39+                       dep_pkgs  =  character (), args  =  NULL , manual  =  TRUE , quiet  =  FALSE , ... ) {
1740  pkg  <-  as.package(pkg )
1841
42+   version  <-  match.arg(version , several.ok  =  FALSE )
43+ 
1944  if  (! quiet ) {
2045    cli :: cli_inform(c(
2146      " Building macOS version of {.pkg {pkg$package}} ({pkg$version})"  ,
@@ -24,24 +49,25 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma
2449  }
2550
2651  built_path  <-  pkgbuild :: build(pkg $ path , tempdir(),
27-     args  =  args ,
28-     manual  =  manual , quiet  =  quiet , ... 
52+                                  args  =  args ,
53+                                  manual  =  manual , quiet  =  quiet , ... 
2954  )
3055
3156  dep_built_paths  <-  character ()
3257  for  (i  in  seq_along(dep_pkgs )) {
3358    dep_pkg  <-  as.package(dep_pkgs [[i ]])$ path 
3459    dep_built_paths [[i ]] <-  pkgbuild :: build(dep_pkg , tempdir(),
35-       args  =  args ,
36-       manual  =  manual , quiet  =  quiet , ... 
60+                                              args  =  args ,
61+                                              manual  =  manual , quiet  =  quiet , ... 
3762    )
3863  }
3964  on.exit(file_delete(c(built_path , dep_built_paths )), add  =  TRUE )
4065
4166  url  <-  " https://mac.r-project.org/macbuilder/v1/submit" 
4267
4368  rlang :: check_installed(" httr"  )
44-   body  <-  list (pkgfile  =  httr :: upload_file(built_path ))
69+   body  <-  list (pkgfile  =  httr :: upload_file(built_path ),
70+                rflavor  =  tolower(version ))
4571
4672  if  (length(dep_built_paths ) >  0 ) {
4773    uploads  <-  lapply(dep_built_paths , httr :: upload_file )
@@ -50,11 +76,11 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma
5076  }
5177
5278  res  <-  httr :: POST(url ,
53-     body  =  body ,
54-     headers  =  list (
55-       " Content-Type"   =  " multipart/form-data" 
56-     ),
57-     encode  =  " multipart" 
79+                      body  =  body ,
80+                      headers  =  list (
81+                        " Content-Type"   =  " multipart/form-data" 
82+                      ),
83+                      encode  =  " multipart" 
5884  )
5985
6086  httr :: stop_for_status(res , task  =  " Uploading package"  )
0 commit comments