Download jar file into inst/java directory for a R package

落爺英雄遲暮 提交于 2019-12-24 09:25:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!