Path: blob/master/web-gui/buildyourownbotnet/assets/js/easy-pie-chart/Gruntfile.js
1293 views
module.exports = function (grunt) {12grunt.initConfig({34pkg: grunt.file.readJSON('package.json'),56cfg: {7filename: 'easypiechart',8vanillaExportName: 'EasyPieChart'9},1011dirs: {12tmp: 'tmp',13src: 'src',14dest: 'dist',15docs: 'docs',16test: 'test',17demo: 'demo'18},1920clean: {21all: ['<%= dirs.dest %>/', '<%= dirs.tmp %>/'],22tmp: ['<%= dirs.tmp %>/'],23meteor: ['.build.*', 'versions.json']24},2526concat: {27vanilla: {28src: [29'<%= dirs.src %>/renderer/canvas.js',30'<%= dirs.src %>/<%= cfg.filename %>.js'31],32dest: '<%= dirs.tmp %>/<%= cfg.filename %>.js'33},34jquery: {35src: [36'<%= dirs.src %>/renderer/canvas.js',37'<%= dirs.src %>/<%= cfg.filename %>.js',38'<%= dirs.src %>/jquery.plugin.js'39],40dest: '<%= dirs.tmp %>/jquery.<%= cfg.filename %>.js'41},42angular: {43src: [44'<%= dirs.src %>/angular.directive.js',45'<%= dirs.src %>/renderer/canvas.js',46'<%= dirs.src %>/<%= cfg.filename %>.js'47],48dest: '<%= dirs.tmp %>/angular.<%= cfg.filename %>.js'49}50},5152usebanner: {53options: {54position: 'top',55banner: '/**!\n' +56' * <%= pkg.name %>\n' +57' * <%= pkg.description %>\n' +58' *\n' +59' * @license <%= pkg.license %>\n' +60' * @author <%= pkg.author.name %> <<%= pkg.author.email %>> (<%= pkg.author.url %>)\n' +61' * @version <%= pkg.version %>\n' +62' **/\n'63},64files: {65src: [66'<%= dirs.dest %>/<%= cfg.filename %>.js',67'<%= dirs.dest %>/jquery.<%= cfg.filename %>.js',68'<%= dirs.dest %>/angular.<%= cfg.filename %>.js'69]70}71},7273uglify: {74dist: {75options: {76report: 'gzip',77preserveComments: 'some'78},79files: {80'dist/<%= cfg.filename %>.min.js': ['dist/<%= cfg.filename %>.js'],81'dist/jquery.<%= cfg.filename %>.min.js': ['dist/jquery.<%= cfg.filename %>.js'],82'dist/angular.<%= cfg.filename %>.min.js': ['dist/angular.<%= cfg.filename %>.js']83}84}85},8687watch: {88gruntfile: {89files: ['Gruntfile.js']90},91scripts: {92files: '<%= dirs.src %>/**/*.js',93tasks: ['default'],94options: {95debounceDelay: 25096}97},98less: {99files: '<%= dirs.demo %>/*.less',100tasks: ['less'],101options: {102debounceDelay: 250103}104},105readme: {106files: '<%= dirs.docs %>/**/*.md',107tasks: ['readme'],108options: {109debounceDelay: 250110}111}112},113114jshint: {115files: [116'<%= dirs.src %>/**/*.js',117'<%= dirs.test %>/**/*.js'118],119options: {}120},121122karma: {123unit: {124configFile: 'karma.conf.coffee'125},126ci: {127configFile: 'karma.conf.coffee',128singleRun: true,129browsers: ['PhantomJS']130}131},132133less: {134demo: {135files: {136'<%= dirs.demo %>/style.css': ['<%= dirs.demo %>/style.less']137}138}139},140141umd: {142vanilla: {143src: '<%= dirs.tmp %>/<%= cfg.filename %>.js',144dest: '<%= dirs.dest %>/<%= cfg.filename %>.js',145objectToExport: '<%= cfg.vanillaExportName %>',146globalAlias: '<%= cfg.vanillaExportName %>'147},148jquery: {149src: '<%= dirs.tmp %>/jquery.<%= cfg.filename %>.js',150dest: '<%= dirs.dest %>/jquery.<%= cfg.filename %>.js',151deps: {152'default': ['$'],153amd: ['jquery'],154cjs: ['jquery'],155global: ['jQuery']156}157},158angular: {159src: '<%= dirs.tmp %>/angular.<%= cfg.filename %>.js',160dest: '<%= dirs.dest %>/angular.<%= cfg.filename %>.js',161deps: {162'default': ['angular'],163amd: ['angular'],164cjs: ['angular'],165global: ['angular']166}167}168},169170exec: {171'meteor-init': {172command: [173'type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }'174].join(';')175},176'meteor-publish': {177command: 'meteor publish'178}179}180});181182// load all installed grunt tasks183require('load-grunt-tasks')(grunt);184grunt.loadNpmTasks('grunt-exec');185186// task defiinitions187grunt.registerTask('default', [188'clean:all',189'jshint',190'concat',191'umd',192'usebanner',193'uglify',194'clean:tmp',195'readme'196]);197198grunt.registerTask('test', ['karma:unit']);199grunt.registerTask('all', ['default', 'less']);200grunt.registerTask('meteor-publish', ['exec:meteor-init', 'exec:meteor-publish', 'exec:meteor-cleanup']);201grunt.registerTask('meteor', ['exec:meteor-init', 'exec:meteor-publish', 'exec:meteor-cleanup']);202};203204205