copay/Gruntfile.js

223 lines
6.2 KiB
JavaScript
Raw Normal View History

2014-04-07 11:31:13 -07:00
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
2015-03-06 07:00:10 -08:00
pkg: grunt.file.readJSON('package.json'),
2014-09-19 13:22:05 -07:00
release: {
options: {
bump: true,
file: 'package.json',
add: true,
commit: true,
tag: true,
push: true,
pushTags: true,
npm: false,
npmtag: true,
tagName: 'v<%= version %>',
commitMessage: 'New release v<%= version %>',
tagMessage: 'Version <%= version %>',
2014-09-23 11:24:57 -07:00
github: {
2014-09-19 13:22:05 -07:00
repo: 'bitpay/copay',
2014-09-24 21:58:27 -07:00
usernameVar: 'GITHUB_USERNAME', //ENVIRONMENT VARIABLE that contains Github username
2014-09-19 13:22:05 -07:00
passwordVar: 'GITHUB_PASSWORD' //ENVIRONMENT VARIABLE that contains Github password
}
}
},
2014-12-30 07:19:16 -08:00
exec: {
2015-03-06 07:00:10 -08:00
version: {
command: 'node ./util/version.js'
},
2015-03-06 07:00:10 -08:00
clear: {
command: 'rm -Rf bower_components node_modules'
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...');
},
},
2014-04-07 11:31:13 -07:00
readme: {
files: ['README.md'],
tasks: ['markdown']
},
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
},
markdown: {
all: {
files: [{
expand: true,
src: 'README.md',
2015-03-06 07:00:10 -08:00
dest: './doc',
2014-04-07 11:31:13 -07:00
ext: '.html'
}]
}
},
concat: {
2015-03-06 07:00:10 -08:00
options: {
sourceMap: false,
sourceMapStyle: 'link' // embed, link, inline
},
angular: {
src: [
'bower_components/fastclick/lib/fastclick.js',
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-moment/angular-moment.js',
'bower_components/ng-lodash/build/ng-lodash.js',
'bower_components/angular-qrcode/qrcode.js',
'bower_components/angular-gettext/dist/angular-gettext.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-bitcore-wallet-client/angular-bitcore-wallet-client.js',
'bower_components/angular-ui-switch/angular-ui-switch.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',
'src/js/init.js'
],
2015-03-06 07:00:10 -08:00
dest: 'public/js/copay.js'
},
2015-03-06 07:00:10 -08:00
css: {
src: ['src/css/*.css'],
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: {
'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-03-06 07:00:10 -08:00
'src/js/translations.js': ['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/'
}
},
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: {
platforms: ['win','osx','linux'],
buildDir: './webkitbuilds',
version: '0.12.2',
macIcns: './public/img/icons/icon.icns',
exeIco: './public/img/icons/icon.ico'
},
src: ['./package.json', './public/**/*']
2014-04-07 11:31:13 -07:00
}
});
2015-03-06 07:00:10 -08:00
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-angular-gettext');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');
2015-05-28 06:52:33 -07:00
grunt.loadNpmTasks('grunt-node-webkit-builder');
2014-09-08 11:42:55 -07:00
grunt.registerTask('default', [
2015-03-06 07:00:10 -08:00
'nggettext_compile', 'exec:version', 'concat', 'copy'
]);
grunt.registerTask('prod', [
2015-03-06 07:00:10 -08:00
'default', 'uglify'
]);
grunt.registerTask('translate', ['nggettext_extract']);
2015-03-06 07:00:10 -08:00
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('test-coveralls', ['karma:prod', 'coveralls']);
2015-05-28 06:52:33 -07:00
grunt.registerTask('desktop', ['prod', 'nodewebkit']);
2014-04-07 11:31:13 -07:00
};