-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (37 loc) · 1.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
# h/t to @jimhester and @yihui for this parse block:
# https://github.com/yihui/knitr/blob/dc5ead7bcfc0ebd2789fe99c527c7d91afb3de4a/Makefile#L1-L4
# Note the portability change as suggested in the manual:
# https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Writing-portable-packages
PKGNAME = `sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION`
PKGVERS = `sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION`
all: check
build: install_deps
R CMD build .
check: build
R CMD check --no-manual $(PKGNAME)_$(PKGVERS).tar.gz
install_deps:
Rscript \
-e 'if (!requireNamespace("remotes")) install.packages("remotes")' \
-e 'remotes::install_deps(dependencies = TRUE)'
install: build
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
clean:
@rm -rf $(PKGNAME)_$(PKGVERS).tar.gz $(PKGNAME).Rcheck
format:
Rscript -e 'styler::style_pkg()'
test:
Rscript -e 'devtools::test()'
lint:
Rscript -e 'lintr::lint_package()'
coverage:
Rscript -e 'covr::package_coverage()'
docs:
Rscript -e 'devtools::document()'
Rscript -e 'devtools::build_readme()'
Rscript -e 'pkgdown::build_site()'
release:
npx standard-version
#npx standard-version --release-as minor
#npx standard-version -f # first release
releasetest:
npx standard-version --dry-run