Commit 628c0bdd authored by 神楽坂玲奈's avatar 神楽坂玲奈

Merge pull request #13 from disoul/feature/linux

grunt debian 打包
parents dc7a6227 f93ee227
...@@ -12,6 +12,10 @@ module.exports = (grunt) => { ...@@ -12,6 +12,10 @@ module.exports = (grunt) => {
grunt.loadNpmTasks('grunt-electron-installer'); grunt.loadNpmTasks('grunt-electron-installer');
release_task = ['electron:win32-ia32', 'electron:win32-x64', 'create-windows-installer:ia32', 'create-windows-installer:x64', 'copy:bundle-ia32', 'copy:bundle-x64', 'create-windows-installer:bundle-ia32', 'create-windows-installer:bundle-x64']; release_task = ['electron:win32-ia32', 'electron:win32-x64', 'create-windows-installer:ia32', 'create-windows-installer:x64', 'copy:bundle-ia32', 'copy:bundle-x64', 'create-windows-installer:bundle-ia32', 'create-windows-installer:bundle-x64'];
break; break;
// FIXME: case 'ubuntu or debain'
case 'linux':
grunt.loadNpmTasks('grunt-electron-installer-debian');
release_task = ['electron:linux-ia32', 'electron:linux-x64', 'electron-installer-debian'];
} }
grunt.initConfig({ grunt.initConfig({
...@@ -33,6 +37,14 @@ module.exports = (grunt) => { ...@@ -33,6 +37,14 @@ module.exports = (grunt) => {
src: ['package.json', 'README.txt', 'LICENSE.txt', 'main.js', 'apps.js', 'index.html', 'css/**', 'font/**', 'js/**'], src: ['package.json', 'README.txt', 'LICENSE.txt', 'main.js', 'apps.js', 'index.html', 'css/**', 'font/**', 'js/**'],
dest: 'build2/win32-x64' dest: 'build2/win32-x64'
}, },
'app-linux': {
expand: true,
options: {
timestamp: true
},
src: ['package.json', 'README.txt', 'LICENSE.txt', 'main.js', 'apps.js', 'index.html', 'css/**', 'font/**', 'js/**'],
dest: 'build2'
},
'node_modules-ia32': { 'node_modules-ia32': {
expand: true, expand: true,
options: { options: {
...@@ -101,6 +113,25 @@ module.exports = (grunt) => { ...@@ -101,6 +113,25 @@ module.exports = (grunt) => {
arch: 'x64', arch: 'x64',
icon: 'resources/win/icon.ico' icon: 'resources/win/icon.ico'
} }
},
'linux-ia32': {
options: {
name: 'mycard',
dir: 'build2',
out: 'build3',
platform: 'linux',
arch: 'ia32'
}
},
'linux-x64': {
options: {
name: 'mycard',
dir: 'build2',
out: 'build3',
platform: 'linux',
arch: 'x64',
icon: 'resources/linux/icon.icns'
}
} }
}, },
...@@ -142,6 +173,31 @@ module.exports = (grunt) => { ...@@ -142,6 +173,31 @@ module.exports = (grunt) => {
loadingGif: 'resources/win/setup.gif' loadingGif: 'resources/win/setup.gif'
} }
}, },
'electron-installer-debian': {
options: {
productName: 'Mycard',
section: 'games',
priority: 'optional'
},
linux32: {
options: {
arch: 'i386'
},
src: 'build3/mycard-linux-ia32',
dest: 'build4/mycard-debian-x32/resources/app'
},
linux64: {
options: {
arch: 'amd64'
},
src: 'build3/mycard-linux-x64',
dest: 'build4/mycard-debian-x64/resources/app'
}
},
appdmg: { appdmg: {
options: { options: {
title: 'MyCard', title: 'MyCard',
...@@ -171,7 +227,7 @@ module.exports = (grunt) => { ...@@ -171,7 +227,7 @@ module.exports = (grunt) => {
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-electron'); grunt.loadNpmTasks('grunt-electron');
grunt.registerTask('build', ['clean', 'copy:app-ia32', 'copy:app-x64','copy:node_modules-ia32','copy:node_modules-x64']); grunt.registerTask('build', ['clean', 'copy:app-ia32', 'copy:app-x64', 'copy:app-linux', 'copy:node_modules-ia32','copy:node_modules-x64']);
grunt.registerTask('release', ['build'].concat(release_task)); grunt.registerTask('release', ['build'].concat(release_task));
grunt.registerTask('default', ['release']); grunt.registerTask('default', ['release']);
}; };
\ No newline at end of file
## Build ## Build
### Windows ### Windows
```bash ```bash
del /s /q build1 del /s /q build1
npm install --prefix build1\win32-ia32 --production glob ini mkdirp ws aria2 winreg windows-shortcuts npm install --prefix build1\win32-ia32 --production glob ini mkdirp ws aria2 winreg windows-shortcuts
...@@ -12,7 +13,18 @@ grunt ...@@ -12,7 +13,18 @@ grunt
``` ```
### OSX ### OSX
```bash
npm install --prefix build1 --production glob ini mkdirp ws aria2
grunt
```
### LINUX (DEBIAN&UBUNTU)
```bash ```bash
npm install grunt-cli -g
npm install --prefix build1 --production glob ini mkdirp ws aria2 npm install --prefix build1 --production glob ini mkdirp ws aria2
npm install
grunt grunt
``` ```
\ No newline at end of file
...@@ -18,11 +18,12 @@ ...@@ -18,11 +18,12 @@
"grunt-electron-installer": "latest" "grunt-electron-installer": "latest"
}, },
"devDependencies": { "devDependencies": {
"electron-prebuilt": "latest",
"grunt": "latest", "grunt": "latest",
"grunt-appdmg": "latest", "grunt-appdmg": "latest",
"grunt-contrib-clean": "latest", "grunt-contrib-clean": "latest",
"grunt-contrib-copy": "latest", "grunt-contrib-copy": "latest",
"grunt-electron": "latest", "grunt-electron": "latest",
"electron-prebuilt": "latest" "grunt-electron-installer-debian": "^0.2.0"
} }
} }
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment