-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
97 lines (71 loc) · 2.48 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
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
# Specify the directory holding R binaries. To use an alternate R build (say a
# pre-prelease version) use `make RBIN=/path/to/other/R/` or `export RBIN=...`
# If no alternate bin folder is specified, the default is to use the folder
# containing the first instance of R on the PATH.
RBIN ?= $(shell dirname "`which R`")
all: doc build
.PHONY: doc clean build vignettes check revdep data
# build package documentation
doc:
Rscript -e 'devtools::document()'
test:
Rscript -e 'library(httptest); devtools::test()'
test-nocache:
MOCK_BYPASS="true" EDGARWEBR_USER_AGENT="EDGARWebR Automated Tests" Rscript -e 'library(httptest); devtools::test()'
test-buildcache: test-cleancache
MOCK_BYPASS="capture" EDGARWEBR_USER_AGENT="EDGARWebR Automated Tests" 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(clean = FALSE)'
live-vignettes:
Rscript -e 'servr::rmdv2(dir="vignettes",port = 8080)'
vignettes-clean:
${RM} -r vignettes/intro
${RM} -r vignettes/parsing
vignettes-rebuild: vignettes-clean vignettes
# 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: 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")'
ubuntu-deps:
apt-get install texlive-latex-base texlive-fonts-extra libharfbuzz-dev libfribidi-dev
revdep:
cd revdep; Rscript check.R
data:
Rscript data-raw/sic_codes.R