Skip to content

Commit 61880ec

Browse files
authored
Merge branch 'main' into fix-cran
2 parents 8c3ea62 + b4a223a commit 61880ec

117 files changed

Lines changed: 5067 additions & 798 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
^docs$
99
^pkgdown$
1010
^\.github$
11+
^\.sync$
1112
^\.Rprofile$
1213
^rjavaenv$
1314
^private$

CITATION.cff

Lines changed: 115 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ references:
8181
institution:
8282
name: R Foundation for Statistical Computing
8383
address: Vienna, Austria
84-
year: '2025'
84+
year: '2026'
8585
version: '>= 4.0'
8686
- type: software
8787
title: checkmate
@@ -94,7 +94,7 @@ references:
9494
given-names: Michel
9595
email: michellang@gmail.com
9696
orcid: https://orcid.org/0000-0001-9754-0393
97-
year: '2025'
97+
year: '2026'
9898
doi: 10.32614/CRAN.package.checkmate
9999
- type: software
100100
title: cli
@@ -106,7 +106,7 @@ references:
106106
- family-names: Csárdi
107107
given-names: Gábor
108108
email: gabor@posit.co
109-
year: '2025'
109+
year: '2026'
110110
doi: 10.32614/CRAN.package.cli
111111
- type: software
112112
title: curl
@@ -119,21 +119,64 @@ references:
119119
given-names: Jeroen
120120
email: jeroenooms@gmail.com
121121
orcid: https://orcid.org/0000-0002-4035-0289
122-
year: '2025'
122+
year: '2026'
123123
doi: 10.32614/CRAN.package.curl
124124
- type: software
125-
title: jsonlite
126-
abstract: 'jsonlite: A Simple and Robust JSON Parser and Generator for R'
125+
title: digest
126+
abstract: 'digest: Create Compact Hash Digests of R Objects'
127127
notes: Imports
128-
url: https://jeroen.r-universe.dev/jsonlite
129-
repository: https://CRAN.R-project.org/package=jsonlite
128+
url: https://eddelbuettel.github.io/digest/
129+
repository: https://CRAN.R-project.org/package=digest
130130
authors:
131-
- family-names: Ooms
132-
given-names: Jeroen
133-
email: jeroenooms@gmail.com
134-
orcid: https://orcid.org/0000-0002-4035-0289
135-
year: '2025'
136-
doi: 10.32614/CRAN.package.jsonlite
131+
- family-names: Eddelbuettel
132+
given-names: Dirk
133+
email: edd@debian.org
134+
orcid: https://orcid.org/0000-0001-6419-907X
135+
year: '2026'
136+
doi: 10.32614/CRAN.package.digest
137+
- type: software
138+
title: memoise
139+
abstract: 'memoise: ''Memoisation'' of Functions'
140+
notes: Imports
141+
url: https://memoise.r-lib.org
142+
repository: https://CRAN.R-project.org/package=memoise
143+
authors:
144+
- family-names: Wickham
145+
given-names: Hadley
146+
email: hadley@rstudio.com
147+
- family-names: Hester
148+
given-names: Jim
149+
- family-names: Chang
150+
given-names: Winston
151+
email: winston@rstudio.com
152+
- family-names: Müller
153+
given-names: Kirill
154+
email: krlmlr+r@mailbox.org
155+
- family-names: Cook
156+
given-names: Daniel
157+
email: danielecook@gmail.com
158+
year: '2026'
159+
doi: 10.32614/CRAN.package.memoise
160+
- type: software
161+
title: RcppSimdJson
162+
abstract: 'RcppSimdJson: ''Rcpp'' Bindings for the ''simdjson'' Header-Only Library
163+
for ''JSON'' Parsing'
164+
notes: Imports
165+
url: https://github.com/eddelbuettel/rcppsimdjson/
166+
repository: https://CRAN.R-project.org/package=RcppSimdJson
167+
authors:
168+
- family-names: Eddelbuettel
169+
given-names: Dirk
170+
email: edd@debian.org
171+
orcid: https://orcid.org/0000-0001-6419-907X
172+
- family-names: Knapp
173+
given-names: Brendan
174+
orcid: https://orcid.org/0000-0003-3284-4972
175+
- family-names: Lemire
176+
given-names: Daniel
177+
orcid: https://orcid.org/0000-0003-3306-6922
178+
year: '2026'
179+
doi: 10.32614/CRAN.package.RcppSimdJson
137180
- type: software
138181
title: rlang
139182
abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features'
@@ -147,7 +190,7 @@ references:
147190
- family-names: Wickham
148191
given-names: Hadley
149192
email: hadley@posit.co
150-
year: '2025'
193+
year: '2026'
151194
doi: 10.32614/CRAN.package.rlang
152195
- type: software
153196
title: utils
@@ -158,7 +201,60 @@ references:
158201
institution:
159202
name: R Foundation for Statistical Computing
160203
address: Vienna, Austria
161-
year: '2025'
204+
year: '2026'
205+
- type: software
206+
title: withr
207+
abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
208+
notes: Imports
209+
url: https://withr.r-lib.org
210+
repository: https://CRAN.R-project.org/package=withr
211+
authors:
212+
- family-names: Hester
213+
given-names: Jim
214+
- family-names: Henry
215+
given-names: Lionel
216+
email: lionel@posit.co
217+
- family-names: Müller
218+
given-names: Kirill
219+
email: krlmlr+r@mailbox.org
220+
- family-names: Ushey
221+
given-names: Kevin
222+
email: kevinushey@gmail.com
223+
- family-names: Wickham
224+
given-names: Hadley
225+
email: hadley@posit.co
226+
- family-names: Chang
227+
given-names: Winston
228+
year: '2026'
229+
doi: 10.32614/CRAN.package.withr
230+
- type: software
231+
title: yaml
232+
abstract: 'yaml: Methods to Convert R Data to YAML and Back'
233+
notes: Imports
234+
url: https://yaml.r-lib.org
235+
repository: https://CRAN.R-project.org/package=yaml
236+
authors:
237+
- family-names: Stephens
238+
given-names: Jeremy
239+
- family-names: Simonov
240+
given-names: Kirill
241+
year: '2026'
242+
doi: 10.32614/CRAN.package.yaml
243+
- type: software
244+
title: callr
245+
abstract: 'callr: Call R from R'
246+
notes: Suggests
247+
url: https://callr.r-lib.org
248+
repository: https://CRAN.R-project.org/package=callr
249+
authors:
250+
- family-names: Csárdi
251+
given-names: Gábor
252+
email: csardi.gabor@gmail.com
253+
orcid: https://orcid.org/0000-0001-7098-9676
254+
- family-names: Chang
255+
given-names: Winston
256+
year: '2026'
257+
doi: 10.32614/CRAN.package.callr
162258
- type: software
163259
title: quarto
164260
abstract: 'quarto: R Interface to ''Quarto'' Markdown Publishing System'
@@ -174,7 +270,7 @@ references:
174270
given-names: Christophe
175271
email: cderv@posit.co
176272
orcid: https://orcid.org/0000-0003-4474-2498
177-
year: '2025'
273+
year: '2026'
178274
doi: 10.32614/CRAN.package.quarto
179275
- type: software
180276
title: rJava
@@ -186,7 +282,7 @@ references:
186282
- family-names: Urbanek
187283
given-names: Simon
188284
email: simon.urbanek@r-project.org
189-
year: '2025'
285+
year: '2026'
190286
doi: 10.32614/CRAN.package.rJava
191287
- type: software
192288
title: testthat
@@ -198,32 +294,7 @@ references:
198294
- family-names: Wickham
199295
given-names: Hadley
200296
email: hadley@posit.co
201-
year: '2025'
297+
year: '2026'
202298
doi: 10.32614/CRAN.package.testthat
203299
version: '>= 3.0.0'
204-
- type: software
205-
title: withr
206-
abstract: 'withr: Run Code ''With'' Temporarily Modified Global State'
207-
notes: Suggests
208-
url: https://withr.r-lib.org
209-
repository: https://CRAN.R-project.org/package=withr
210-
authors:
211-
- family-names: Hester
212-
given-names: Jim
213-
- family-names: Henry
214-
given-names: Lionel
215-
email: lionel@posit.co
216-
- family-names: Müller
217-
given-names: Kirill
218-
email: krlmlr+r@mailbox.org
219-
- family-names: Ushey
220-
given-names: Kevin
221-
email: kevinushey@gmail.com
222-
- family-names: Wickham
223-
given-names: Hadley
224-
email: hadley@posit.co
225-
- family-names: Chang
226-
given-names: Winston
227-
year: '2025'
228-
doi: 10.32614/CRAN.package.withr
229300

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Imports:
4949
checkmate,
5050
cli,
5151
curl,
52-
jsonlite,
52+
digest,
5353
memoise,
54+
RcppSimdJson,
5455
rlang,
5556
utils,
56-
withr
57+
withr,
58+
yaml
5759
Suggests:
5860
callr,
5961
quarto,

