Skip to content

Commit

Permalink
Merge branch 'release/0.1' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed Feb 3, 2016
2 parents c4dff3c + 76f916e commit 3187dfb
Show file tree
Hide file tree
Showing 36 changed files with 616 additions and 83 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^wercker\.yml$
^readme$
^appveyor\.yml$
^makeR$
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

18 changes: 8 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
Package: rprojroot
Title: Finding Files in Project Subdirectories
Version: 0.0-8
Version: 0.1
Authors@R: as.person("Kirill Müller <krlmlr+r@mailbox.org> [aut, cre]")
Description: Robust, reliable and flexible paths to files below a project root.
The 'root' of a project is defined as a directory that matches a certain
criterion, e.g., it contains a certain regular file.
Depends:
R (>= 3.0.0)
Suggests:
testthat,
knitr,
rmarkdown
Description: Robust, reliable and flexible paths to files below a
project root. The 'root' of a project is defined as a directory
that matches a certain criterion, e.g., it contains a certain
regular file.
Depends: R (>= 3.0.0)
Suggests: testthat, knitr, rmarkdown
VignetteBuilder: knitr
License: GPL-3
LazyData: true
Encoding: UTF-8
GitHub: https://github.com/krlmlr/rprojroot
URL: https://krlmlr.github.io/rprojroot
BugReports: https://github.com/krlmlr/rprojroot/issues
RoxygenNote: 5.0.1
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
-include makeR/Makefile
-include Makefile.in

init:
git submodule update --init
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by roxygen2 (4.1.1.9001): do not edit by hand
# Generated by roxygen2: do not edit by hand

S3method(as.root_criterion,character)
S3method(as.root_criterion,default)
Expand Down
73 changes: 24 additions & 49 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,24 @@
Version 0.0-8 (2015-06-03)
===

- use `dirname` instead of `normalizePath("..")`

Version 0.0-7 (2015-05-31)
===

- Use `winslash = "/"` for consistent tests and behavior
- Replace potentially endless loop with a limited loop
- Test on Windows with appveyor

Version 0.0-6 (2015-05-29)
===

- Full test coverage

Version 0.0-5 (2015-05-29)
===

- New function `as.root_criterion` (called by `find_root()`), a character argument is converted to a `has_file()` criterion. Now the call `find_root("filename")` is identical to `find_root(has_file("filename"))`.
- Use `"."` instead of `"getwd()"` as default for `path` argument
- Improved documentation

Version 0.0-4 (2015-05-20)
===

- New variables `criteria`, `is_rstudio_project`, `is_r_package`
- New function `has_file_pattern` (was previously `has_file`); the `has_file` function now checks the entire file name without pattern matching

Version 0.0-3 (2015-05-20)
===

- Criterion concept: constructors `root_criterion` and `has_file`
- All functions that used to accept `filename` + `contents` + `n` now accept only a criterion

Version 0.0-2 (2015-05-19)
===

- Factory `make_fix_root_file` that fixes the working directory

Version 0.0-1 (2015-05-19)
===

- Initial version
- Main workhorse function `find_root`
- Wrapper `find_root_file`
- Factory `make_find_root_file` and helpers `find_rstudio_root_file` and `find_package_root_file`
- Vignette
Version 0.1 (2016-02-03)
===

Initial GitHub release.

- Getting started:
- `find_package_root_file()`
- `find_rstudio_root_file()`

- S3 class `root_criterion`:
- `root_criterion()`
- `as.root_criterion()`
- `is.root_criterion()`
- `has_file()`
- `has_file_pattern()`
- `criteria`
- `is_r_package`
- `is_rstudio_project`

