@@ -6,17 +6,17 @@ module.exports = function (grunt) {
66
77 grunt . initConfig ( {
88 pkg : grunt . file . readJSON ( "package.json" ) ,
9- exec : {
10- tabfix : {
11- // Cleanup whitespace according to http://contribute.jquery.org/style-guide/js/
12- // (requires https://github.com/mar10/tabfix)
13- cmd : "tabfix -t -r -m*.js,*.css,*.html src demo test "
14- } ,
15- upload : {
16- // FTP upload the demo files (requires https://github.com/mar10/pyftpsync)
17- cmd : "pyftpsync upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_* -x"
18- }
19- } ,
9+ exec : {
10+ tabfix : {
11+ // Cleanup whitespace according to http://contribute.jquery.org/style-guide/js/
12+ // (requires https://github.com/mar10/tabfix)
13+ cmd : "tabfix -t -r -m *.js,*.css,*.html,*json,*.yaml -i node_modules . "
14+ } ,
15+ upload : {
16+ // FTP upload the demo files (requires https://github.com/mar10/pyftpsync)
17+ cmd : "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_* -x"
18+ }
19+ } ,
2020 qunit : {
2121 all : [ "test/index.html" ]
2222 } ,
@@ -32,28 +32,33 @@ module.exports = function (grunt) {
3232 uglify : {
3333 options : {
3434// banner: "/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */\n"
35- banner : "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
36- "<%= grunt.template.today('yyyy-mm-dd') %> | " +
37- "<%= pkg.homepage ? ' ' + pkg.homepage + ' | ' : '' %>" +
38- " Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
39- " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"
35+ banner : "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
36+ "<%= grunt.template.today('yyyy-mm-dd') %> | " +
37+ "<%= pkg.homepage ? ' ' + pkg.homepage + ' | ' : '' %>" +
38+ " Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
39+ " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"
4040 } ,
4141 build : {
4242 src : "jquery.contextmenu.js" ,
4343// dest: "build/jquery.contextmenu-<%= pkg.version %>.min.js"
44- dest : "jquery.contextmenu.min.js"
44+ dest : "jquery.contextmenu.min.js"
4545 }
4646 }
4747 } ) ;
4848
4949 grunt . loadNpmTasks ( "grunt-contrib-jshint" ) ;
5050 grunt . loadNpmTasks ( "grunt-contrib-uglify" ) ;
5151 grunt . loadNpmTasks ( "grunt-contrib-qunit" ) ;
52- grunt . loadNpmTasks ( "grunt-exec" ) ;
52+ grunt . loadNpmTasks ( "grunt-exec" ) ;
5353
54- grunt . registerTask ( "ci" , [ "jshint" , "qunit" ] ) ;
55- grunt . registerTask ( "default" , [ "jshint" , "qunit" , "uglify" ] ) ;
56- grunt . registerTask ( "upload" , [ //"build",
57- "exec:upload" ] ) ;
58- grunt . registerTask ( "build" , [ "exec:tabfix" , "default" ] ) ;
54+ // The 'ci' task is run on travis
55+ grunt . registerTask ( "ci" , [ "jshint" ,
56+ "qunit" ] ) ;
57+ grunt . registerTask ( "default" , [ "jshint" ,
58+ "qunit" ,
59+ "uglify" ] ) ;
60+ grunt . registerTask ( "build" , [ "exec:tabfix" ,
61+ "default" ] ) ;
62+ grunt . registerTask ( "upload" , [ "build" ,
63+ "exec:upload" ] ) ;
5964} ;
0 commit comments