Build builds concurrently.
This commit is contained in:
parent
8a7d17c9ba
commit
fef23ef18b
31
Gruntfile.js
31
Gruntfile.js
@ -25,7 +25,7 @@ module.exports = function(grunt) {
|
||||
'src/databoard.coffee',
|
||||
'src/main.coffee'
|
||||
],
|
||||
dest: 'tmp/script.coffee'
|
||||
dest: 'tmp-<%= pkg.type %>/script.coffee'
|
||||
},
|
||||
crx: {
|
||||
options: concatOptions,
|
||||
@ -33,7 +33,7 @@ module.exports = function(grunt) {
|
||||
'builds/crx/manifest.json': 'src/manifest.json',
|
||||
'builds/crx/script.js': [
|
||||
'src/banner.js',
|
||||
'tmp/script.js'
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -42,7 +42,7 @@ module.exports = function(grunt) {
|
||||
src: [
|
||||
'src/metadata.js',
|
||||
'src/banner.js',
|
||||
'tmp/script.js'
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
],
|
||||
dest: 'builds/<%= pkg.name %>.js'
|
||||
},
|
||||
@ -53,7 +53,7 @@ module.exports = function(grunt) {
|
||||
'builds/<%= pkg.name %>.user.js': [
|
||||
'src/metadata.js',
|
||||
'src/banner.js',
|
||||
'tmp/script.js'
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -68,10 +68,13 @@ module.exports = function(grunt) {
|
||||
},
|
||||
coffee: {
|
||||
script: {
|
||||
src: 'tmp/script.coffee',
|
||||
dest: 'tmp/script.js'
|
||||
src: 'tmp-<%= pkg.type %>/script.coffee',
|
||||
dest: 'tmp-<%= pkg.type %>/script.js'
|
||||
}
|
||||
},
|
||||
concurrent: {
|
||||
build: ['build-crx', 'build-userjs', 'build-userscript']
|
||||
},
|
||||
exec: {
|
||||
commit: {
|
||||
command: function() {
|
||||
@ -93,7 +96,8 @@ module.exports = function(grunt) {
|
||||
watch: {
|
||||
all: {
|
||||
options: {
|
||||
interrupt: true
|
||||
interrupt: true,
|
||||
nospawn: true
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
@ -121,11 +125,14 @@ module.exports = function(grunt) {
|
||||
},
|
||||
clean: {
|
||||
builds: 'builds',
|
||||
tmp: 'tmp'
|
||||
tmpcrx: 'tmp-crx',
|
||||
tmpuserjs: 'tmp-userjs',
|
||||
tmpuserscript: 'tmp-userscript'
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-coffee');
|
||||
grunt.loadNpmTasks('grunt-contrib-compress');
|
||||
@ -140,28 +147,28 @@ module.exports = function(grunt) {
|
||||
pkg.type = type;
|
||||
grunt.log.ok('pkg.type = %s', type);
|
||||
});
|
||||
grunt.registerTask('build', ['build-crx', 'build-userjs', 'build-userscript']);
|
||||
grunt.registerTask('build', ['concurrent:build']);
|
||||
grunt.registerTask('build-crx', [
|
||||
'set-build:crx',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:crx',
|
||||
'copy:crx',
|
||||
'clean:tmp'
|
||||
'clean:tmpcrx'
|
||||
]);
|
||||
grunt.registerTask('build-userjs', [
|
||||
'set-build:userjs',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:userjs',
|
||||
'clean:tmp'
|
||||
'clean:tmpuserjs'
|
||||
]);
|
||||
grunt.registerTask('build-userscript', [
|
||||
'set-build:userscript',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:userscript',
|
||||
'clean:tmp'
|
||||
'clean:tmpuserscript'
|
||||
]);
|
||||
|
||||
grunt.registerTask('release', ['exec:commit', 'exec:push', 'build-crx', 'compress:crx']);
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-bump": "~0.0.0",
|
||||
"grunt-concurrent": "~0.1.1",
|
||||
"grunt-contrib-clean": "~0.4.0",
|
||||
"grunt-contrib-coffee": "~0.6.6",
|
||||
"grunt-contrib-compress": "~0.4.10",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user