- Use a custom notion of a project root:
- `find_root()`
- `find_root_file()`
- `make_find_root_file()`
- `make_fix_root_file()`
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->
[rprojroot](https://krlmlr.github.io/rprojroot) [![wercker status](https://app.wercker.com/status/c4dfa136cd78514514e259cc388e880c/s/master "wercker status")](https://app.wercker.com/project/bykey/c4dfa136cd78514514e259cc388e880c) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master)
[rprojroot](https://krlmlr.github.io/rprojroot) [![wercker status](https://app.wercker.com/status/c4dfa136cd78514514e259cc388e880c/s/master "wercker status")](https://app.wercker.com/project/bykey/c4dfa136cd78514514e259cc388e880c) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master)
=======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

This package helps accessing files relative to a *project root* to [stop the working directory insanity](https://gist.github.com/jennybc/362f52446fe1ebc4c49f).
Expand Down Expand Up @@ -32,7 +32,7 @@ Installation and further reading
Install from GitHub:

``` r
devtools::install("krlmlr/rprojroot")
devtools::install_github("krlmlr/rprojroot")
```

See the [vignette](http://krlmlr.github.io/rprojroot/vignettes/rprojroot.html) for more detail.
1 change: 0 additions & 1 deletion makeR
Submodule makeR deleted from 4a79b0
206 changes: 206 additions & 0 deletions makeR/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
R := R --no-save --no-restore
RSCRIPT := Rscript
DELETE := rm -fR
PKGNAME := $(shell Rscript ./makeR/get-pkg-name)
VERSION := $(shell Rscript ./makeR/get-pkg-version)
TARGZ := $(PKGNAME)_$(VERSION).tar.gz

.SILENT:

.FORCE:

usage:
echo "Available targets:"
echo ""
echo " clean - Clean everything up"
echo " bump-cran - Bump second digit of version (0.1 -> 0.2) and tag"
echo " bump-gh - Bump third digit of version (0.1.2 -> 0.1.3) and tag"
echo " bump - Bump fourth digit of version (0.1.2.3 -> 0.1.2.4) and tag"
echo " rd - Create documentation via roxygen2"
echo " install - Install dependencies"
echo " dependencies "
echo " dt_* - Run devtools verb"
echo " test - Run tests"
echo " covr - Check coverage"
echo " lintr - Run lintr"
echo " check-rev-dep - Run a reverse dependency check against packages on CRAN"
echo " check-rd-files - Run Rd2pdf on each doc file to track hard-to-spot doc/latex errors"
echo " winbuilder - Ask for email and build on winbuilder"
echo " init-gh-pages - Initialize orphan gh-pages branch"
echo " staticdocs - Build staticdocs in inst/web"
echo " gh-pages-build - Populate gh-pages branch with staticdocs"
echo " gh-pages-push - Push gh-pages branch to GitHub Pages"
echo " view-docs - View staticdocs locally"
echo " init-wercker - Install a default wercker.yml"
echo " wercker-build - Run wercker build for local instance of docker"
echo " wercker-deploy - Run wercker deploy for local instance of docker"
echo " upgrade - upgrade installation of makeR"
echo " uninstall - uninstall makeR"


## Script targers

git-is-clean branch-is-master init-gh-pages init-staticdocs gh-pages-build postinstall init-wercker:
sh ./makeR/$@



## devtools targets:

# ls("package:devtools") %>% setNames(nm=.) %>% lapply(get) %>% lapply(formals) %>% lapply(`[`, 1) %>% lapply(names) %>% equals("pkg") %>% Filter(isTRUE, .) %>% names %>% sprintf("dt_%s", .) %>% cat
dt_add_rstudio_project dt_add_test_infrastructure dt_add_travis dt_bash dt_build dt_build_vignettes dt_build_win dt_check dt_check_doc dt_clean_dll dt_clean_vignettes dt_compile_dll dt_document dt_imports_env dt_install dt_install_deps dt_lint dt_load_all dt_load_code dt_load_data dt_load_dll dt_missing_s3 dt_ns_env dt_parse_ns_file dt_pkg_env dt_release dt_release_checks dt_reload dt_revdep dt_revdep_check dt_revdep_maintainers dt_run_examples dt_show_news dt_submit_cran dt_test dt_unload dt_use_appveyor dt_use_cran_comments dt_use_data_raw dt_use_package_doc dt_use_rcpp dt_use_readme_rmd dt_use_revdep dt_use_rstudio dt_use_testthat dt_use_travis dt_wd:

dt_%: git-is-clean
Rscript -e "devtools::$(subst dt_,,$@)()"
git add .
git commit -m "$(subst dt_,,$@)"



## Helper targers

git-is-clean:

branch-is-master: git-is-clean

tag:
(echo Release v$$(sed -n -r '/^Version: / {s/.* ([0-9.-]+)$$/\1/;p}' DESCRIPTION); echo; sed -n '/^===/,/^===/{:a;N;/\n===/!ba;p;q}' NEWS.md | head -n -3 | tail -n +3) | git tag -a -F /dev/stdin v$$(sed -n -r '/^Version: / {s/.* ([0-9.-]+)$$/\1/;p}' DESCRIPTION)

bump-cran-desc: git-is-clean rd
crant -u 2 -C

bump-gh-desc: git-is-clean rd
crant -u 3 -C

bump-desc: git-is-clean rd
test "$$(git status --porcelain | wc -c)" = "0"
sed -i -r '/^Version: / s/( [0-9.]+)$$/\1-0.0/' DESCRIPTION
git add DESCRIPTION
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "add suffix -0.0 to version"
crant -u 4 -C

inst/NEWS.Rd: git-is-clean NEWS.md
Rscript -e "tools:::news2Rd('$(word 2,$^)', '$@')"
sed -r -i 's/`([^`]+)`/\\code{\1}/g' $@
git add $@
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "update NEWS.Rd"

inst/web:
mkdir -p inst
git branch gh-pages origin/gh-pages || true
git clone --branch gh-pages . inst/web



## Cleanup

clean:
echo "Cleaning up ..."
${DELETE} src/*.o src/*.so *.tar.gz
${DELETE} *.Rcheck
${DELETE} .RData .Rhistory



## Tagging

bump-cran: bump-cran-desc inst/NEWS.Rd tag

bump-gh: bump-gh-desc inst/NEWS.Rd tag

bump: bump-desc inst/NEWS.Rd tag



## Documentation

rd: git-is-clean
Rscript -e "library(methods); devtools::document()"
git add man/ NAMESPACE
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "document"



## Testing

dependencies-hook:

install dependencies: dependencies-hook
Rscript -e "sessionInfo()"
Rscript -e "options(repos = c(CRAN = 'http://cran.rstudio.com')); devtools::install_deps(dependencies = TRUE, upgrade = FALSE)"

test:
Rscript -e "devtools::check(document = TRUE, check_dir = '.', cleanup = FALSE)"
! egrep -A 5 "ERROR|WARNING|NOTE" *.Rcheck/00check.log

covr:
Rscript -e 'if (!requireNamespace("covr")) devtools::install_github("jimhester/covr"); covr::codecov()'

lintr:
Rscript -e 'Sys.setenv(LINTR_COMMENT_BOT="FALSE"); if (!requireNamespace("lintr")) devtools::install_github("jimhester/lintr"); lintr::lint_package()'

check-rev-dep:
echo "Running reverse dependency checks for CRAN ..."
${RSCRIPT} ./makeR/check-rev-dep

check-rd-files: rd
echo "Checking RDs one by one ..."
${RSCRIPT} ./makeR/check-rd-files

winbuilder: rd
echo "Building via winbuilder"
${RSCRIPT} ./makeR/winbuilder



# staticdocs

gh-pages-init:

init-staticdocs:

staticdocs: inst/web
Rscript -e 'if (!requireNamespace("staticdocs")) devtools::install_github("gaborcsardi/staticdocs"); staticdocs::build_site()'

gh-pages-build: staticdocs

gh-pages-push:
git push origin gh-pages

view-html-vignettes:
chromium-browser inst/doc/*.html

view-docs:
chromium-browser inst/web/index.html



## wercker

init-wercker: git-is-clean

wercker-build:
wercker build --docker-host=unix://var/run/docker.sock --no-remove

wercker-deploy:
wercker deploy --docker-host=unix://var/run/docker.sock --no-remove



## Maintenance

postinstall: git-is-clean

upgrade: git-is-clean
echo "Upgrading makeR"
sh ./makeR/upgrade

uninstall: git-is-clean
echo "Uninstalling makeR"
sh ./makeR/uninstall


## Obsolete

init:
true
2 changes: 2 additions & 0 deletions makeR/Makefile.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-include makeR/Makefile
-include Makefile.in
36 changes: 36 additions & 0 deletions makeR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## makeR

Makefile and tools for R packages

This is a git submodule we include in our R packages to have a Makefile and some tools for package building, testing and documentation generation. Including this as a submodule in other projects enables us to hold the code for this in one central place (i.e., here) without copy-paste horror.

The submodule is always included under the path 'makeR' in the respective package repositories, e.g., look here:
https://github.com/berndbischl/BBmisc

### Upgrading

The installation method has switched from submodules to subtrees. To upgrade an existing submodule-based installation, please run `make uninistall` first; you may also want to remove the `.gitmodules` file if you do not use other submodules. After switching, you can run `make upgrade` as usual for further upgrades.


### Installing the subtree

Execute the following in a terminal:

```
curl http://krlmlr.github.io/makeR/install2 | sh
```

Take a look at [the installer script](https://github.com/krlmlr/makeR/blob/gh-pages/install2) if you're curious.


### Updating makeR

If you want to update the makeR tool chain, run:

```
make upgrade
```




5 changes: 5 additions & 0 deletions makeR/branch-is-master
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -e

test $(git rev-parse --abbrev-ref HEAD) = "master"
Loading

0 comments on commit 3187dfb

Please sign in to comment.