-
Notifications
You must be signed in to change notification settings - Fork 4
/
charlatan-Makefile
58 lines (42 loc) · 1.46 KB
/
charlatan-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
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript --no-init-file
test:
${RSCRIPT} -e 'library(methods); devtools::test()'
doc:
@mkdir -p man
${RSCRIPT} -e "library(methods); devtools::document()"
install: doc build
R CMD INSTALL . && rm *.tar.gz
update_collate:
${RSCRIPT} -e "roxygen2::update_collate('.')"
build: update_collate
R CMD build .
eg:
${RSCRIPT} -e "library(methods); devtools::run_examples()"
check: build
_R_CHECK_CRAN_INCOMING_=FALSE R CMD check --as-cran --no-manual `ls -1tr ${PACKAGE}*gz | tail -n1`
@rm -f `ls -1tr ${PACKAGE}*gz | tail -n1`
@rm -rf ${PACKAGE}.Rcheck
readme: README.Rmd
${RSCRIPT} -e "knitr::knit('README.Rmd')"
locales_update:
${RSCRIPT} -e "devtools::load_all(); z=data.table::setDF(data.table::rbindlist(lapply(available_locales, stringi::stri_locale_info))); save(z, version=2, file='data/available_locales_df.rda')"
# No real targets!
.PHONY: all test doc install
vignettes: vignettes/charlatan.Rmd vignettes/contributing.Rmd vignettes/creating-realistic-data.Rmd
${RSCRIPT} -e "devtools::build_vignettes()"
style:
${RSCRIPT} -e "styler:::style_active_pkg()"
cov:
${RSCRIPT} -e "covr::package_coverage()"
cloc:
${RSCRIPT} -e "cloc::cloc('R')"
spellcheck:
${RSCRIPT} -e "devtools::spell_check()"
lint:
${RSCRIPT} -e "devtools::lint()"
revdep:
${RSCRIPT} revdep/check.R
release: style test doc readme build revdep
codemeta:
${RSCRIPT} -e "codemetar::write_codemeta()"