NAMESPACE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export(java_check_compatibility)
66
export(java_check_version_cmd)
77
export(java_check_version_rjava)
88
export(java_clear)
9+
export(java_clear_distrib)
10+
export(java_clear_installed)
11+
export(java_clear_project)
912
export(java_download)
1013
export(java_ensure)
1114
export(java_env_set)
@@ -14,6 +17,10 @@ export(java_find_system)
1417
export(java_get_home)
1518
export(java_install)
1619
export(java_list)
20+
export(java_list_available)
21+
export(java_list_distrib)
22+
export(java_list_installed)
23+
export(java_list_project)
1724
export(java_quick_install)
1825
export(java_resolve)
1926
export(java_unpack)

R/consent.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#'
2626
#' @export
2727
#' @examples
28-
#' \dontrun{
28+
#' \donttest{
2929
#'
3030
#' # to provide consent and prevent other functions from interrupting to get the consent
3131
#' rje_consent(provided = TRUE)

R/global_params.R

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,46 @@ rjava_path_locking_note <- function() {
7272
global_use_cache_param <- function(.use_cache) {
7373
# this is just a placeholder for global .use_cache parameter
7474
}
75+
76+
#' @title Global Version Parameter
77+
#'
78+
#' @description
79+
#' Documentation for the `version` parameter, used for specifying Java versions.
80+
#'
81+
#' @param version Java version specification. Accepts:
82+
#' \itemize{
83+
#' \item **Major version** (e.g., `21`, `17`): Downloads the latest release for that major version.
84+
#' \item **Specific version** (e.g., `"21.0.9"`, `"11.0.29"`): Downloads the exact version.
85+
#' \item **SDKMAN identifier** (e.g., `"25.0.1-amzn"`, `"24.0.2-open"`): Uses the SDKMAN
86+
#' backend automatically. When an identifier is detected, the `distribution` and `backend`
87+
#' arguments are **ignored** and derived from the identifier. Find available identifiers
88+
#' in the `identifier` column of \code{\link{java_list_available}(backend = "sdkman")}.
89+
#' }
90+
#' @keywords internal
91+
global_version_param <- function(version) {
92+
# this is just a placeholder for global version parameter
93+
}
94+
95+
#' @title SDKMAN References
96+
#'
97+
#' @description
98+
#' Standard references for SDKMAN attribution.
99+
#'
100+
#' @references
101+
#' SDKMAN! - The Software Development Kit Manager: \url{https://github.com/sdkman}
102+
#' @keywords internal
103+
global_sdkman_references <- function() {
104+
# this is just a placeholder for SDKMAN references
105+
}
106+
107+
#' @title Global Backend Parameter
108+
#'
109+
#' @description
110+
#' Documentation for the `backend` parameter, used for specifying the download source.
111+
#'
112+
#' @param backend Download backend to use. One of "native" (vendor APIs) or "sdkman".
113+
#' Defaults to "native". Can also be set globally via `options(rJavaEnv.backend = "sdkman")`.
114+
#' @keywords internal
115+
global_backend_param <- function(backend) {
116+
# this is just a placeholder for global backend parameter
117+
}

R/internal_utilities.R

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,33 @@ java_urls_load <- function() {
5757
if (json_file == "") {
5858
cli::cli_abort("Configuration file not found")
5959
}
60-
jsonlite::fromJSON(json_file, simplifyVector = FALSE)
60+
RcppSimdJson::fload(json_file, max_simplify_lvl = "list")
61+
}
62+
63+
#' Read JSON from a URL
64+
#'
65+
#' Helper function to read JSON from a URL using RcppSimdJson for fast parsing
66+
#'
67+
#' @param url URL to read JSON from
68+
#' @param max_simplify_lvl Simplification level (default: "data_frame")
69+
#' @return Parsed JSON object
70+
#' @keywords internal
71+
read_json_url <- function(url, max_simplify_lvl = "data_frame") {
72+
content <- rawToChar(rje_curl_fetch_memory(url)$content)
73+
RcppSimdJson::fparse(content, max_simplify_lvl = max_simplify_lvl)
74+
}
75+
76+
#' Read lines from a URL or file
77+
#'
78+
#' Helper function to read lines, mainly for testability.
79+
#'
80+
#' @param path Path or URL
81+
#' @param warn Logical. Whether to warn.
82+
#' @return Character vector of lines
83+
#' @keywords internal
84+
#' @noRd
85+
rje_read_lines <- function(path, warn = FALSE) {
86+
readLines(path, warn = warn)
6187
}
6288

6389
#' Test all Java URLs
@@ -80,7 +106,7 @@ urls_test_all <- function() {
80106

81107
try(
82108
{
83-
response <- curl::curl_fetch_memory(
109+
response <- rje_curl_fetch_memory(
84110
url,
85111
handle = curl::new_handle(nobody = TRUE)
86112
)
@@ -406,3 +432,14 @@ java_check_current_rjava_version <- function() {
406432
}
407433
return(extracted_dirs[1])
408434
}
435+
436+
#' Wrapper for curl::curl_fetch_memory for testability
437+
#'
438+
#' @param url URL to fetch
439+
#' @param handle curl handle
440+
#' @return Response object
441+
#' @keywords internal
442+
#' @noRd
443+
rje_curl_fetch_memory <- function(url, handle = curl::new_handle()) {
444+
curl::curl_fetch_memory(url, handle = handle)
445+
}

0 commit comments

Comments
 (0)