-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,46 @@ | ||
R_OPTS = --vanilla -e | ||
R.OPTS = --vanilla -e | ||
DATE = $(shell date.exe "+%Y%m%d") | ||
PKG.VERS = $(shell Rscript $(R.OPTS) "cat(read.dcf('DESCRIPTION', fields='Version'))") | ||
PKG.NAME = $(shell Rscript $(R.OPTS) "cat(read.dcf('DESCRIPTION', fields='Package'))") | ||
BUILT.PKG = $(PKG.NAME)_$(PKG.VERS).tar.gz | ||
|
||
## TODO: | ||
## o Add target for pushing version tag (e.g., v0.0.9) to github for package release | ||
|
||
test: | ||
@echo $(BUILT.PKG) | ||
|
||
date: | ||
@echo $(DATE) | ||
|
||
##### build and check package | ||
|
||
##### targets to build and check package | ||
|
||
## Build the package. Set 'binary=FALSE' (build a source package) for cross-platform portability. | ||
build: | ||
R $(R_OPTS) "devtools::build(pkg='.', binary=FALSE, vignettes=TRUE, manual=TRUE)" | ||
R $(R.OPTS) "devtools::build(pkg='.', binary=FALSE, vignettes=TRUE, manual=TRUE)" | ||
|
||
## Check the built package for current version number. | ||
## Must pass checks with no errors, and preferably no warnings. | ||
checkbuilt: | ||
R $(R_OPTS) "devtools::check_built(path=here::here('..', 'FDButils_0.0.9.tar.gz'))" | ||
R $(R.OPTS) "devtools::check_built(path=here::here('..', '$(BUILT.PKG)'))" | ||
|
||
## Build and check the package. Does not save built package. Must pass checks with no errors, and preferably no warnings. | ||
## Build and check the package. Does not save built package. | ||
## Must pass checks with no errors, and preferably no warnings. | ||
check: | ||
R $(R_OPTS) "devtools::check(pkg='.')" | ||
R $(R.OPTS) "devtools::check(pkg='.')" | ||
|
||
##### Build pkgdown site from scratch (online documentation) | ||
##### target to build pkgdown site from scratch (online documentation) | ||
pkgdown: | ||
R $(R_OPTS) "pkgdown::clean_site(pkg='.')" | ||
R $(R_OPTS) "pkgdown::build_site(pkg='.', preview=TRUE)" | ||
R $(R.OPTS) "pkgdown::clean_site(pkg='.')" | ||
R $(R.OPTS) "pkgdown::build_site(pkg='.', preview=TRUE)" | ||
|
||
##### Build documentation in various formats in order to check it's ok. | ||
##### targets to build documentation in various formats, mostly in order to check it's ok before release | ||
|
||
## Build roxygen2 documentation | ||
document: | ||
R $(R_OPTS) "devtools::document(pkg='.')" | ||
R $(R.OPTS) "devtools::document(pkg='.')" | ||
|
||
## Build PDF manual and put it in the parent directory to the package. | ||
manual: | ||
R $(R_OPTS) "devtools::build_manual(pkg='.')" | ||
R $(R.OPTS) "devtools::build_manual(pkg='.')" |