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