{% set version = '3.0.0' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-covr
  version: {{ version|replace("-", "_") }}

source:
  fn: covr_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/covr_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/covr/covr_{{ version }}.tar.gz
  sha256: 0ab23592eba87260ab1e7b47463fbd484535ba175600314cfa0d8dc96f459c63

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-crayon
    - r-httr
    - r-jsonlite
    - r-rex
    - r-withr >=1.0.2
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-crayon
    - r-httr
    - r-jsonlite
    - r-rex
    - r-withr >=1.0.2
    - libgcc  # [not win]

test:
  commands:
    - $R -e "library('covr')"  # [not win]
    - "\"%R%\" -e \"library('covr')\""  # [win]

about:
  home: https://github.com/jimhester/covr
  license: GPL-3
  summary: Track and report code coverage for your package and (optionally) upload the results
    to a coverage service like 'Codecov' <http://codecov.io> or 'Coveralls' <http://coveralls.io>.
    Code coverage is a measure of the amount of code being exercised by a set of tests.
    It is an indirect measure of test quality and completeness. This package is compatible
    with any testing methodology or framework and tracks coverage of both R code and
    compiled C/C++/FORTRAN code.
  license_family: GPL3
  license_file: '{{ environ["RECIPE_DIR"] }}/LICENSE'

extra:
  recipe-maintainers:
    - jdblischak
    - johanneskoester
    - bgruening
