copay/Gruntfile.js

254 lines
7.4 KiB
JavaScript
Raw Normal View History

'use strict';
2014-04-07 11:31:13 -07:00
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
2014-04-07 11:31:13 -07:00
// Project Configuration
grunt.initConfig({
2015-03-06 07:00:10 -08:00
pkg: grunt.file.readJSON('package.json'),
'string-replace': {
dist: {
files: {
'cordova/config.xml': ['config-templates/config.xml'],
'cordova/wp/Package.appxmanifest': ['config-templates/Package.appxmanifest'],
'cordova/wp/Properties/WMAppManifest.xml': ['config-templates/WMAppManifest.xml'],
'webkitbuilds/.desktop': ['config-templates/.desktop'],
'webkitbuilds/setup-win.iss': ['config-templates/setup-win.iss']
},
options: {
replacements: [{
pattern: /%APP-VERSION%/g,
replacement: '<%= pkg.version %>'
}, {
pattern: /%ANDROID-VERSION-CODE%/g,
replacement: '<%= pkg.androidVersionCode %>'
}]
}
}
},
2014-12-30 07:19:16 -08:00
exec: {
2015-03-06 07:00:10 -08:00
version: {
command: 'node ./util/version.js'
},
Feat/coinbase integration (#4012) * Oauth2 and first view * Connect with Coinbase using mobile * Buy and Sell through Coinbase * Fix buy * Receive and send bitcoin to Coinbase account * Receive bitcoin from Coinbase to Copay * Complete user and account information. Connection errors * Improves error handler * Removes console.log * Coinbase background color. Send to Coinbase form validation * Fix send from different wallet * Send and receive using Coinbase * Pagination activity * Fix Buy and Sell * One option in the sidebar to Buy and Sell * Native balance on Coinbase homepage * Rename receive and send * Auto-close window after authenticate * Reorder * Get payment methods * Fix when token expired * Fix token expired * Integration: sell and send to Coinbase * Store pending transaction before sell * Sell flow completed * Removing files * Fix sell * Fix sell * Fix sell * Sell completed * Buy bitcoin through coinbase * Buy auto * Currency set to USD * Select payment methods. Limits * Removes payment methods from preferences * Fix signs. Tx ordered by updated. Minor fixes * Removes console.log * Improving ux-language things * Fix selectedpaymentmethod if not verified * Set error if tx not found * Price sensitivity. Minor fixes * Adds coinbase api key to gitignore * Coinbase production ready * Fix sell in usd * Bug fixes * New Sensitivity step * Refresh token with a simple click * Refresh token * Refactor * Fix auto reconnect if token expired Signed-off-by: Gustavo Maximiliano Cortez <[email protected]> * Fix calls if token expired
2016-04-13 10:08:03 -07:00
coinbase: {
command: 'node ./util/coinbase.js'
},
2015-03-06 07:00:10 -08:00
clear: {
command: 'rm -Rf bower_components node_modules'
},
2015-12-11 10:06:43 -08:00
osx: {
2016-04-22 13:02:09 -07:00
command: 'webkitbuilds/build-osx.sh sign'
2014-04-07 11:31:13 -07:00
}
},
watch: {
options: {
dateFormat: function(time) {
grunt.log.writeln('The watch finished in ' + time + 'ms at ' + (new Date()).toString());
grunt.log.writeln('Waiting for more changes...');
},
},
css: {
2015-03-06 07:00:10 -08:00
files: ['src/css/*.css'],
tasks: ['concat:css']
2014-08-21 12:49:04 -07:00
},
main: {
files: [
2015-03-06 07:00:10 -08:00
'src/js/init.js',
'src/js/app.js',
'src/js/directives/*.js',
'src/js/filters/*.js',
'src/js/routes.js',
'src/js/services/*.js',
'src/js/models/*.js',
'src/js/controllers/*.js'
2014-08-21 12:49:04 -07:00
],
2015-03-06 07:00:10 -08:00
tasks: ['concat:js']
2014-09-24 21:58:27 -07:00
}
2014-04-07 11:31:13 -07:00
},
sass: {
dist: {
options: {
style: 'compact',
sourcemap: 'none'
},
files: [{
expand: true,
src: ['src/sass/*.scss'],
dest: './',
ext: '.css'
}]
}
},
concat: {
2015-03-06 07:00:10 -08:00
options: {
sourceMap: false,
sourceMapStyle: 'link' // embed, link, inline
},
angular: {
src: [
2015-03-06 07:00:10 -08:00
'bower_components/qrcode-generator/js/qrcode.js',
'bower_components/qrcode-decoder-js/lib/qrcode-decoder.js',
'bower_components/moment/min/moment-with-locales.js',
'bower_components/angular/angular.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-foundation/mm-foundation-tpls.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/fastclick/lib/fastclick.js',
'bower_components/stateful-fastclick/dist/stateful-fastclick.js',
'bower_components/angular-stateful-fastclick/lib/angular-stateful-fastclick.js',
2015-03-06 07:00:10 -08:00
'bower_components/angular-moment/angular-moment.js',
'bower_components/ng-lodash/build/ng-lodash.js',
'bower_components/angular-qrcode/angular-qrcode.js',
2015-03-06 07:00:10 -08:00
'bower_components/angular-gettext/dist/angular-gettext.js',
'bower_components/angular-ui-switch/angular-ui-switch.js',
2016-02-16 09:33:39 -08:00
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/ng-csv/build/ng-csv.js',
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js'
],
2015-03-06 07:00:10 -08:00
dest: 'public/lib/angular.js'
},
2015-03-06 07:00:10 -08:00
js: {
src: [
2015-03-06 07:00:10 -08:00
'src/js/app.js',
'src/js/routes.js',
'src/js/directives/*.js',
'src/js/filters/*.js',
'src/js/models/*.js',
'src/js/services/*.js',
'src/js/controllers/*.js',
'src/js/translations.js',
'src/js/version.js',
Feat/coinbase integration (#4012) * Oauth2 and first view * Connect with Coinbase using mobile * Buy and Sell through Coinbase * Fix buy * Receive and send bitcoin to Coinbase account * Receive bitcoin from Coinbase to Copay * Complete user and account information. Connection errors * Improves error handler * Removes console.log * Coinbase background color. Send to Coinbase form validation * Fix send from different wallet * Send and receive using Coinbase * Pagination activity * Fix Buy and Sell * One option in the sidebar to Buy and Sell * Native balance on Coinbase homepage * Rename receive and send * Auto-close window after authenticate * Reorder * Get payment methods * Fix when token expired * Fix token expired * Integration: sell and send to Coinbase * Store pending transaction before sell * Sell flow completed * Removing files * Fix sell * Fix sell * Fix sell * Sell completed * Buy bitcoin through coinbase * Buy auto * Currency set to USD * Select payment methods. Limits * Removes payment methods from preferences * Fix signs. Tx ordered by updated. Minor fixes * Removes console.log * Improving ux-language things * Fix selectedpaymentmethod if not verified * Set error if tx not found * Price sensitivity. Minor fixes * Adds coinbase api key to gitignore * Coinbase production ready * Fix sell in usd * Bug fixes * New Sensitivity step * Refresh token with a simple click * Refresh token * Refactor * Fix auto reconnect if token expired Signed-off-by: Gustavo Maximiliano Cortez <[email protected]> * Fix calls if token expired
2016-04-13 10:08:03 -07:00
'src/js/coinbase.js',
'src/js/init.js',
'src/js/trezor-url.js',
'bower_components/trezor-connect/login.js'
],
2015-03-06 07:00:10 -08:00
dest: 'public/js/copay.js'
},
2015-03-06 07:00:10 -08:00
css: {
2016-05-12 10:54:39 -07:00
src: ['src/sass/*.css', 'src/css/*.css'],
2015-03-06 07:00:10 -08:00
dest: 'public/css/copay.css'
},
foundation: {
src: [
2015-03-06 07:00:10 -08:00
'bower_components/angular/angular-csp.css',
'bower_components/foundation/css/foundation.css',
'bower_components/animate.css/animate.css',
'bower_components/angular-ui-switch/angular-ui-switch.css'
],
2015-03-06 07:00:10 -08:00
dest: 'public/css/foundation.css',
}
},
uglify: {
options: {
mangle: false
},
prod: {
files: {
2015-03-06 07:00:10 -08:00
'public/js/copay.js': ['public/js/copay.js'],
'public/lib/angular.js': ['public/lib/angular.js']
}
}
},
nggettext_extract: {
pot: {
files: {
'i18n/po/template.pot': [
'public/index.html',
'public/views/*.html',
'public/views/**/*.html',
'src/js/routes.js',
'src/js/services/*.js',
'src/js/controllers/*.js'
]
}
},
},
nggettext_compile: {
all: {
options: {
module: 'copayApp'
},
files: {
2015-07-24 17:57:16 -07:00
'src/js/translations.js': ['i18n/po/*.po']
}
},
2014-09-08 11:42:55 -07:00
},
copy: {
2015-03-06 07:00:10 -08:00
icons: {
expand: true,
flatten: true,
src: 'bower_components/foundation-icon-fonts/foundation-icons.*',
dest: 'public/icons/'
2015-06-02 12:44:59 -07:00
},
linux: {
files: [{
expand: true,
cwd: 'webkitbuilds/',
src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],
2015-12-11 10:06:43 -08:00
dest: 'webkitbuilds/Copay/linux64/',
flatten: true,
filter: 'isFile'
2015-12-11 10:06:43 -08:00
}],
2015-03-06 07:00:10 -08:00
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js'
},
2015-03-06 07:00:10 -08:00
prod: {
configFile: 'test/karma.conf.js',
singleRun: true
}
},
2015-03-06 07:00:10 -08:00
coveralls: {
options: {
debug: false,
coverageDir: 'coverage/report-lcov',
dryRun: true,
force: true,
recursive: false
2014-09-08 11:42:55 -07:00
}
2015-05-28 06:52:33 -07:00
},
nodewebkit: {
options: {
2015-12-10 12:02:03 -08:00
appName: 'Copay',
2015-12-11 10:06:43 -08:00
platforms: ['win64', 'osx64', 'linux64'],
buildDir: './webkitbuilds',
version: '0.12.2',
macIcns: './public/img/icons/icon.icns',
exeIco: './public/img/icons/icon.ico'
2015-05-28 06:52:33 -07:00
},
src: ['./package.json', './public/**/*']
2015-06-02 12:44:59 -07:00
},
compress: {
2015-12-11 10:06:43 -08:00
linux: {
2015-06-02 12:44:59 -07:00
options: {
2015-12-11 10:06:43 -08:00
archive: './webkitbuilds/Copay-linux.zip'
2015-06-02 12:44:59 -07:00
},
expand: true,
2015-12-11 10:06:43 -08:00
cwd: './webkitbuilds/Copay/linux64/',
2015-06-02 12:44:59 -07:00
src: ['**/*'],
2015-12-11 10:06:43 -08:00
dest: 'copay-linux/'
2015-06-02 12:44:59 -07:00
}
},
browserify: {
dist: {
files: {
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js': ['angular-bitcore-wallet-client/index.js']
},
}
2014-04-07 11:31:13 -07:00
}
});
grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'exec:coinbase', 'browserify', 'sass', 'concat', 'copy:icons']);
2015-07-20 11:21:14 -07:00
grunt.registerTask('prod', ['default', 'uglify']);
grunt.registerTask('translate', ['nggettext_extract']);
2015-03-06 07:00:10 -08:00
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('test-coveralls', ['browserify', 'karma:prod', 'coveralls']);
2016-04-22 13:02:09 -07:00
grunt.registerTask('desktop', ['prod', 'nodewebkit', 'copy:linux', 'compress:linux']);
grunt.registerTask('osx', ['prod', 'nodewebkit', 'exec:osx']);
grunt.registerTask('release', ['string-replace:dist']);
2014-04-07 11:31:13 -07:00
};