# Sample .travis.yml for R projects

language: r
cache: apt
warnings_are_errors: false
sudo: required
before_install:
  - Rscript -e 'install.packages(c("stringi","magrittr"), repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages(c("stringr",  "colorspace"), repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("reshape2", repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("munsell", repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("scales", repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("ggplot2", repos = "http://cran.rstudio.com")'
  - Rscript -e 'install.packages("knitr", repos = "http://cran.rstudio.com")'
  - R -e 'install.packages("rgdal", repos=c("http://R-Forge.R-project.org", "http://cran.rstudio.com"))'

addons:
  apt:
    update: true
    sources:
      - sourceline: 'ppa:opencpu/imagemagick'
      - sourceline: 'ppa:ubuntugis/ppa'
    packages:
      - libmagick++-dev
      - librsvg2-dev
      - libwebp-dev
      - libpoppler-cpp-dev
      - libtesseract-dev
      - libleptonica-dev
      - tesseract-ocr-eng
      - r-cran-rgdal
      - libfftw3-dev
      - cargo

env:
 global:
   - CRAN: http://cran.rstudio.com

notifications:
  email:
    on_success: change
    on_failure: change

script: 
  - |
    travis_wait 20 R CMD build .
    travis_wait 20 R CMD check sensiPhy*tar.gz