问题
Is it possible to download a JAR into the directory inst/java
of a R package on the installation stage?
I want to submit a package to CRAN, but the jar is too big and they are not going to accept it. I thought one possible solution would be to automatically download the jar and place it inside inst/java
I think H2O do it in its build.gradle.
Would it be possible? if so, do I need to use gradle?
Update
It seems in make-dist.sh they also download the jar.
回答1:
This is the key file:
- https://github.com/h2oai/h2o-3/blob/master/h2o-r/h2o-package/R/zzz.R
Basically there is one R source file which does the download. This technique was referred to me by Kurt Hornik from CRAN.
What's happening is the actual uploaded file set is small, but during the hosted package building process inside of CRAN the jar file is downloaded, and the actual CRAN package does contain the jar file.
来源:https://stackoverflow.com/questions/52953545/download-jar-file-into-inst-java-directory-for-a-r-package