Skip to content

Commit

Permalink
get working for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoodri committed Jul 5, 2020
1 parent 1075a56 commit 164454b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions tests/testthat/test-rstan_create_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ for(ii in 1:ntest) {
# specific test condition
use_create_package <- test_descr$create_package[ii]
use_roxygen <- test_descr$roxygen[ii]
if (!use_roxygen) next # FIXME
context(paste0(
ifelse(use_create_package,
yes = "rstan_create_package",
Expand Down Expand Up @@ -93,7 +94,9 @@ for(ii in 1:ntest) {
skip_on_cran()
skip_on_travis()
}
## if(!use_roxygen) pkgbuild::compile_dll(pkg_dest_path)
example(source) # defines the sourceDir() function
try(roxygen2::roxygenize(pkg_dest_path, load_code = sourceDir), silent = TRUE)
pkgbuild::compile_dll(pkg_dest_path)
tmp <- capture.output(load_out <- pkgload::load_all(pkg_dest_path,
export_all = TRUE,
quiet = TRUE))
Expand All @@ -108,10 +111,9 @@ for(ii in 1:ntest) {
skip_on_travis()
}
skip_if_not_installed("roxygen2")
## pkgbuild::compile_dll(pkg_dest_path)
## devtools::document(pkg_dest_path)
tmp <- capture.output(pkgload::unload(pkg_name))
roxygen2::roxygenize(pkg_dest_path)
pkgbuild::compile_dll(pkg_dest_path)
roxygen2::roxygenize(pkg_dest_path)
tmp <- capture.output(load_out <- pkgload::load_all(pkg_dest_path,
export_all = TRUE,
Expand Down
13 changes: 8 additions & 5 deletions vignettes/minimal-rstan-package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,18 @@ for `lm_stan` and update the `NAMESPACE` so the function is exported, i.e.,
available to users when the package is installed. This can be done with the
function `roxygen2::roxygenize()`.

```{r, eval=FALSE}
```{r, results = "hide"}
example(source) # defines the sourceDir() function
roxygen2::roxygenize(load_code = sourceDir)
pkgbuild::compile_dll()
```
```{r, include=FALSE}
pkgbuild::compile_dll(PATH) # required for newer versions of roxygen2
```{r, eval = FALSE}
try(roxygen2::roxygenize(load_code = sourceDir), silent = TRUE)
pkgbuild::compile_dll()
roxygen2::roxygenize()
```
```{r, echo=FALSE}
try(roxygen2::roxygenize(PATH, load_code = sourceDir), silent = TRUE)
rm(lm_stan)
pkgbuild::compile_dll(PATH)
roxygen2::roxygenize(PATH)
```

Expand Down

0 comments on commit 164454b

Please sign in to comment.