-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
94 lines (68 loc) · 2.22 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
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename $(PWD))
TGZ := $(PKGSRC)_$(PKGVERS).tar.gz
TGZVNR := $(PKGSRC)_$(PKGVERS)-vignettes-not-rebuilt.tar.gz
all: version doc build
.PHONY: doc clean build vignettes check revdep data
NAMESPACE: R/*.R
Rscript -e 'devtools::document()'
# build package documentation
doc:
Rscript -e 'devtools::document()'
test:
Rscript -e 'library(httptest); devtools::test()'
test-nocache:
MOCK_BYPASS="true" Rscript -e 'library(httptest); devtools::test()'
test-buildcache: test-cleancache
MOCK_BYPASS="capture" Rscript -e 'library(httptest); devtools::test()'
test-cleancache:
${RM} -r tests/cache
build: doc
Rscript -e 'devtools::build()'
doc-all: doc readme vignettes
vignettes:
Rscript -e 'devtools::build_vignettes()'
live-vignettes:
Rscript -e 'servr::rmdv2(dir="vignettes",port = 8080)'
# Tidy, but keep everything in git
clean:
$(RM) -r vignettes/*cache
$(RM) -r vignettes/*files
$(RM) -r vignettes/*figure
$(RM) -r vignettes/*.md
$(RM) -r docs/*cache
$(RM) -r docs/articles/*cache
# Purge all generated files, leave only true source
dist-clean: clean test-cleancache
$(RM) -r man
$(RM) -r doc
$(RM) README.md
$(RM) -r inst
install:
Rscript -e 'devtools::install()'
check: build
cd ..;R CMD check $(TGZ)
cran-check: version doc build
cd ..;R CMD check --as-cran $(TGZ)
live-test:
Rscript -e 'library(httptest); testthat::auto_test_package()'
coverage:
Rscript -e 'covr::report(covr::package_coverage(), file="~/public_html/edgarWebR-cov.html", browse = FALSE)'
lint:
@echo "Make sure you're using lintr >= 1.0.1 (probably need to use github)"
Rscript -e 'lintr::lint_package()'
site: doc-all
Rscript -e 'pkgdown::build_site()'
readme:
Rscript -e 'rmarkdown::render("README.Rmd")'
# Makes reading builds easier on appveyor and travis
version:
sed "s/^version:.*/version: '$(PKGVERS).{build}'/" appveyor.yml > appveyor.tmp
mv appveyor.tmp appveyor.yml
sed "s/^ - PACKAGE.*/ - PACKAGE_VERSION=\"$(PKGVERS)\"/" .travis.yml > travis.tmp
mv travis.tmp .travis.yml
ubuntu-deps:
apt-get install texlive-latex-base texlive-fonts-extra
revdep:
cd revdep; Rscript check.R