Adding mac os x

This commit is contained in:
Jeffrey Morgan 2015-06-09 17:56:08 -07:00
parent 140ae4671b
commit 5f8776c0ee
2 changed files with 44 additions and 29 deletions

View File

@ -1,6 +1,7 @@
var path = require('path'); var path = require('path');
var execFile = require('child_process').execFile; var execFile = require('child_process').execFile;
var packagejson = require('./package.json'); var packagejson = require('./package.json');
var electron = require('electron-prebuilt');
var WINDOWS_DOCKER_URL = 'https://get.docker.com/builds/Windows/x86_64/docker-1.6.2.exe'; var WINDOWS_DOCKER_URL = 'https://get.docker.com/builds/Windows/x86_64/docker-1.6.2.exe';
var DARWIN_DOCKER_URL = 'https://get.docker.com/builds/Darwin/x86_64/docker-' + packagejson['docker-version']; var DARWIN_DOCKER_URL = 'https://get.docker.com/builds/Darwin/x86_64/docker-' + packagejson['docker-version'];
@ -36,9 +37,35 @@ module.exports = function (grunt) {
grunt.initConfig({ grunt.initConfig({
// electron // electron
'download-electron': { electron: {
windows: {
options: {
name: 'Kitematic',
dir: 'build/',
out: 'dist/',
version: packagejson['electron-version'], version: packagejson['electron-version'],
outputDir: 'cache' platform: 'win32',
arch: 'x64',
asar: true
}
},
osx: {
options: {
name: 'Kitematic',
dir: 'build/',
out: 'dist/osx/',
version: packagejson['electron-version'],
platform: 'darwin',
arch: 'x64',
asar: true
}
}
},
'create-windows-installer': {
appDirectory: 'dist/Kitematic-win32/',
outputDirectory: 'installer/',
authors: 'Docker Inc.'
}, },
// docker binaries // docker binaries
@ -55,27 +82,6 @@ module.exports = function (grunt) {
} }
}, },
// electron
electron: {
windows: {
options: {
name: 'Kitematic',
dir: 'build/',
out: 'dist/',
version: packagejson['electron-version'],
platform: 'win32',
arch: 'x64',
asar: true
}
}
},
'create-windows-installer': {
appDirectory: 'dist/Kitematic-win32/',
outputDirectory: 'installer/',
authors: 'Docker Inc.'
},
// images // images
copy: { copy: {
dev: { dev: {
@ -101,12 +107,20 @@ module.exports = function (grunt) {
expand: true expand: true
}] }]
}, },
release: { windows: {
files: [{
expand: true,
cwd: 'resources',
src: ['docker*', 'boot2docker.iso'],
dest: 'dist/Kitematic-win32/resources/resources/'
}]
},
osx: {
files: [{ files: [{
expand: true, expand: true,
cwd: 'resources', cwd: 'resources',
src: ['**/*'], src: ['**/*'],
dest: 'dist/Kitematic-win32/resources/resources/' dest: 'dist/osx/Kitematic.app/resources/'
}] }]
} }
}, },
@ -170,7 +184,7 @@ module.exports = function (grunt) {
shell: { shell: {
electron: { electron: {
command: path.join('cache', 'electron') + ' ' + 'build', command: electron + ' ' + 'build',
options: { options: {
async: true, async: true,
execOptions: { execOptions: {
@ -205,6 +219,6 @@ module.exports = function (grunt) {
} }
} }
}); });
grunt.registerTask('default', ['download-electron', 'download-binary', 'babel', 'less', 'copy:dev', 'shell:electron', 'watchChokidar']); grunt.registerTask('default', ['download-binary', 'babel', 'less', 'copy:dev', 'shell:electron', 'watchChokidar']);
grunt.registerTask('release', ['clean:dist', 'clean:build', 'download-binary', 'babel', 'less', 'copy:dev', 'electron', 'copy:release']); grunt.registerTask('release', ['clean:dist', 'clean:build', 'download-binary', 'babel', 'less', 'copy:dev', 'electron', 'copy:windows', 'copy:mac']);
}; };

View File

@ -67,6 +67,7 @@
"devDependencies": { "devDependencies": {
"babel": "^5.1.10", "babel": "^5.1.10",
"babel-jest": "^5.2.0", "babel-jest": "^5.2.0",
"electron-prebuilt": "^0.27.3",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-babel": "^5.0.1", "grunt-babel": "^5.0.1",
"grunt-chmod": "^1.0.3", "grunt-chmod": "^1.0.3",