copay/Gruntfile.js

271 lines
8.8 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({
2016-10-18 11:27:09 -07:00
pkg: grunt.file.readJSON('package.json'),
2014-12-30 07:19:16 -08:00
exec: {
2016-08-10 13:35:40 -07:00
appConfig: {
command: 'node ./util/buildAppConfig.js'
},
2016-09-01 12:51:29 -07:00
externalServices: {
command: 'node ./util/buildExternalServices.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
},
2016-08-10 13:35:40 -07:00
clean: {
2015-03-06 07:00:10 -08:00
command: 'rm -Rf bower_components node_modules'
},
2016-08-10 13:35:40 -07:00
cordovaclean: {
command: 'make -C cordova clean'
},
2016-10-18 11:27:09 -07:00
macos: {
command: 'sh webkitbuilds/build-macos.sh sign'
2016-06-15 09:53:09 -07:00
},
coveralls: {
command: 'cat coverage/report-lcov/lcov.info |./node_modules/coveralls/bin/coveralls.js'
2016-08-10 13:35:40 -07:00
},
chrome: {
command: 'make -C chrome-app '
},
2016-09-06 13:47:21 -07:00
wpinit: {
command: 'make -C cordova wp-init',
},
wpcopy: {
command: 'make -C cordova wp-copy',
2016-08-10 13:35:40 -07:00
},
2016-10-05 21:47:00 -07:00
iosdebug: {
command: 'npm run build:ios',
},
2016-08-10 13:35:40 -07:00
ios: {
command: 'npm run build:ios-release',
2016-08-10 13:35:40 -07:00
},
xcode: {
command: 'npm run open:ios',
},
2016-10-05 21:47:00 -07:00
androiddebug: {
command: 'npm run build:android',
2016-08-10 13:35:40 -07:00
},
android: {
command: 'npm run build:android-release',
2016-08-10 13:35:40 -07:00
},
androidrun: {
command: 'npm run run:android && npm run log:android',
2016-08-10 13:35:40 -07:00
},
androidbuild: {
command: 'cd cordova/project && cordova build android --release',
},
androidsign: {
command: 'rm -f cordova/project/platforms/android/build/outputs/apk/android-release-signed-aligned.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../copay.keystore -signedjar cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-unsigned.apk copay_play && ../android-sdk-macosx/build-tools/21.1.1/zipalign -v 4 cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-signed-aligned.apk ',
stdin: true,
},
desktopsign: {
2016-10-18 11:27:09 -07:00
cmd: 'gpg -u 1112CFA1 --output webkitbuilds/<%= pkg.title %>-linux.zip.sig --detach-sig webkitbuilds/<%= pkg.title %>-linux.zip && gpg -u 1112CFA1 --output webkitbuilds/<%= pkg.title %>-win.exe.sig --detach-sig webkitbuilds/<%= pkg.title %>-win.exe'
2016-08-10 13:35:40 -07:00
},
desktopverify: {
2016-10-18 11:27:09 -07:00
cmd: 'gpg --verify webkitbuilds/<%= pkg.title %>-linux.zip.sig webkitbuilds/<%= pkg.title %>-linux.zip && gpg --verify webkitbuilds/<%= pkg.title %>-win.exe.sig webkitbuilds/<%= pkg.title %>-win.exe'
2016-08-10 13:35:40 -07:00
},
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: {
files: ['src/css/*.css'],
2015-03-06 07:00:10 -08:00
tasks: ['concat:css']
2014-08-21 12:49:04 -07:00
},
2016-06-22 11:53:55 -07:00
sass: {
files: ['src/sass/**/**/*.scss'],
2016-06-22 11:53:55 -07:00
tasks: ['sass', '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',
2016-05-27 11:06:41 -07:00
'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/main.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/moment/min/moment-with-locales.js',
'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',
2016-02-16 09:33:39 -08:00
'bower_components/ng-csv/build/ng-csv.js',
'bower_components/ionic-toast/dist/ionic-toast.bundle.min.js',
'bower_components/angular-clipboard/angular-clipboard.js',
2016-09-13 13:39:01 -07:00
'bower_components/angular-md5/angular-md5.js',
2016-05-26 12:28:37 -07:00
'bower_components/angular-mocks/angular-mocks.js',
2016-10-07 17:03:51 -07:00
'bower_components/ngtouch/src/ngTouch.js',
2016-10-06 15:23:39 -07:00
'angular-bitauth/angular-bitauth.js',
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js'
],
dest: 'www/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',
2016-05-20 07:37:13 -07:00
'src/js/controllers/**/*.js',
2015-03-06 07:00:10 -08:00
'src/js/translations.js',
2016-08-10 13:35:40 -07:00
'src/js/appConfig.js',
2016-09-01 12:51:29 -07:00
'src/js/externalServices.js',
'src/js/init.js',
'src/js/trezor-url.js',
'bower_components/trezor-connect/login.js',
2016-10-07 17:03:51 -07:00
'node_modules/bezier-easing/dist/bezier-easing.min.js',
'node_modules/cordova-plugin-qrscanner/dist/cordova-plugin-qrscanner-lib.min.js'
],
dest: 'www/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'],
dest: 'www/css/copay.css'
}
},
uglify: {
options: {
mangle: false
},
prod: {
files: {
'www/js/copay.js': ['www/js/copay.js'],
'www/lib/angular.js': ['www/lib/angular.js']
}
}
},
nggettext_extract: {
pot: {
files: {
'i18n/po/template.pot': [
'www/index.html',
'www/views/**/*.html',
'src/js/routes.js',
'src/js/services/*.js',
2016-05-27 11:06:41 -07:00
'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: {
2016-05-13 06:49:36 -07:00
ionic_fonts: {
expand: true,
flatten: true,
2016-08-31 08:17:30 -07:00
src: 'bower_components/ionic/release/fonts/ionicons.*',
dest: 'www/fonts/'
2016-05-13 06:49:36 -07:00
},
ionic_js: {
expand: true,
flatten: true,
src: 'bower_components/ionic/release/js/ionic.bundle.min.js',
dest: 'www/lib/'
},
2015-06-02 12:44:59 -07:00
linux: {
files: [{
expand: true,
cwd: 'webkitbuilds/',
src: ['.desktop', '../www/img/app/favicon.ico', '../resources/<%= pkg.name %>/linux/512x512.png'],
2016-10-18 11:27:09 -07:00
dest: 'webkitbuilds/<%= pkg.title %>/linux64/',
flatten: true,
filter: 'isFile'
2015-12-11 10:06:43 -08:00
}],
2015-03-06 07:00:10 -08:00
}
},
2016-07-28 05:07:29 -07:00
nwjs: {
2015-05-28 06:52:33 -07:00
options: {
2016-10-18 11:27:09 -07:00
appName: '<%= pkg.title %>',
2015-12-11 10:06:43 -08:00
platforms: ['win64', 'osx64', 'linux64'],
buildDir: './webkitbuilds',
2016-07-28 05:07:29 -07:00
version: '0.16.0',
macIcns: './resources/<%= pkg.name %>/mac/app.icns',
2016-10-18 11:27:09 -07:00
exeIco: './www/img/app/logo.ico'
2015-05-28 06:52:33 -07:00
},
src: ['./package.json', './www/**/*']
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: {
2016-10-18 11:27:09 -07:00
archive: './webkitbuilds/<%= pkg.title %>-linux.zip'
2015-06-02 12:44:59 -07:00
},
expand: true,
2016-10-18 11:27:09 -07:00
cwd: './webkitbuilds/<%= pkg.title %>/linux64/',
2015-06-02 12:44:59 -07:00
src: ['**/*'],
2016-10-18 11:27:09 -07:00
dest: '<%= pkg.title %>-linux/'
2015-06-02 12:44:59 -07:00
}
},
browserify: {
dist: {
files: {
2016-08-10 12:08:11 -07:00
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js': ['angular-bitcore-wallet-client/index.js'],
2016-10-06 15:23:39 -07:00
'angular-bitauth/angular-bitauth.js': ['angular-bitauth/index.js']
},
}
2014-04-07 11:31:13 -07:00
}
});
2016-09-01 12:51:29 -07:00
grunt.registerTask('default', ['nggettext_compile', 'exec:appConfig', 'exec:externalServices', 'browserify', 'sass', 'concat', 'copy:ionic_fonts', 'copy:ionic_js']);
2015-07-20 11:21:14 -07:00
grunt.registerTask('prod', ['default', 'uglify']);
grunt.registerTask('translate', ['nggettext_extract']);
2016-07-28 05:36:30 -07:00
grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']);
2016-10-18 11:27:09 -07:00
grunt.registerTask('macos', ['prod', 'nwjs', 'exec:macos']);
2016-08-10 13:35:40 -07:00
grunt.registerTask('chrome', ['exec:chrome']);
grunt.registerTask('wp', ['prod', 'exec:wp']);
2016-09-06 13:47:21 -07:00
grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']);
grunt.registerTask('wp-init', ['default', 'exec:wpinit']);
grunt.registerTask('ios', ['exec:ios']);
2016-10-05 21:47:00 -07:00
grunt.registerTask('ios-debug', ['exec:iosdebug']);
2016-08-17 11:23:17 -07:00
grunt.registerTask('ios-run', ['exec:xcode']);
2016-08-10 13:35:40 -07:00
grunt.registerTask('cordovaclean', ['exec:cordovaclean']);
2016-10-05 21:47:00 -07:00
grunt.registerTask('android-debug', ['exec:androiddebug', 'exec:androidrun']);
grunt.registerTask('android', ['exec:android']);
2016-08-10 13:35:40 -07:00
grunt.registerTask('android-release', ['prod', 'exec:android', 'exec:androidsign']);
grunt.registerTask('desktopsign', ['exec:desktopsign', 'exec:desktopverify']);
2014-04-07 11:31:13 -07:00
};