Skip to content

Commit

Permalink
add missing parameters docs
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed May 28, 2024
1 parent f788b94 commit 9600c7f
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 4 deletions.
4 changes: 3 additions & 1 deletion R/download_java.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @param dest_dir The destination directory to download the Java distribution to. Defaults to a user-specific data directory.
#' @param platform The platform for which to download the Java distribution. Defaults to the current platform.
#' @param arch The architecture for which to download the Java distribution. Defaults to the current architecture.
#' @param verbose Whether to print out information about the detected platform and architecture. Defaults to TRUE.
#'
#' @return The path to the downloaded Java distribution file.
#' @export
Expand Down Expand Up @@ -82,7 +83,8 @@ list_java_distributions_cache <- function(
#' Clear the Java distributions cache folder
#'
#' @param cache_dir The cache directory to clear. Defaults to the user-specific data directory.
#'
#' @param check Whether to list the contents of the cache directory before clearing it. Defaults to TRUE.
#' @param confirm Whether to ask for confirmation before clearing the cache. Defaults to TRUE.
#' @return A message indicating whether the cache was cleared or not.
#' @export
#'
Expand Down
5 changes: 4 additions & 1 deletion R/install_java.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Install Java from a distribution file
#'
#' @param java_path The path to the Java distribution file.
#' @param install_dir The directory where Java should be installed. Defaults to the current project directory.
#' @param project The project directory where Java should be installed. Defaults to the current working directory.
#' @param autoset_java_path Whether to set the JAVA_HOME and PATH environment variables to the installed Java directory. Defaults to TRUE.
#' @return The path to the installed Java directory.
#' @export
Expand Down Expand Up @@ -91,6 +91,7 @@ install_java <- function(java_path, project = NULL, autoset_java_path = TRUE) {
#' Download and install and set Java in current working/project directory
#'
#' @inheritParams download_java
#' @param verbose Whether to print messages. Defaults to TRUE.
#' @return Message indicating that Java was installed and set in the current working/project directory.
#' @export
#'
Expand All @@ -101,13 +102,15 @@ java_quick_install <- function(
platform = .detect_platform()$os,
arch = .detect_platform()$arch,
verbose = TRUE) {

java_distr_path <- download_java(
version = version,
distribution = distribution,
platform = platform,
arch = arch,
verbose = verbose
)

install_java(java_distr_path, autoset_java_path = TRUE)
return(invisible(NULL))
}
2 changes: 2 additions & 0 deletions R/java_env.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ set_java_env <- function(java_home, where = c("both", "session", "project")) {

#' Unset the JAVA_HOME and PATH environment variables in the project .Rprofile
#'
#' @param quiet Whether to suppress messages. Defaults to FALSE.
#'
#' @export
#' @return Nothing. Removes the JAVA_HOME and PATH environment variables settings from the project .Rprofile.
unset_java_env <- function(quiet = FALSE) {
Expand Down
7 changes: 7 additions & 0 deletions R/rJavaEnv-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' @importFrom utils getFromNamespace
## usethis namespace: end
NULL
4 changes: 4 additions & 0 deletions man/clear_java_distributions_cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/download_java.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/install_java.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/java_quick_install.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/rJavaEnv-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/unset_java_env.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9600c7f

Please sign in to comment.