Grunt task options can work on a global level.

This commit is contained in:
Mayhem 2013-09-07 13:05:19 +02:00
parent 2f2aedb70e
commit 995695bcef

View File

@ -1,21 +1,14 @@
module.exports = (grunt) -> module.exports = (grunt) ->
concatOptions =
process: Object.create(null, data:
get: -> grunt.config 'pkg'
enumerable: true
)
shellOptions =
stdout: true
stderr: true
failOnError: true
# Project configuration. # Project configuration.
grunt.initConfig grunt.initConfig
pkg: grunt.file.readJSON 'package.json' pkg: grunt.file.readJSON 'package.json'
concat: concat:
options: process: Object.create(null, data:
get: -> grunt.config 'pkg'
enumerable: true
)
coffee: coffee:
options: concatOptions
src: [ src: [
'src/General/Config.coffee' 'src/General/Config.coffee'
'src/General/Globals.coffee' 'src/General/Globals.coffee'
@ -46,7 +39,6 @@ module.exports = (grunt) ->
] ]
dest: 'tmp-<%= pkg.type %>/script.coffee' dest: 'tmp-<%= pkg.type %>/script.coffee'
crx: crx:
options: concatOptions
files: files:
'builds/crx/manifest.json': 'src/Meta/manifest.json' 'builds/crx/manifest.json': 'src/Meta/manifest.json'
'builds/crx/script.js': [ 'builds/crx/script.js': [
@ -55,7 +47,6 @@ module.exports = (grunt) ->
'tmp-<%= pkg.type %>/script.js' 'tmp-<%= pkg.type %>/script.js'
] ]
userscript: userscript:
options: concatOptions
files: files:
'builds/<%= pkg.name %>.meta.js': 'src/Meta/metadata.js' 'builds/<%= pkg.name %>.meta.js': 'src/Meta/metadata.js'
'builds/<%= pkg.name %>.user.js': [ 'builds/<%= pkg.name %>.user.js': [
@ -83,8 +74,11 @@ module.exports = (grunt) ->
createTag: false createTag: false
push: false push: false
shell: shell:
options:
stdout: true
stderr: true
failOnError: true
commit: commit:
options: shellOptions
command: [ command: [
'git checkout <%= pkg.meta.mainBranch %>' 'git checkout <%= pkg.meta.mainBranch %>'
'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."' 'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."'
@ -92,12 +86,11 @@ module.exports = (grunt) ->
'git tag -af stable-v3 -m "<%= pkg.meta.name %> v<%= pkg.version %>."' 'git tag -af stable-v3 -m "<%= pkg.meta.name %> v<%= pkg.version %>."'
].join ' && ' ].join ' && '
push: push:
options: shellOptions
command: 'git push origin --tags -f && git push origin --all' command: 'git push origin --tags -f && git push origin --all'
watch: watch:
options:
interrupt: true
all: all:
options:
interrupt: true
files: [ files: [
'Gruntfile.coffee' 'Gruntfile.coffee'
'package.json' 'package.json'