2015-10-17 23:49:24 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var fs = require('fs'),
|
|
|
|
path = require('path');
|
|
|
|
|
2015-11-14 12:09:36 +01:00
|
|
|
/* jshint node:true */
|
|
|
|
/* jshint browser:false */
|
|
|
|
|
2015-10-21 23:02:17 +02:00
|
|
|
var StringReplacePlugin = require('string-replace-webpack-plugin');
|
2015-10-17 23:49:24 +02:00
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
require('time-grunt')(grunt);
|
|
|
|
require('load-grunt-tasks')(grunt);
|
2015-11-07 08:55:45 +01:00
|
|
|
grunt.loadTasks('grunt/tasks');
|
2015-10-17 23:49:24 +02:00
|
|
|
|
|
|
|
var webpack = require('webpack');
|
2015-10-22 20:03:44 +02:00
|
|
|
var pkg = require('./package.json');
|
|
|
|
var dt = new Date().toISOString().replace(/T.*/, '');
|
2016-05-13 14:07:46 +02:00
|
|
|
var minElectronVersionForUpdate = '1.0.1';
|
2016-03-05 12:16:12 +01:00
|
|
|
var zipCommentPlaceholder = 'zip_comment_placeholder_that_will_be_replaced_with_hash';
|
2016-04-16 22:34:16 +02:00
|
|
|
var electronVersion = pkg.devDependencies['electron-prebuilt'].replace(/^\D/, '');
|
2016-03-05 12:16:12 +01:00
|
|
|
|
|
|
|
while (zipCommentPlaceholder.length < 512) {
|
|
|
|
zipCommentPlaceholder += '.';
|
|
|
|
}
|
2015-10-17 23:49:24 +02:00
|
|
|
|
|
|
|
function replaceFont(css) {
|
|
|
|
css.walkAtRules('font-face', function (rule) {
|
|
|
|
var fontFamily = rule.nodes.filter(function(n) { return n.prop === 'font-family'; })[0];
|
|
|
|
if (!fontFamily) {
|
|
|
|
throw 'Bad font rule: ' + rule.toString();
|
|
|
|
}
|
|
|
|
var value = fontFamily.value.replace(/["']/g, '');
|
|
|
|
var fontFiles = {
|
|
|
|
FontAwesome: 'fontawesome-webfont.woff'
|
|
|
|
};
|
|
|
|
var fontFile = fontFiles[value];
|
|
|
|
if (!fontFile) {
|
|
|
|
throw 'Unsupported font ' + value + ': ' + rule.toString();
|
|
|
|
}
|
|
|
|
var data = fs.readFileSync('tmp/fonts/' + fontFile, 'base64');
|
|
|
|
var src = 'url(data:application/font-woff;charset=utf-8;base64,{data}) format(\'woff\')'
|
|
|
|
.replace('{data}', data);
|
|
|
|
//var src = 'url(\'../fonts/fontawesome-webfont.woff\') format(\'woff\')';
|
|
|
|
rule.nodes = rule.nodes.filter(function(n) { return n.prop !== 'src'; });
|
|
|
|
rule.append({ prop: 'src', value: src });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
grunt.initConfig({
|
2015-11-07 08:55:45 +01:00
|
|
|
gitinfo: {
|
|
|
|
branch: {
|
|
|
|
current: {
|
|
|
|
SHA: 'Current HEAD SHA',
|
|
|
|
shortSHA: 'Current HEAD short SHA',
|
|
|
|
name: 'Current branch name',
|
|
|
|
lastCommitTime: 'Last commit time'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-10-17 23:49:24 +02:00
|
|
|
'bower-install-simple': {
|
|
|
|
install: {
|
|
|
|
}
|
|
|
|
},
|
|
|
|
clean: {
|
2015-11-07 08:55:45 +01:00
|
|
|
dist: ['dist', 'tmp'],
|
2015-11-14 12:09:36 +01:00
|
|
|
'desktop_dist': ['dist/desktop'],
|
|
|
|
'desktop_tmp': ['tmp/desktop']
|
2015-10-17 23:49:24 +02:00
|
|
|
},
|
|
|
|
copy: {
|
|
|
|
html: {
|
|
|
|
src: 'app/index.html',
|
|
|
|
dest: 'tmp/index.html',
|
|
|
|
nonull: true
|
|
|
|
},
|
|
|
|
favicon: {
|
|
|
|
src: 'app/favicon.png',
|
|
|
|
dest: 'tmp/favicon.png',
|
|
|
|
nonull: true
|
|
|
|
},
|
2016-02-07 14:08:37 +01:00
|
|
|
touchicon: {
|
|
|
|
src: 'app/touchicon.png',
|
|
|
|
dest: 'tmp/touchicon.png',
|
|
|
|
nonull: true
|
|
|
|
},
|
2015-10-17 23:49:24 +02:00
|
|
|
fonts: {
|
|
|
|
src: 'bower_components/font-awesome/fonts/fontawesome-webfont.*',
|
|
|
|
dest: 'tmp/fonts/',
|
|
|
|
nonull: true,
|
|
|
|
expand: true,
|
|
|
|
flatten: true
|
2015-11-07 08:55:45 +01:00
|
|
|
},
|
2015-11-14 09:39:22 +01:00
|
|
|
'desktop_app_content': {
|
|
|
|
cwd: 'electron/',
|
|
|
|
src: '**',
|
|
|
|
dest: 'tmp/desktop/app/',
|
|
|
|
expand: true,
|
|
|
|
nonull: true
|
|
|
|
},
|
2016-07-11 21:37:04 +02:00
|
|
|
'desktop_windows_helper': {
|
|
|
|
src: 'helper/win32/KeeWebHelper.exe',
|
|
|
|
dest: 'tmp/desktop/app/',
|
|
|
|
nonull: true
|
|
|
|
},
|
2015-11-07 08:55:45 +01:00
|
|
|
'desktop_osx': {
|
2016-07-11 20:32:44 +02:00
|
|
|
src: 'tmp/desktop/mac/KeeWeb-' + pkg.version + '.dmg',
|
2015-11-07 08:55:45 +01:00
|
|
|
dest: 'dist/desktop/KeeWeb.mac.dmg',
|
|
|
|
nonull: true
|
|
|
|
},
|
|
|
|
'desktop_win': {
|
2016-07-11 20:32:44 +02:00
|
|
|
src: 'tmp/desktop/win-ia32/KeeWeb Setup ' + pkg.version + '-ia32.exe',
|
2015-11-07 08:55:45 +01:00
|
|
|
dest: 'dist/desktop/KeeWeb.win32.exe',
|
|
|
|
nonull: true
|
|
|
|
},
|
2016-03-01 20:06:23 +01:00
|
|
|
'desktop_linux_x64': {
|
2015-11-07 08:55:45 +01:00
|
|
|
src: 'tmp/desktop/KeeWeb.linux.x64.zip',
|
|
|
|
dest: 'dist/desktop/KeeWeb.linux.x64.zip',
|
|
|
|
nonull: true
|
2016-03-01 20:06:23 +01:00
|
|
|
},
|
|
|
|
'desktop_linux_ia32': {
|
|
|
|
src: 'tmp/desktop/KeeWeb.linux.ia32.zip',
|
|
|
|
dest: 'dist/desktop/KeeWeb.linux.ia32.zip',
|
|
|
|
nonull: true
|
2016-04-02 10:13:24 +02:00
|
|
|
},
|
|
|
|
'desktop_linux_deb_x64': {
|
2016-04-05 19:38:11 +02:00
|
|
|
src: 'tmp/desktop/keeweb-desktop_*_amd64.deb',
|
2016-04-02 10:13:24 +02:00
|
|
|
dest: 'dist/desktop/KeeWeb.linux.x64.deb',
|
|
|
|
nonull: true
|
2015-10-17 23:49:24 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
jshintrc: true
|
|
|
|
},
|
|
|
|
all: ['app/scripts/**/*.js']
|
|
|
|
},
|
|
|
|
sass: {
|
|
|
|
options: {
|
|
|
|
sourceMap: false,
|
|
|
|
includePaths: ['./bower_components']
|
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
files: {
|
|
|
|
'tmp/css/main.css': 'app/styles/main.scss'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
postcss: {
|
|
|
|
options: {
|
|
|
|
processors: [
|
|
|
|
replaceFont,
|
|
|
|
require('cssnano')({discardComments: {removeAll: true}})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
src: 'tmp/css/main.css',
|
|
|
|
dest: 'tmp/css/main.css'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
inline: {
|
|
|
|
app: {
|
|
|
|
src: 'tmp/index.html',
|
|
|
|
dest: 'tmp/app.html'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
htmlmin: {
|
|
|
|
options: {
|
|
|
|
removeComments: true,
|
|
|
|
collapseWhitespace: true
|
|
|
|
},
|
|
|
|
app: {
|
|
|
|
files: {
|
2015-10-17 23:53:17 +02:00
|
|
|
'dist/index.html': 'tmp/app.html'
|
2015-10-17 23:49:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-10-21 23:02:17 +02:00
|
|
|
'string-replace': {
|
|
|
|
manifest: {
|
|
|
|
options: {
|
2015-11-14 09:39:22 +01:00
|
|
|
replacements: [
|
2016-01-17 21:34:40 +01:00
|
|
|
{ pattern: '# YYYY-MM-DD:v0.0.0', replacement: '# ' + dt + ':v' + pkg.version },
|
2016-02-03 21:44:18 +01:00
|
|
|
{ pattern: '# updmin:v0.0.0', replacement: '# updmin:v' + minElectronVersionForUpdate }
|
2015-11-14 09:39:22 +01:00
|
|
|
]
|
2015-10-21 23:02:17 +02:00
|
|
|
},
|
|
|
|
files: { 'dist/manifest.appcache': 'app/manifest.appcache' }
|
2015-11-14 09:39:22 +01:00
|
|
|
},
|
2015-12-06 21:32:41 +01:00
|
|
|
'manifest_html': {
|
|
|
|
options: { replacements: [{ pattern: '<html', replacement: '<html manifest="manifest.appcache"' }] },
|
|
|
|
files: { 'dist/index.html': 'dist/index.html' }
|
|
|
|
},
|
2015-11-14 09:39:22 +01:00
|
|
|
'desktop_html': {
|
|
|
|
options: { replacements: [{ pattern: ' manifest="manifest.appcache"', replacement: '' }] },
|
|
|
|
files: { 'tmp/desktop/app/index.html': 'dist/index.html' }
|
2015-10-21 23:02:17 +02:00
|
|
|
}
|
|
|
|
},
|
2015-10-17 23:49:24 +02:00
|
|
|
webpack: {
|
|
|
|
js: {
|
|
|
|
entry: {
|
|
|
|
app: 'app',
|
2016-03-31 22:52:04 +02:00
|
|
|
vendor: ['jquery', 'underscore', 'backbone', 'kdbxweb', 'baron', 'dropbox', 'pikaday', 'filesaver', 'qrcode']
|
2015-10-17 23:49:24 +02:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: 'tmp/js',
|
|
|
|
filename: 'app.js'
|
|
|
|
},
|
|
|
|
stats: {
|
|
|
|
colors: false,
|
|
|
|
modules: true,
|
|
|
|
reasons: true
|
|
|
|
},
|
|
|
|
progress: false,
|
|
|
|
failOnError: true,
|
|
|
|
resolve: {
|
|
|
|
root: [path.join(__dirname, 'app/scripts'), path.join(__dirname, 'bower_components')],
|
|
|
|
alias: {
|
|
|
|
backbone: 'backbone/backbone-min.js',
|
|
|
|
underscore: 'underscore/underscore-min.js',
|
|
|
|
_: 'underscore/underscore-min.js',
|
2016-02-07 10:16:24 +01:00
|
|
|
jquery: 'jquery/dist/jquery.min.js',
|
2015-12-16 22:50:45 +01:00
|
|
|
hbs: 'handlebars/runtime.js',
|
2015-10-17 23:49:24 +02:00
|
|
|
kdbxweb: 'kdbxweb/dist/kdbxweb.js',
|
|
|
|
dropbox: 'dropbox/lib/dropbox.min.js',
|
|
|
|
baron: 'baron/baron.min.js',
|
|
|
|
pikaday: 'pikaday/pikaday.js',
|
|
|
|
filesaver: 'FileSaver.js/FileSaver.min.js',
|
2016-03-31 22:52:04 +02:00
|
|
|
qrcode: 'jsqrcode/dist/qrcode.min.js',
|
2015-10-17 23:49:24 +02:00
|
|
|
templates: path.join(__dirname, 'app/templates')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [
|
2015-12-16 22:50:45 +01:00
|
|
|
{ test: /\.hbs$/, loader: StringReplacePlugin.replace('handlebars-loader', { replacements: [{
|
2015-10-17 23:49:24 +02:00
|
|
|
pattern: /\r?\n\s*/g,
|
|
|
|
replacement: function() { return '\n'; }
|
|
|
|
}]})},
|
2015-10-22 20:03:44 +02:00
|
|
|
{ test: /runtime\-info\.js$/, loader: StringReplacePlugin.replace({ replacements: [
|
|
|
|
{ pattern: /@@VERSION/g, replacement: function() { return pkg.version; } },
|
2015-11-14 09:39:22 +01:00
|
|
|
{ pattern: /@@DATE/g, replacement: function() { return dt; } },
|
|
|
|
{ pattern: /@@COMMIT/g, replacement: function() { return grunt.config.get('gitinfo.local.branch.current.shortSHA'); } }
|
2015-10-22 20:03:44 +02:00
|
|
|
]})},
|
2015-10-17 23:49:24 +02:00
|
|
|
{ test: /baron(\.min)?\.js$/, loader: 'exports?baron; delete window.baron;' },
|
2015-12-17 20:20:50 +01:00
|
|
|
{ test: /pikadat\.js$/, loader: 'uglify' },
|
|
|
|
{ test: /handlebars/, loader: 'strip-sourcemap-loader' }
|
2015-10-17 23:49:24 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
|
2016-04-10 21:54:22 +02:00
|
|
|
new webpack.BannerPlugin('keeweb v' + pkg.version + ', (c) 2015 ' + pkg.author.name +
|
2015-10-17 23:49:24 +02:00
|
|
|
', opensource.org/licenses/' + pkg.license),
|
|
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
|
|
new webpack.ProvidePlugin({ _: 'underscore', $: 'jquery' }),
|
|
|
|
new webpack.IgnorePlugin(/^(moment)$/),
|
|
|
|
new StringReplacePlugin()
|
|
|
|
],
|
|
|
|
node: {
|
|
|
|
console: false,
|
|
|
|
process: false,
|
|
|
|
Buffer: false,
|
|
|
|
__filename: false,
|
|
|
|
__dirname: false
|
2016-04-23 17:01:56 +02:00
|
|
|
},
|
|
|
|
externals: {
|
2016-05-13 14:05:01 +02:00
|
|
|
xmldom: 'null'
|
2015-10-17 23:49:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {
|
|
|
|
options: {
|
|
|
|
preserveComments: false
|
|
|
|
},
|
|
|
|
app: {
|
|
|
|
files: { 'tmp/js/app.js': ['tmp/js/app.js'] }
|
|
|
|
},
|
|
|
|
vendor: {
|
|
|
|
options: {
|
|
|
|
mangle: false,
|
|
|
|
compress: false
|
|
|
|
},
|
|
|
|
files: { 'tmp/js/vendor.js': ['tmp/js/vendor.js'] }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
options: {
|
|
|
|
interrupt: true,
|
|
|
|
debounceDelay: 500
|
|
|
|
},
|
|
|
|
scripts: {
|
2015-12-16 22:50:45 +01:00
|
|
|
files: ['app/scripts/**/*.js', 'app/templates/**/*.hbs'],
|
2015-10-17 23:49:24 +02:00
|
|
|
tasks: ['webpack']
|
|
|
|
},
|
|
|
|
styles: {
|
|
|
|
files: 'app/styles/**/*.scss',
|
|
|
|
tasks: ['sass']
|
|
|
|
},
|
|
|
|
indexhtml: {
|
|
|
|
files: 'app/index.html',
|
|
|
|
tasks: ['copy:html']
|
|
|
|
}
|
2015-11-07 08:55:45 +01:00
|
|
|
},
|
|
|
|
electron: {
|
|
|
|
options: {
|
|
|
|
name: 'KeeWeb',
|
2015-11-14 09:39:22 +01:00
|
|
|
dir: 'tmp/desktop/app',
|
2015-11-07 08:55:45 +01:00
|
|
|
out: 'tmp/desktop',
|
|
|
|
version: electronVersion,
|
|
|
|
overwrite: true,
|
|
|
|
'app-version': pkg.version,
|
|
|
|
'build-version': '<%= gitinfo.local.branch.current.shortSHA %>'
|
|
|
|
},
|
2016-03-01 20:06:23 +01:00
|
|
|
linux64: {
|
2015-11-07 08:55:45 +01:00
|
|
|
options: {
|
|
|
|
platform: 'linux',
|
|
|
|
arch: 'x64',
|
|
|
|
icon: 'graphics/app.ico'
|
|
|
|
}
|
|
|
|
},
|
2016-03-01 20:06:23 +01:00
|
|
|
linux32: {
|
|
|
|
options: {
|
|
|
|
platform: 'linux',
|
|
|
|
arch: 'ia32',
|
|
|
|
icon: 'graphics/app.ico'
|
|
|
|
}
|
2015-11-07 08:55:45 +01:00
|
|
|
}
|
|
|
|
},
|
2016-04-03 09:47:34 +02:00
|
|
|
'electron-builder': {
|
2015-11-07 08:55:45 +01:00
|
|
|
options: {
|
2016-04-16 22:34:16 +02:00
|
|
|
publish: 'never',
|
|
|
|
dist: false,
|
|
|
|
projectDir: __dirname,
|
|
|
|
appDir: 'tmp/desktop/app',
|
|
|
|
sign: false
|
2015-11-07 08:55:45 +01:00
|
|
|
},
|
|
|
|
osx: {
|
|
|
|
options: {
|
2016-04-16 22:34:16 +02:00
|
|
|
platforms: ['osx'],
|
|
|
|
arch: 'x64'
|
2015-11-07 08:55:45 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
win: {
|
|
|
|
options: {
|
2016-04-16 22:34:16 +02:00
|
|
|
platform: ['win32'],
|
|
|
|
arch: 'ia32'
|
2015-11-07 08:55:45 +01:00
|
|
|
}
|
|
|
|
}
|
2016-04-16 22:34:16 +02:00
|
|
|
// linux64: {
|
|
|
|
// options: {
|
|
|
|
// platform: ['linux'],
|
|
|
|
// arch: 'x64'
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// linux32: {
|
|
|
|
// options: {
|
|
|
|
// platform: ['linux'],
|
|
|
|
// arch: 'ia32'
|
|
|
|
// }
|
|
|
|
// }
|
2015-11-07 08:55:45 +01:00
|
|
|
},
|
|
|
|
compress: {
|
2016-03-01 20:06:23 +01:00
|
|
|
linux64: {
|
2015-11-14 12:09:36 +01:00
|
|
|
options: { archive: 'tmp/desktop/KeeWeb.linux.x64.zip' },
|
2015-11-07 08:55:45 +01:00
|
|
|
files: [{ cwd: 'tmp/desktop/KeeWeb-linux-x64', src: '**', expand: true }]
|
2015-11-14 12:09:36 +01:00
|
|
|
},
|
2016-03-01 20:06:23 +01:00
|
|
|
linux32: {
|
|
|
|
options: { archive: 'tmp/desktop/KeeWeb.linux.ia32.zip' },
|
|
|
|
files: [{ cwd: 'tmp/desktop/KeeWeb-linux-ia32', src: '**', expand: true }]
|
|
|
|
},
|
2015-11-14 12:09:36 +01:00
|
|
|
'desktop_update': {
|
2016-03-05 12:16:12 +01:00
|
|
|
options: { archive: 'dist/desktop/UpdateDesktop.zip', comment: zipCommentPlaceholder },
|
2015-11-14 12:09:36 +01:00
|
|
|
files: [{ cwd: 'tmp/desktop/app', src: '**', expand: true }]
|
2015-11-07 08:55:45 +01:00
|
|
|
}
|
2015-11-14 16:47:51 +01:00
|
|
|
},
|
2016-04-02 13:21:07 +02:00
|
|
|
deb: {
|
|
|
|
linux64: {
|
|
|
|
options: {
|
|
|
|
tmpPath: 'tmp/desktop/',
|
|
|
|
package: {
|
|
|
|
name: 'keeweb-desktop',
|
|
|
|
version: pkg.version,
|
|
|
|
description: pkg.description,
|
|
|
|
author: pkg.author,
|
|
|
|
homepage: pkg.homepage,
|
|
|
|
rev: function() { return grunt.config.get('gitinfo.local.branch.current.shortSHA'); }
|
|
|
|
},
|
|
|
|
info: {
|
|
|
|
arch: 'amd64',
|
2016-04-02 21:37:25 +02:00
|
|
|
targetDir: 'tmp/desktop',
|
2016-04-08 17:47:37 +02:00
|
|
|
appName: 'KeeWeb',
|
2016-04-02 21:37:25 +02:00
|
|
|
scripts: {
|
|
|
|
postinst: 'package/deb/scripts/postinst'
|
|
|
|
}
|
2016-04-02 13:21:07 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
cwd: 'package/deb/usr',
|
|
|
|
src: '**',
|
|
|
|
dest: '/usr',
|
|
|
|
expand: true,
|
|
|
|
nonull: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
cwd: 'tmp/desktop/KeeWeb-linux-x64/',
|
|
|
|
src: '**',
|
|
|
|
dest: '/opt/keeweb-desktop',
|
|
|
|
expand: true,
|
|
|
|
nonull: true
|
|
|
|
},
|
|
|
|
{
|
2016-04-02 21:03:02 +02:00
|
|
|
src: 'graphics/128x128.png',
|
2016-04-02 13:21:07 +02:00
|
|
|
dest: '/usr/share/icons/hicolor/128x128/apps/keeweb.png',
|
|
|
|
nonull: true
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
2016-03-05 12:16:12 +01:00
|
|
|
'sign-archive': {
|
|
|
|
'desktop_update': {
|
|
|
|
options: {
|
|
|
|
file: 'dist/desktop/UpdateDesktop.zip',
|
|
|
|
signature: zipCommentPlaceholder,
|
2016-03-05 13:05:44 +01:00
|
|
|
privateKey: 'keys/private-key.pem'
|
2016-03-05 12:16:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-11-14 16:47:51 +01:00
|
|
|
'validate-desktop-update': {
|
|
|
|
desktop: {
|
|
|
|
options: {
|
|
|
|
file: 'dist/desktop/UpdateDesktop.zip',
|
2016-03-05 12:16:12 +01:00
|
|
|
expected: ['main.js', 'app.js', 'index.html', 'package.json', 'node_modules/node-stream-zip/node_stream_zip.js'],
|
2016-03-05 12:45:37 +01:00
|
|
|
publicKey: 'app/resources/public-key.pem'
|
2015-11-14 16:47:51 +01:00
|
|
|
}
|
|
|
|
}
|
2016-04-02 22:44:53 +02:00
|
|
|
},
|
|
|
|
'sign-html': {
|
|
|
|
'app': {
|
|
|
|
options: {
|
|
|
|
file: 'dist/index.html',
|
|
|
|
privateKey: 'keys/private-key.pem'
|
|
|
|
}
|
|
|
|
}
|
2015-10-17 23:49:24 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.registerTask('default', [
|
2015-11-14 09:39:22 +01:00
|
|
|
'gitinfo',
|
2015-10-17 23:49:24 +02:00
|
|
|
'bower-install-simple',
|
|
|
|
'clean',
|
|
|
|
'jshint',
|
|
|
|
'copy:html',
|
|
|
|
'copy:favicon',
|
2016-02-07 14:08:37 +01:00
|
|
|
'copy:touchicon',
|
2015-10-17 23:49:24 +02:00
|
|
|
'copy:fonts',
|
|
|
|
'webpack',
|
|
|
|
'uglify',
|
|
|
|
'sass',
|
|
|
|
'postcss',
|
|
|
|
'inline',
|
2015-10-21 23:02:17 +02:00
|
|
|
'htmlmin',
|
2015-12-06 21:32:41 +01:00
|
|
|
'string-replace:manifest_html',
|
2016-04-02 22:44:53 +02:00
|
|
|
'string-replace:manifest',
|
|
|
|
'sign-html'
|
2015-10-17 23:49:24 +02:00
|
|
|
]);
|
2015-11-07 08:55:45 +01:00
|
|
|
|
|
|
|
grunt.registerTask('desktop', [
|
2016-04-16 22:42:50 +02:00
|
|
|
'default',
|
2015-11-07 08:55:45 +01:00
|
|
|
'gitinfo',
|
|
|
|
'clean:desktop_tmp',
|
|
|
|
'clean:desktop_dist',
|
2015-11-14 09:39:22 +01:00
|
|
|
'copy:desktop_app_content',
|
|
|
|
'string-replace:desktop_html',
|
2015-11-14 12:09:36 +01:00
|
|
|
'compress:desktop_update',
|
2016-03-05 12:16:12 +01:00
|
|
|
'sign-archive:desktop_update',
|
2015-11-14 16:47:51 +01:00
|
|
|
'validate-desktop-update',
|
2015-11-07 08:55:45 +01:00
|
|
|
'electron',
|
2016-04-16 22:34:16 +02:00
|
|
|
'electron-builder:osx',
|
2016-07-11 21:37:04 +02:00
|
|
|
'copy:desktop_windows_helper',
|
2016-04-16 22:34:16 +02:00
|
|
|
'electron-builder:win',
|
2016-03-01 20:06:23 +01:00
|
|
|
'compress:linux64',
|
|
|
|
'compress:linux32',
|
2016-04-02 13:21:07 +02:00
|
|
|
'deb:linux64',
|
2015-11-07 08:55:45 +01:00
|
|
|
'copy:desktop_osx',
|
|
|
|
'copy:desktop_win',
|
2016-03-01 20:06:23 +01:00
|
|
|
'copy:desktop_linux_x64',
|
|
|
|
'copy:desktop_linux_ia32',
|
2016-04-02 10:13:24 +02:00
|
|
|
'copy:desktop_linux_deb_x64',
|
2015-11-07 08:55:45 +01:00
|
|
|
'clean:desktop_tmp'
|
|
|
|
]);
|
2015-10-17 23:49:24 +02:00
|
|
|
};
|