10
10
# ' the package.
11
11
# ' @family build functions
12
12
# ' @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.
13
28
# ' @export
14
29
check_mac_release <- function (pkg = " ." , dep_pkgs = character (), args = NULL , manual = TRUE , quiet = FALSE , ... ) {
15
30
check_dots_used(action = getOption(" devtools.ellipsis_action" , rlang :: warn ))
16
31
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 , ... ) {
17
40
pkg <- as.package(pkg )
18
41
42
+ version <- match.arg(version , several.ok = FALSE )
43
+
19
44
if (! quiet ) {
20
45
cli :: cli_inform(c(
21
46
" Building macOS version of {.pkg {pkg$package}} ({pkg$version})" ,
@@ -24,24 +49,25 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma
24
49
}
25
50
26
51
built_path <- pkgbuild :: build(pkg $ path , tempdir(),
27
- args = args ,
28
- manual = manual , quiet = quiet , ...
52
+ args = args ,
53
+ manual = manual , quiet = quiet , ...
29
54
)
30
55
31
56
dep_built_paths <- character ()
32
57
for (i in seq_along(dep_pkgs )) {
33
58
dep_pkg <- as.package(dep_pkgs [[i ]])$ path
34
59
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 , ...
37
62
)
38
63
}
39
64
on.exit(file_delete(c(built_path , dep_built_paths )), add = TRUE )
40
65
41
66
url <- " https://mac.r-project.org/macbuilder/v1/submit"
42
67
43
68
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 ))
45
71
46
72
if (length(dep_built_paths ) > 0 ) {
47
73
uploads <- lapply(dep_built_paths , httr :: upload_file )
@@ -50,11 +76,11 @@ check_mac_release <- function(pkg = ".", dep_pkgs = character(), args = NULL, ma
50
76
}
51
77
52
78
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"
58
84
)
59
85
60
86
httr :: stop_for_status(res , task = " Uploading package" )
0 commit comments