-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
62 lines (47 loc) · 2.41 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: help testall testone document check install deploy deploydev html pdf news clean website
BOOK_DIR := book
help: ## Display this help screen
@echo -e "\033[1mAvailable commands:\033[0m\n"
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort
testall: ## tinytest::build_install_test()
# Rscript -e "pkgload::load_all();cl <- parallel::makeCluster(5);tinytest::run_test_dir(cluster = cl)"
awk '!/tinytest/' .Rbuildignore > temp && mv temp .Rbuildignore
Rscript -e "pkgload::load_all();tinytest::run_test_dir()"
git restore .Rbuildignore
testone: install ## make testone testfile="inst/tinytest/test-aaa-warn_once.R"
Rscript -e "pkgload::load_all();tinytest::run_test_file('$(testfile)')"
document: ## altdoc::render_docs()
Rscript -e "devtools::document()"
check: document ## devtools::check()
awk '!/tinytest/' .Rbuildignore > temp && mv temp .Rbuildignore
Rscript -e "devtools::check()"
git restore .Rbuildignore
install: document ## devtools::install(dependencies = FALSE)
Rscript -e "devtools::install(dependencies = FALSE)"
deps: document ## devtools::install(dependencies = TRUE)
Rscript -e "devtools::install(dependencies = TRUE)"
news: ## Download the latest changelog
Rscript -e "source('book/utils/utils.R');get_news()"
pdf: news ## Render the book to PDF
Rscript -e "source('book/utils/utils.R');get_quarto_yaml(pdf = TRUE)"
cd $(BOOK_DIR) && quarto render --to pdf && cd ..
rm -rf $(BOOK_DIR)/NEWS.qmd $(BOOK_DIR)/_quarto.qmd
make clean
html: news ## Render the book to HTML
Rscript -e "source('book/utils/utils.R');get_quarto_yaml(pdf = FALSE, dev = FALSE)"
cd $(BOOK_DIR) && quarto render --to html && cd ..
rm -rf $(BOOK_DIR)/NEWS.qmd $(BOOK_DIR)/_quarto.qmd
make clean
htmldev: news ## Render the book to HTML
Rscript -e "source('book/utils/utils.R');get_quarto_yaml(pdf = FALSE, dev = TRUE)"
cd $(BOOK_DIR) && quarto render --to html && cd ..
rm -rf $(BOOK_DIR)/NEWS.qmd $(BOOK_DIR)/_quarto.qmd
make clean
clean: ## Clean the book directory
rm -rf $(BOOK_DIR)/NEWS.qmd $(BOOK_DIR)/_quarto.qmd
rm -rf ut
setvar: ## Set the environment variable
export R_BUILD_DOC=true
website: setvar ## altdoc::render_docs(verbose = TRUE)
# Rscript -e "altdoc::render_docs(verbose = TRUE, freeze = TRUE)"
Rscript -e "reticulate::use_virtualenv('~/.virtualenvs/r-reticulate');altdoc::render_docs(verbose = TRUE, freeze = TRUE)"