2013-12-16 19:36:32 +04:00
|
|
|
module.exports = (grunt) ->
|
2013-12-20 12:31:12 +04:00
|
|
|
@loadNpmTasks('grunt-browserify')
|
2013-12-20 12:41:38 +04:00
|
|
|
@loadNpmTasks('grunt-bump')
|
2013-12-20 12:31:12 +04:00
|
|
|
@loadNpmTasks('grunt-contrib-clean')
|
2013-12-16 19:36:32 +04:00
|
|
|
@loadNpmTasks('grunt-contrib-jshint')
|
2013-12-20 12:31:12 +04:00
|
|
|
@loadNpmTasks('grunt-contrib-uglify')
|
2013-12-16 19:36:32 +04:00
|
|
|
@loadNpmTasks('grunt-contrib-watch')
|
2014-06-19 16:16:30 +04:00
|
|
|
@loadNpmTasks('grunt-jscs-checker')
|
2013-12-17 17:37:17 +04:00
|
|
|
@loadNpmTasks('grunt-mocha-cli')
|
2013-12-16 19:36:32 +04:00
|
|
|
|
|
|
|
@initConfig
|
2013-12-20 12:31:12 +04:00
|
|
|
clean:
|
|
|
|
dist: ['dist']
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
jshint:
|
2013-12-17 17:37:17 +04:00
|
|
|
all: [ 'lib/*.js', 'test/*.js' ]
|
2013-12-16 19:36:32 +04:00
|
|
|
options:
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
|
2014-06-19 16:16:30 +04:00
|
|
|
jscs:
|
|
|
|
src:
|
|
|
|
options:
|
|
|
|
config: '.jscs.json'
|
|
|
|
files:
|
|
|
|
src: [ 'lib/*.js', 'test/*.js' ]
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
watch:
|
|
|
|
all:
|
2013-12-17 17:37:17 +04:00
|
|
|
options:
|
|
|
|
atBegin: true
|
|
|
|
files: ['lib/**.js', 'test/*{,/*}']
|
2013-12-16 19:36:32 +04:00
|
|
|
tasks: ['test']
|
|
|
|
|
2013-12-17 17:37:17 +04:00
|
|
|
mochacli:
|
|
|
|
options:
|
|
|
|
files: 'test/*.js'
|
|
|
|
spec:
|
|
|
|
options:
|
|
|
|
reporter: 'spec'
|
|
|
|
|
2013-12-20 12:31:12 +04:00
|
|
|
browserify:
|
|
|
|
dist:
|
|
|
|
files:
|
|
|
|
'dist/pofile.js': ['lib/po.js']
|
|
|
|
options:
|
|
|
|
alias: 'lib/po.js:pofile'
|
|
|
|
|
|
|
|
uglify:
|
|
|
|
dist:
|
|
|
|
files:
|
|
|
|
'dist/pofile.min.js': 'dist/pofile.js'
|
|
|
|
|
2013-12-20 12:41:38 +04:00
|
|
|
bump:
|
|
|
|
options:
|
|
|
|
files: ['package.json', 'bower.json']
|
|
|
|
commitFiles: ['-a']
|
|
|
|
pushTo: 'origin'
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
@registerTask 'default', ['test']
|
2014-06-19 16:16:30 +04:00
|
|
|
@registerTask 'build', ['clean', 'jshint', 'jscs', 'browserify', 'uglify']
|
2013-12-17 17:37:17 +04:00
|
|
|
@registerTask 'test', ['build', 'mochacli']
|