mirror of https://github.com/docker/docs.git
Faster grunt commands
This commit is contained in:
parent
4b1d962427
commit
20cce37dc5
31
Gruntfile.js
31
Gruntfile.js
|
@ -15,6 +15,7 @@ module.exports = function (grunt) {
|
||||||
var target = grunt.option('target') || 'development';
|
var target = grunt.option('target') || 'development';
|
||||||
var beta = grunt.option('beta') || false;
|
var beta = grunt.option('beta') || false;
|
||||||
var env = process.env;
|
var env = process.env;
|
||||||
|
env.NODE_PATH = '..:' + env.NODE_PATH;
|
||||||
env.NODE_ENV = target;
|
env.NODE_ENV = target;
|
||||||
|
|
||||||
var version = function (str) {
|
var version = function (str) {
|
||||||
|
@ -57,7 +58,8 @@ module.exports = function (grunt) {
|
||||||
version: packagejson['electron-version'],
|
version: packagejson['electron-version'],
|
||||||
platform: 'win32',
|
platform: 'win32',
|
||||||
arch: 'x64',
|
arch: 'x64',
|
||||||
asar: true
|
asar: true,
|
||||||
|
icon: 'util/kitematic.ico'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
osx: {
|
osx: {
|
||||||
|
@ -76,8 +78,9 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
'create-windows-installer': {
|
'create-windows-installer': {
|
||||||
appDirectory: 'dist/Kitematic-win32/',
|
appDirectory: 'dist/Kitematic-win32/',
|
||||||
outputDirectory: 'installer/',
|
authors: 'Docker Inc.',
|
||||||
authors: 'Docker Inc.'
|
loadingGif: 'util/loading.gif',
|
||||||
|
setupIcon: 'util/kitematic.ico'
|
||||||
},
|
},
|
||||||
|
|
||||||
// docker binaries
|
// docker binaries
|
||||||
|
@ -146,6 +149,13 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
rename: {
|
||||||
|
installer: {
|
||||||
|
src: 'installer/Setup.exe',
|
||||||
|
dest: 'installer/KitematicSetup.exe'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// download binaries
|
// download binaries
|
||||||
curl: {
|
curl: {
|
||||||
docker: {
|
docker: {
|
||||||
|
@ -230,14 +240,13 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
|
|
||||||
clean: {
|
clean: {
|
||||||
dist: ['dist/'],
|
release: ['build/', 'dist/', 'installer/'],
|
||||||
build: ['build/']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// livereload
|
// livereload
|
||||||
watchChokidar: {
|
watchChokidar: {
|
||||||
options: {
|
options: {
|
||||||
spawn: false
|
spawn: true
|
||||||
},
|
},
|
||||||
livereload: {
|
livereload: {
|
||||||
options: {livereload: true},
|
options: {livereload: true},
|
||||||
|
@ -245,22 +254,22 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
js: {
|
js: {
|
||||||
files: ['src/**/*.js'],
|
files: ['src/**/*.js'],
|
||||||
tasks: ['babel']
|
tasks: ['newer:babel']
|
||||||
},
|
},
|
||||||
less: {
|
less: {
|
||||||
files: ['styles/**/*.less'],
|
files: ['styles/**/*.less'],
|
||||||
tasks: ['less']
|
tasks: ['newer:less']
|
||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
files: ['images/*', 'index.html', 'fonts/*'],
|
files: ['images/*', 'index.html', 'fonts/*'],
|
||||||
tasks: ['copy']
|
tasks: ['newer:copy:dev']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
grunt.registerTask('default', ['download-binary', 'babel', 'less', 'copy:dev', 'shell:electron', 'watchChokidar']);
|
grunt.registerTask('default', ['download-binary', 'newer:babel', 'newer:less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']);
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
grunt.registerTask('release', ['clean:dist', 'clean:build', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'copy:osx']);
|
grunt.registerTask('release', ['clean', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'create-windows-installer', 'rename:installer']);
|
||||||
} else {
|
} else {
|
||||||
grunt.registerTask('release', ['clean:dist', 'clean:build', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:osx', 'copy:osx', 'shell:sign', 'shell:zip']);
|
grunt.registerTask('release', ['clean:dist', 'clean:build', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:osx', 'copy:osx', 'shell:sign', 'shell:zip']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,8 @@
|
||||||
"grunt-download-electron": "^2.1.1",
|
"grunt-download-electron": "^2.1.1",
|
||||||
"grunt-electron": "^1.0.0",
|
"grunt-electron": "^1.0.0",
|
||||||
"grunt-electron-installer": "^0.33.0",
|
"grunt-electron-installer": "^0.33.0",
|
||||||
|
"grunt-newer": "^1.1.1",
|
||||||
|
"grunt-rename": "^0.1.4",
|
||||||
"grunt-shell": "^1.1.2",
|
"grunt-shell": "^1.1.2",
|
||||||
"grunt-shell-spawn": "^0.3.8",
|
"grunt-shell-spawn": "^0.3.8",
|
||||||
"jest-cli": "^0.4.5",
|
"jest-cli": "^0.4.5",
|
||||||
|
|
Loading…
Reference in New Issue