Skip to content

Commit b4a223a

Browse files
authored
major internal rework, sdkman (#98)
* major internal rework, sdkman * cleanup * addrje_curl_fetch_memory wrapper; replace curl::curl_fetch_memory usages and add tests for java list/resolve and SDKMAN resolution * cleanup examples * cleanup examples, update metadata
1 parent cbc4a78 commit b4a223a

File tree

118 files changed

+5105
-834
lines changed

Some content is hidden

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

118 files changed

+5105
-834
lines changed

.Rbuildignore

Lines changed: 3 additions & 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$
@@ -33,3 +34,5 @@
3334
^\.jupyter$
3435
^[.]?air[.]toml$
3536
^\.vscode$
37+
^\.devcontainer$
38+
^\.claude$

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: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ global_quiet_param <- function(quiet) {
1515
#' Documentation template for rJava path-locking behavior.
1616
#'
1717
#' @section rJava Path-Locking:
18-
#' **Important for \strong{rJava} Users**: This function sets environment variables
19-
#' (JAVA_HOME, PATH) that affect both command-line Java tools and \strong{rJava} initialization.
20-
#' However, due to \strong{rJava}'s path-locking behavior when \code{\link[rJava]{.jinit}} is called
18+
#' **Important for rJava Users**: This function sets environment variables
19+
#' (JAVA_HOME, PATH) that affect both command-line Java tools and rJava initialization.
20+
#' However, due to rJava's path-locking behavior when \code{\link[rJava]{.jinit}} is called
2121
#' (see \url{https://github.com/s-u/rJava/issues/25}, \url{https://github.com/s-u/rJava/issues/249}, and \url{https://github.com/s-u/rJava/issues/334}),
2222
#' this function must be called **BEFORE** \code{\link[rJava]{.jinit}} is invoked. Once \code{\link[rJava]{.jinit}}
2323
#' initializes, the Java version is locked for that R session and cannot be changed without restarting R.
2424
#'
2525
#' \code{\link[rJava]{.jinit}} is invoked (and Java locked) when you:
2626
#' \itemize{
2727
#' \item Explicitly call \code{library(rJava)}
28-
#' \item Load any package that imports \strong{rJava} (which auto-loads it as a dependency)
28+
#' \item Load any package that imports rJava (which auto-loads it as a dependency)
2929
#' \item Even just use IDE autocomplete with \code{rJava::} (this triggers initialization!)
30-
#' \item Call any \strong{rJava}-dependent function
30+
#' \item Call any rJava-dependent function
3131
#' }
3232
#'
33-
#' Once any of these happen, the Java version used by \strong{rJava} for that session is locked in.
34-
#' For command-line Java tools that don't use \strong{rJava}, this function can be called at any
33+
#' Once any of these happen, the Java version used by rJava for that session is locked in.
34+
#' For command-line Java tools that don't use rJava, this function can be called at any
3535
#' time to switch Java versions for subsequent system calls.
3636
#'
3737
#' @keywords internal
@@ -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+
}

0 commit comments

Comments
 (0)