Skip to content

Commit

Permalink
uploaded .Rbuildignore, Makefile, _pkgdown.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
niknikos committed Feb 16, 2017
1 parent 46706cd commit 445c925
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.travis.yml
docs/
man-roxygen/
Makefile
.git/
^appveyor\.yml$
51 changes: 51 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGDATE := $(shell sed -n "s/Date: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)

GITDATE=$(shell (git log -1 --date=short --pretty=format:"%ad"))
GITVERS=$(shell (date -d `git log -1 --date=short --pretty=format:"%ad"` +%Y%m%d))

R_FILES := $(wildcard $(PKGSRC)/R/*.R)
HELP_FILES := $(wildcard $(PKGSRC)/man/*.Rd)

all: README.md build

README.md: DESCRIPTION
sed -i 's/Version: *\([^ ]*\)/Version: $(PKGVERS)/' README.md
sed -i 's/Date: *\([^ ]*\)/Date: $(PKGDATE)/' README.md

TEST: NEWS.md
awk '1;/^## CHANGES/{print}' README.md > TMP
sed 's/^#/##/' NEWS.md >> TMP
mv TMP README.md

NEWS: NEWS.md
sed 's/^# / /' NEWS.md > NEWS
sed -i 's/^##//' NEWS

docs: $(HELP_FILES) README.md _pkgdown.yml
R --vanilla --silent -e "options(repos='http://cran.r-project.org'); pkgdown::build_site(preview=FALSE)"

roxygen: $(R_FILES)
R --vanilla --silent -e "library(devtools);" \
-e "document(roclets='rd')"

update:
sed -i 's/Date: *\([^ ]*\)/Date: $(GITDATE)/' DESCRIPTION

build: roxygen docs
cd ..;\
R CMD build $(PKGSRC) --compact-vignettes

install: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz

check: README.md build
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran

clean:
cd ..;\
rm -rf $(PKGNAME).Rcheck $(PKGNAME)_$(PKGVERS).tar.gz
17 changes: 17 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
templates:
params:
bootswatch: yeti
navbar:
right:
- text: FLR
href: http://flr-project.org/
left:
- text: Source
href: http://github.com/flr/FLSAM
icon: fa-github fa-lg
- text: Reference
href: reference/index.html
- text: Articles
href: articles/index.html
- text: News
href: news/index.html

0 comments on commit 445c925

Please sign in to comment.