Skip to content

Commit

Permalink
Merge branch 'hotfix/nchar'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Apr 28, 2015
2 parents 22b7c0c + 484e179 commit d5a1f66
Show file tree
Hide file tree
Showing 17 changed files with 306 additions and 87 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
^.svn
^.git
^.make
OVERVIEW[.]md
README[.]md

#----------------------------
Expand Down
69 changes: 53 additions & 16 deletions .make/.travis.yml.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,39 @@ pd <- local({

pkg <- function() pd()$Package

deps <- function(what=c("Depends", "Imports", "Suggests")) {
deps <- function(what=c("Depends", "Imports", "Suggests", "SuggestsNote")) {
deps <- unlist(pd()[what], use.names=FALSE)
if (length(deps) == 0) return("")
deps <- unlist(strsplit(deps, split=","), use.names=FALSE)
deps <- gsub("[(].*[)]", "", deps)
deps <- unlist(strsplit(deps, split="[,:]"), use.names=FALSE)
deps <- gsub("[ \n\t]", "", deps)
deps <- setdiff(deps, c("R", "base", "datasets", "graphics", "grDevices", "methods", "parallel", "stats", "tcltk", "tools", "utils"))
deps <- gsub("[(].*[)]", "", deps)
deps <- setdiff(deps, c("R", "base", "datasets", "graphics", "grDevices", "methods", "parallel", "splines", "stats", "tcltk", "tools", "utils", "Recommended"))
sort(deps)
}

deps_on_R <- function() {
deps <- unlist(pd(), use.names=FALSE)
if (length(deps) == 0) return("")
deps <- unlist(strsplit(deps, split="[,:]"), use.names=FALSE)
deps <- gsub("^([ \n\t]+|[ \n\t]+$)", "", deps)
deps <- grep("^R[ ]*[(].*[)]$", deps, value=TRUE)
if (length(deps) == 0) {
op <- ">="
ver <- "0.0"
} else {
pattern <- ".*[(][ ]*([^0-9 ]*)[ ]*(.*)[)]$"
op <- gsub(pattern, "\\1", deps)
if (nchar(op) == 0L) op <- "=="
ver <- gsub(pattern, "\\2", deps)
}
comp <- eval(parse(text=sprintf("function(ver) { package_version(ver) %s package_version('%s') }", op, ver)))
list(op=op, ver=ver, comp=comp)
}

support_R <- function(ver) {
deps_on_R()$comp(ver)
}

cran <- local({
pkgs <- NULL
function() {
Expand All @@ -43,7 +66,14 @@ bioc <- local({
if (is.null(pkgs)) {
repos <- "http://www.bioconductor.org/packages/devel/bioc/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgs <<- rownames(data)
pkgsA <- rownames(data)
repos <- "http://www.bioconductor.org/packages/devel/data/annotation/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgsB <- rownames(data)
repos <- "http://www.bioconductor.org/packages/devel/data/experiment/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgsC <- rownames(data)
pkgs <<- c(pkgsA, pkgsB, pkgsC)
}
pkgs
}
Expand Down Expand Up @@ -107,10 +137,15 @@ env:

# R versions r-builder should test on (ignored by r-travis)
matrix:
# - RVERSION=3.0.3
# - RVERSION=3.1.2
# - RVERSION=devel _R_CHECK_FULL_=FALSE
- RVERSION=devel _R_CHECK_FULL_=TRUE
<%
rversion <- c(
"3.1.3" = "3.1.3",
"3.2.0" = "3.2.0",
"3.3.0" = "devel _R_CHECK_FULL_=TRUE"
)
for (v in names(rversion))
if (support_R(v)) cat(sprintf(" - RVERSION=%s\n", rversion[v]))
%>


before_install:
Expand All @@ -125,21 +160,23 @@ before_install:
fi

install:
<%= install_cran(c("Depends", "Imports")) %>
<%= install_bioc(c("Depends", "Imports")) %>
<%= install_cran("Suggests") %>
<%= install_bioc("Suggests") %>
<%= install_bioc(c("Suggests", "SuggestsNote")) %>
<%= install_cran(c("Depends", "Imports")) %>
<%= install_cran(c("Suggests", "SuggestsNote")) %>

script:
- $RENV run_build
- $RENV run_check

after_success:
- $RENV dump_logs_by_extension out
- $RENV install_devtools
- $RENV install_github HenrikBengtsson/covr
- curl -OL https://raw.githubusercontent.com/HenrikBengtsson/covr-utils/master/covr-utils.R
- $RENV run_script .coveralls.R
- if [ -f ".coveralls.R" ]; then
$RENV install_devtools;
$RENV install_github HenrikBengtsson/covr;
curl -OL https://raw.githubusercontent.com/HenrikBengtsson/covr-utils/master/covr-utils.R;
$RENV run_script .coveralls.R;
fi

after_failure:
- $RENV dump_logs
Expand Down
4 changes: 2 additions & 2 deletions .make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ refresh_%:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# GitHub, Travis CI, ...
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
README.md: .utils/README.md.rsp
README.md: .make/README.md.rsp
$(R_SCRIPT) -e "R.rsp::rfile('$<', postprocess=FALSE)"

.travis.yml: .utils/.travis.yml.rsp
.travis.yml: .make/.travis.yml.rsp
$(R_SCRIPT) -e "R.rsp::rfile('$<', postprocess=FALSE)"
23 changes: 17 additions & 6 deletions .make/README.md.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ pkg <- local({
}
})

pkg_title <- local({
title <- NULL
function() {
if (is.null(title)) {
pd <- as.list(as.data.frame(read.dcf("DESCRIPTION"), stringsAsFactors=FALSE))
title <<- pd$Title
}
title
}
})

cran <- local({
available <- NULL
function() {
Expand Down Expand Up @@ -63,7 +74,7 @@ repos_status <- function() {

travis <- function() {
if (!file.exists(".travis.yml")) return("")
sprintf('<a href="https://travis-ci.org/%s"><img src="https://travis-ci.org/%s.svg?branch=master" alt="Build status"></a>', github_repos(), github_repos())
sprintf('<a href="https://travis-ci.org/%s"><img src="https://travis-ci.org/%s.svg" alt="Build status"></a>', github_repos(), github_repos())
}

appveyor <- function() {
Expand All @@ -80,25 +91,25 @@ coveralls <- function() {
sprintf('<a href="https://coveralls.io/r/%s"><img src="https://coveralls.io/repos/%s/badge.png?branch=develop" alt="Coverage Status"/></a>', github_repos(), github_repos())
}
%>
# R package: <%=pkg()%>
# <%=pkg()%>: <%=pkg_title()%>

<% if (file.exists("OVERVIEW.md")) { R.rsp::rcat(file="OVERVIEW.md") } %>

## Installation
<% if (cran()) { %>
Package is available on [CRAN](http://cran.r-project.org/package=<%=pkg()%>). Install in R as:
R package <%=pkg()%> is available on [CRAN](http://cran.r-project.org/package=<%=pkg()%>) and can be installed in R as:
```r
install.packages('<%=pkg()%>')
```
<% } else if (bioc()) { %>
Package is available on [Bioconductor](http://www.bioconductor.org/packages/devel/bioc/html/<%=pkg()%>.html). Install in R as:
R package <%=pkg()%> is available on [Bioconductor](http://www.bioconductor.org/packages/devel/bioc/html/<%=pkg()%>.html) and can be installed in R as:

```r
source('http://bioconductor.org/biocLite.html')
source('http://bioconductor.org/biocLite.R')
biocLite('<%=pkg()%>')
```
<% } else { %>
Package is only available via [GitHub](https://github.com/<%=github_repos()%>). Install in R as:
R package <%=pkg()%> is only available via [GitHub](https://github.com/<%=github_repos()%>) and can be installed in R as:
```r
source('http://callr.org/install#<%=github_repos()%>')
```
Expand Down
145 changes: 145 additions & 0 deletions .make/appveyor.yml.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<%------------------------------------------------------------------------
Usage:
yml <- R.rsp::rfile(".travis.yml.rsp")
------------------------------------------------------------------------%>
<%
pd <- local({
pd <- NULL
function() {
if (is.null(pd)) {
pd <<- as.list(as.data.frame(read.dcf("DESCRIPTION"), stringsAsFactors=FALSE))
}
pd
}
})

pkg <- function() pd()$Package

deps <- function(what=c("Depends", "Imports", "Suggests", "SuggestsNote")) {
deps <- unlist(pd()[what], use.names=FALSE)
if (length(deps) == 0) return("")
deps <- unlist(strsplit(deps, split="[,:]"), use.names=FALSE)
deps <- gsub("[(].*[)]", "", deps)
deps <- gsub("[ \n\t]", "", deps)
deps <- setdiff(deps, c("R", "base", "datasets", "graphics", "grDevices", "methods", "parallel", "splines", "stats", "tcltk", "tools", "utils", "Recommended"))
sort(deps)
}

cran <- local({
pkgs <- NULL
function() {
if (is.null(pkgs)) {
repos <- "http://cran.r-project.org"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgs <<- rownames(data)
}
pkgs
}
})

bioc <- local({
pkgs <- NULL
function() {
if (is.null(pkgs)) {
repos <- "http://www.bioconductor.org/packages/devel/bioc/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgsA <- rownames(data)
repos <- "http://www.bioconductor.org/packages/devel/data/annotation/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgsB <- rownames(data)
repos <- "http://www.bioconductor.org/packages/devel/data/experiment/"
data <- available.packages(contriburl=contrib.url(repos, "source"))
pkgsC <- rownames(data)
pkgs <<- c(pkgsA, pkgsB, pkgsC)
}
pkgs
}
})

deps_on_cran <- function(...) {
deps <- deps(...)
deps[deps %in% cran()]
}

deps_on_bioc <- function(...) {
deps <- deps(...)
deps[deps %in% bioc()]
}

deps_elsewhere <- function(...) {
deps <- deps(...)
deps[!deps %in% c(cran(), bioc())]
}

install_cran <- function(...) {
pkgs <- deps_on_cran(...)
if (length(pkgs) > 0L) {
sprintf(" - travis-tool.sh install_r %s", paste(pkgs, collapse=" "))
} else ""
}

install_bioc <- function(...) {
pkgs <- deps_on_bioc(...)
if (length(pkgs) > 0L) {
sprintf(" - travis-tool.sh install_bioc %s", paste(pkgs, collapse=" "))
} else ""
}
%>
#----------------------------------------------------------------
# AppVeyor configuration for R packages
#
# REFERENCES:
# * AppVeyor CI: https://ci.appveyor.com/
# * r-travis: https://github.com/craigcitro/r-travis
# * covr: https://github.com/jimhester/covr
# * Coveralls: https://coveralls.io/
#
# Validate your .appveyor.yml file at
# https://ci.appveyor.com/tools/validate-yaml
#----------------------------------------------------------------
environment:
_R_CHECK_FORCE_SUGGESTS_: false

# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
init:
ps: |
$ErrorActionPreference = "Stop"
Invoke-WebRequest http://raw.github.com/HenrikBengtsson/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
Import-Module '..\appveyor-tool.ps1'
install:
ps: Bootstrap

# Adapt as necessary starting from here

build_script:
<%= install_bioc(c("Depends", "Imports")) %>
<%= install_bioc(c("Suggests", "SuggestsNote")) %>
<%= install_cran(c("Depends", "Imports")) %>
<%= install_cran(c("Suggests", "SuggestsNote")) %>

test_script:
- travis-tool.sh run_tests

on_failure:
- travis-tool.sh dump_logs

artifacts:
- path: '*.Rcheck\**\*.log'
name: Logs

- path: '*.Rcheck\**\*.out'
name: Logs

- path: '*.Rcheck\**\*.fail'
name: Logs

- path: '*.Rcheck\**\*.Rout'
name: Logs

- path: '\*_*.tar.gz'
name: Bits

- path: '\*_*.zip'
name: Bits
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ env:

# R versions r-builder should test on (ignored by r-travis)
matrix:
# - RVERSION=3.0.3
# - RVERSION=3.1.2
# - RVERSION=devel _R_CHECK_FULL_=FALSE
- RVERSION=3.1.3
- RVERSION=3.2.0
- RVERSION=devel _R_CHECK_FULL_=TRUE


Expand All @@ -45,21 +44,23 @@ before_install:
fi

install:
- $RENV install_r digest R.cache R.methodsS3 R.oo R.utils

- $RENV install_r BatchJobs gtools
- $RENV install_bioc BiocParallel
- $RENV install_r digest R.cache R.methodsS3 R.oo R.utils
- $RENV install_r BatchJobs gtools

script:
- $RENV run_build
- $RENV run_check

after_success:
- $RENV dump_logs_by_extension out
- $RENV install_devtools
- $RENV install_github HenrikBengtsson/covr
- curl -OL https://raw.githubusercontent.com/HenrikBengtsson/covr-utils/master/covr-utils.R
- $RENV run_script .coveralls.R
- if [ -f ".coveralls.R" ]; then
$RENV install_devtools;
$RENV install_github HenrikBengtsson/covr;
curl -OL https://raw.githubusercontent.com/HenrikBengtsson/covr-utils/master/covr-utils.R;
$RENV run_script .coveralls.R;
fi

after_failure:
- $RENV dump_logs
Expand Down
Loading

0 comments on commit d5a1f66

Please sign in to comment.