forked from rstudio/sparkapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.R
39 lines (32 loc) · 840 Bytes
/
configure.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
compile_jars <- function() {
verbose <- !is.na(Sys.getenv("NOT_CRAN", unset = NA))
# skip on Travis
if (!is.na(Sys.getenv("TRAVIS", unset = NA))) {
if (verbose)
message("** skipping Scala compilation on Travis")
return(FALSE)
}
# skip if no 'scalac' available
if (!nzchar(Sys.which("scalac"))) {
if (verbose)
message("** skipping Scala compilation: 'scalac' not on PATH")
return(FALSE)
}
# skip if no 'jar' available
if (!nzchar(Sys.which("jar"))) {
if (verbose)
message("** skipping Scala compilation: 'jar' not on PATH")
return(FALSE)
}
source("R/version.R")
source("R/compile.R")
tryCatch(
source("inst/tools/compile-scala.R"),
error = function(e) {
if (nzchar(e$message)) {
message(e$message)
}
}
)
}
invisible(compile_jars())