copay/Gruntfile.js

271 lines
8.5 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({
2014-12-30 07:19:16 -08:00
exec: {
2016-08-10 13:35:40 -07:00
appConfig: {
command: 'node ./util/buildAppConfig.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'
},
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'
},
2015-12-11 10:06:43 -08:00
osx: {
2016-04-22 13:02:09 -07:00
command: 'webkitbuilds/build-osx.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 '
},
wp: {
command: 'make -C cordova wp',
},
ios: {
command: 'make -C cordova ios',
},
xcode: {
command: 'open cordova/project-ios/platforms/ios/*.xcodeproj',
},
android: {
command: 'make -C cordova android',
},
androidrun: {
command: 'make -C cordova androidrun',
},
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: {
cmd: 'gpg -u 1112CFA1 --output webkitbuilds/Copay-linux.zip.sig --detach-sig webkitbuilds/Copay-linux.zip && gpg -u 1112CFA1 --output webkitbuilds/Copay-win.exe.sig --detach-sig webkitbuilds/Copay-win.exe'
},
desktopverify: {
cmd: 'gpg --verify webkitbuilds/Copay-linux.zip.sig webkitbuilds/Copay-linux.zip && gpg --verify webkitbuilds/Copay-win.exe.sig webkitbuilds/Copay-win.exe'
},
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'],
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/*.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-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',
2016-05-26 12:28:37 -07:00
'bower_components/angular-mocks/angular-mocks.js',
2016-08-10 12:08:11 -07:00
'angular-pbkdf2/angular-pbkdf2.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',
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',
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'
}
},
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',
'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,
src: 'bower_components/ionic/release/fonts/ionicons.*',
2016-05-27 07:53:17 -07:00
dest: 'public/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: 'public/lib/'
},
ionic_css: {
expand: true,
flatten: true,
src: 'bower_components/ionic/release/css/ionic.min.css',
dest: 'public/css/'
},
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
}
},
2016-07-28 05:07:29 -07:00
nwjs: {
2015-05-28 06:52:33 -07:00
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',
2016-07-28 05:07:29 -07:00
version: '0.16.0',
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: {
2016-08-10 12:08:11 -07:00
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js': ['angular-bitcore-wallet-client/index.js'],
'angular-pbkdf2/angular-pbkdf2.js': ['angular-pbkdf2/index.js']
},
}
2014-04-07 11:31:13 -07:00
}
});
grunt.registerTask('default', ['nggettext_compile', 'exec:appConfig', 'exec:coinbase', 'browserify', 'sass', 'concat', 'copy:ionic_fonts', 'copy:ionic_js', 'copy:ionic_css']);
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']);
2016-06-15 09:53:09 -07:00
grunt.registerTask('test-coveralls', ['browserify', 'karma:prod', 'exec:coveralls']);
2016-07-28 05:36:30 -07:00
grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']);
grunt.registerTask('osx', ['prod', 'nwjs', 'exec:osx']);
2016-08-10 13:35:40 -07:00
grunt.registerTask('chrome', ['exec:chrome']);
grunt.registerTask('wp', ['prod', 'exec:wp']);
grunt.registerTask('wp-debug', ['default', 'exec:wp']);
grunt.registerTask('ios', ['prod', 'exec:ios', 'exec:xcode']);
grunt.registerTask('ios-debug', ['default', 'exec:ios', 'exec:xcode']);
grunt.registerTask('cordovaclean', ['exec:cordovaclean']);
grunt.registerTask('android-debug', ['default', 'exec:android', 'exec:androidrun']);
grunt.registerTask('android', ['prod', 'exec:android']);
grunt.registerTask('android-release', ['prod', 'exec:android', 'exec:androidsign']);
grunt.registerTask('desktopsign', ['exec:desktopsign', 'exec:desktopverify']);
2014-04-07 11:31:13 -07:00
};