forked from prioritizr/prioritizr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
136 lines (107 loc) · 4.26 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
all: clean contrib initc data docs test check
clean:
rm -rf man/*
initc:
R --slave -e "Rcpp::compileAttributes()"
R --slave -e "tools::package_native_routine_registration_skeleton('.', 'src/init.c', character_only = FALSE)"
docs: man readme vigns site
data:
Rscript --slave inst/scripts/builtin-data.R
man:
R --slave -e "devtools::document()"
readme:
R --slave -e "rmarkdown::render('README.Rmd')"
cp docs/logo.png man/figures
contrib:
R --slave -e "rmarkdown::render('CONTRIBUTING.Rmd')"
vigns:
rm -f vignettes/*.html
rm -f .build.timestamp
rm -f vignettes/*.R
rm -f doc/*.html
rm -f doc/*.Rmd
rm -f inst/doc/*.html
rm -f inst/doc/*.Rmd
R --slave -e "options(rmarkdown.html_vignette.check_title = FALSE);devtools::build_vignettes()"
cp -R doc inst/
touch inst/doc/.gitkeep
purl_vigns:
R --slave -e "lapply(dir('vignettes', '^.*\\\\.Rmd$$'), function(x) knitr::purl(file.path('vignettes', x), gsub('.Rmd', '.R', x, fixed = TRUE)))"
rm -f Rplots.pdf
purl_readme:
R --slave -e "knitr::purl('README.Rmd', 'README.R')"
rm -f Rplots.pdf
check_vigns:
R --slave -e "f <- sapply(dir('vignettes', '^.*\\\\.Rmd$$'), function(x) {p <- file.path(tempdir(), gsub('.Rmd', '.R', x, fixed = TRUE)); knitr::purl(file.path('vignettes', x), p); p}); for (i in f) {message('\n########################################\nstarting ', basename(i), '\n########################################\n'); source(i)}"
rm -f Rplots.pdf
quicksite:
cp docs/favicon.ico /tmp
cp docs/logo.png /tmp
R --slave -e "options(rmarkdown.html_vignette.check_title = FALSE);pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)"
rm docs/CNAME
echo "prioritizr.net\c" >> docs/CNAME
cp -R doc inst/
cp /tmp/favicon.ico docs
cp /tmp/logo.png docs
cp /tmp/logo.png docs/reference/figures
site:
cp docs/favicon.ico /tmp
cp docs/logo.png /tmp
R --slave -e "pkgdown::clean_site()"
R --slave -e "options(rmarkdown.html_vignette.check_title = FALSE);pkgdown::build_site(run_dont_run = TRUE, lazy = FALSE)"
rm -f docs/CNAME
echo "prioritizr.net\c" >> docs/CNAME
cp -R doc inst/
cp /tmp/favicon.ico docs
cp /tmp/logo.png docs
cp /tmp/logo.png docs/reference/figures
test:
R --slave -e "devtools::test()" > test.log 2>&1
rm -f tests/testthat/Rplots.pdf
quickcheck:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1
cp -R doc inst/
touch inst/doc/.gitkeep
check:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(remote = TRUE, build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1
cp -R doc inst/
touch inst/doc/.gitkeep
gpcheck:
echo "\n===== GOOD PRACTICE =====\n" > gp.log 2>&1
R --slave -e "goodpractice::gp('.')" >> gp.log 2>&1
cp -R doc inst/
touch inst/doc/.gitkeep
checkascran:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(remote = TRUE, build_args = '--no-build-vignettes', args = '--no-build-vignettes', vignettes = FALSE)" >> check.log 2>&1
cp -R doc inst/
touch inst/doc/.gitkeep
wbcheck:
R --slave -e "devtools::check_win_devel()"
cp -R doc inst/
jhwbcheck:
R --slave -e "devtools::check_win_devel(email = '[email protected]')"
cp -R doc inst/
solarischeck:
R --slave -e "rhub::check(platform = 'solaris-x86-patched', email = '[email protected]', show_status = FALSE)"
asancheck:
R --slave -e "rhub::check(platform = 'linux-x86_64-rocker-gcc-san', email = '[email protected]', show_status = FALSE)"
spellcheck:
R --slave -e "devtools::document();devtools::spell_check()"
urlcheck:
R --slave -e "devtools::document();urlchecker::url_check()"
build:
R --slave -e "devtools::build()"
cp -R doc inst/
touch inst/doc/.gitkeep
install:
R --slave -e "devtools::install_local(force = TRUE)"
examples:
R --slave -e "devtools::run_examples(run_donttest = TRUE, run_dontrun = TRUE);warnings()" > examples.log 2>&1
rm -f Rplots.pdf
examples_cran:
R --slave -e "devtools::run_examples();warnings()" > examples.log 2>&1
rm -f Rplots.pdf
.PHONY: initc clean data docs readme contrib site test check checkwb build install man spellcheck examples purl_vigns check_vigns urlcheck