From 7d534f44cc916921cd198407db0f6939683125c6 Mon Sep 17 00:00:00 2001 From: Till Hoffmann Date: Sat, 16 Dec 2023 02:10:57 +0100 Subject: [PATCH] Update build to skip vignette run on CRAN. --- .Rbuildignore | 1 - .gitignore | 1 - Makefile | 24 +++++++++++++----------- vignettes/getting_started.Rmd | 5 ++++- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 158cf6d..432ae6f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,4 +10,3 @@ Makefile ^check$ ^CRAN-SUBMISSION$ ^cran-comments\.md$ - diff --git a/.gitignore b/.gitignore index 8fd22d7..0a55e9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ inst/doc vignettes/getting_started *.html -check .vscode build .DS_Store diff --git a/Makefile b/Makefile index 4d50c67..5713ea6 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,17 @@ -.PHONY : build check man vignettes +.PHONY : build clean -vignettes/getting_started.html : vignettes/getting_started.Rmd vignettes/getting_started.stan - Rscript -e "devtools::build_rmd('$<')" +build : build/gptoolsStan -man : +build/gptoolsStan : +# Update documentation. Rscript -e 'devtools::document()' +# Clean up an potential previous builds and create a clean directory. + rm -rf build && mkdir -p build +# Build, check, and extract the package. + cd build \ + && NOT_CRAN=true R CMD build .. \ + && R CMD check --as-cran *.tar.gz \ + && tar -xf *.tar.gz -build : - mkdir -p build - cd build && R CMD build .. - -check : build - mkdir -p check - cd check && R CMD check --as-cran ../build/*.tar.gz +clean : + rm -rf build diff --git a/vignettes/getting_started.Rmd b/vignettes/getting_started.Rmd index 7141184..61df574 100644 --- a/vignettes/getting_started.Rmd +++ b/vignettes/getting_started.Rmd @@ -5,12 +5,15 @@ vignette: > %\VignetteIndexEntry{Getting Started with gptools in R} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} +params: + EVAL: !r identical(Sys.getenv("NOT_CRAN"), "true") --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, - comment = "#>" + comment = "#>", + eval = params$EVAL ) ```