# what goes in here? anything configurable in a grunt task can be saved here
# and used in a task using the `config` merge field. ie, getting all js files
# would be done like so:
#
# <code>
# {
#     files: '<%= config.files.js.all %>'
# }
# </code>

# directories to load imports from
options:
  - ./vendor/minond/scaffold/grunt/options/

# grunt task aliases
aliases:
  default:
    - 'build'
  prepare:
    - 'mkdir:build'
  compile:
    - 'sass:all'
  server:
    - 'connect:server'
  build:
    - 'clean'
    - 'prepare'
    - 'compile'
  documentation:
    - 'yuidoc:all'
    - 'exec:apigen'
    - 'apidoc:all'
  ci:
    - 'quality'
    - 'test'
    - 'documentation'
  test:
    - 'test:unit'
    - 'test:integration'
  test:integration:
    - 'prepare'
    - 'exec:behat'
  test:unit:
    - 'test:unit:js'
    - 'test:unit:php'
  test:unit:js:
    - 'jasmine:all'
    - 'exec:mocha'
  test:unit:php:
    - 'phpunit:all'
  quality:
    - 'prepare'
    - 'complexity:all'
    - 'htmlhint:all'
    - 'jshint:all'
    - 'jshint:report'
    - 'exec:scsslint'
    - 'exec:phpcpd'
    - 'exec:phpdcd'
    - 'exec:phpmd'
    - 'phpcs:all'
    - 'spell:all'

# application's file/directory structure. should be broken up into type or
# foraat of the file
files:
  views:
    dir: public/views
    all: public/**/*.html
  js:
    dir: app
    all: app/**/*.js
  php:
    dir: app
    all: app/**/*.php
  css:
    all: public/css/**/*.css
    dest: public/css
  sass:
    all: public/scss/**/*.scss
    dir: public/scss
    deps:
      - public/vendor/foundation/scss
  tests:
    dir: tests
    php: tests/**/*.php
    js:
      backend_unit_dir: tests/unit/backend
      all: tests/unit/**/*.js
      helpers: tests/helpers/*_helper.js
      mocks: tests/mocks/*_mock.js
  configuration:
    phpunit: vendor/minond/scaffold/config/phpunit.xml
    jshint: vendor/minond/scaffold/config/jshintrc.json
    htmlhint: vendor/minond/scaffold/config/htmlhintrc.json
  vendor:
    js: []
  spelling:
    - README*
    - docs/**

# output destination of any build task. should be grouped by the type of the
# task that generates the output (ie. a test, auto documentation, etc.)
artifacts:
  linters:
    jshint: build/code/lint/js/checkstyle.xml
    complexity: build/code/quality/js/checkstyle.xml
    scsslint: build/code/lint/scss/linter.xml
    phpmd: build/code/quality/php/mess.xml
    phpcs: build/code/lint/php/psr2.txt
  documentation:
    apigen: build/code/documentation/php
    apidoc: build/code/documentation/rest
    yuidoc: build/code/documentation/js
  tests:
    behat:
      junit: build/tests/integration/junit
      html: build/tests/integration/html/index.html
    jasmine:
      coverage: build/tests/js/converage.json
      junit: build/tests/js/junit
      report: build/tests/js/report/
    # does not check these settings. see config/phpunit.xml
    mocha:
      report: build/tests/js/report/
    phpunit:
      coverage: ../build/tests/php/coverage.xml
      junit: ../build/tests/php/junit/junit.xml
      report: ../build/tests/php/report
  cleanup:
    - build
  create:
    - build/code/quality/php
    - build/code/quality/js
    - build/code/lint/php
    - build/code/lint/scss/
    - build/tests/integration/junit
    - build/tests/integration/html

# additional option configuration
option:
  documentation:
    yuidoc:
      themedir: node_modules/grunt-contrib-yuidoc/node_modules/yuidocjs/themes/simple

binaries:
  mocha: node_modules/.bin/mocha
  _mocha: node_modules/.bin/_mocha
  scsslint: scss-lint
  phpmd: bin/phpmd
  phpcpd: bin/phpcpd
  phpdcd: bin/phpdcd
  behat: bin/behat
  apigen: apigen
  phantomjs: node_modules/.bin/phantomjs
  istanbul: node_modules/.bin/istanbul
