-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
78 lines (61 loc) · 2.94 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
PACKAGE=$(shell awk '/^Package: / { print $$2 }' DESCRIPTION)
VERSION=$(shell awk '/^Version: / { print $$2 }' DESCRIPTION)
TARBALL=$(PACKAGE)_$(VERSION).tar.gz
all:
make test
make inttest INTTEST_SCHEMA="/tmp/mf-inttest.sqlite"
make inttest INTTEST_SCHEMA="/tmp/mf-inttest.duckdb"
make inttest INTTEST_SCHEMA="inttest"
make check-as-cran
install:
R CMD INSTALL --install-tests --html --example .
# Some things aren't installed by "make install", vignettes for example.
# This is slower, but more accurate.
full-install: build
R CMD INSTALL --install-tests --html --example "$(TARBALL)"
build:
R CMD build .
check: build
R CMD check "$(TARBALL)"
check-as-cran: build
R CMD check --as-cran "$(TARBALL)"
wincheck: build
# See https://win-builder.r-project.org/ for more information
curl --no-epsv -# -T "$(TARBALL)" ftp://win-builder.r-project.org/R-devel/
examples: install
# Destroy schemas first to have clear environment
Rscript -e 'library(mfdb) ; tryCatch(mfdb("examples", destroy_schema = TRUE), error = function (x) x)'
Rscript -e 'library(mfdb) ; tryCatch(mfdb("examples-copy", destroy_schema = TRUE), error = function (x) x)'
Rscript -e 'library(mfdb) ; tryCatch(mfdb("examples-import-data", destroy_schema = TRUE), error = function (x) x)'
Rscript -e 'devtools::run_examples(run_donttest = TRUE, run_dontrun = TRUE, document = FALSE)'
vignettes: install
Rscript -e 'tools::buildVignettes(dir=".")'
serve-docs:
[ -d docs ] && rm -r docs || true
Rscript --vanilla -e "pkgdown::build_site() ; servr::httd(dir='docs', host='0.0.0.0', port='8000')"
test: install
for f in tests/test-*.R; do echo "=== $$f ============="; Rscript $$f || exit 1; done
inttest: install
for f in */inttest-*.R; do echo "=== $$f ============="; Rscript $$f || exit 1; done
coverage:
R --vanilla -e 'covr::package_coverage(type = "all", line_exclusions = list())'
release: release-description release-news
git commit -m "Release version $(NEW_VERSION)" DESCRIPTION NEWS.md
git tag -am "Release version $(NEW_VERSION)" v$(NEW_VERSION)
#
R CMD build .
#
sed -i 's/^Version: .*/Version: '"$(NEW_VERSION)-999"'/' DESCRIPTION
git commit -m "Development version $(NEW_VERSION)-999" DESCRIPTION
release-description:
[ -n "$(NEW_VERSION)" ] # NEW_VERSION variable should be set
sed -i 's/^Version: .*/Version: $(NEW_VERSION)/' DESCRIPTION
sed -i "s/^Date: .*/Date: $$(date +%Y-%m-%d)/" DESCRIPTION
sed -i 's/^Depends: R .*/Depends: R (>= $(shell curl -s https://api.r-hub.io/rversions/r-oldrel/3 | grep -oiE '"version":"[0-9.]+"' | grep -oE '[0-9]+\.[0-9]+\.')0)/' DESCRIPTION
release-news:
[ -n "$(NEW_VERSION)" ] # NEW_VERSION variable should be set
mv NEWS.md NEWS.md.o
head -1 NEWS.md.o | grep -E '^\# $(PACKAGE) ' || /bin/echo -e "# $(PACKAGE) $(NEW_VERSION):\n" > NEWS.md
cat NEWS.md.o >> NEWS.md
rm NEWS.md.o
.PHONY: all install full-install build check check-as-cran wincheck examples vignettes serve-docs test inttest coverage release release-description release-news