Permalink
Browse files

[dist] Upgrade grunt -> 0.4

  • Loading branch information...
Alejandro Morales
Alejandro Morales committed Feb 19, 2013
1 parent 27af192 commit fc549de03081b1f8270615bd3b1d8713a0830199
Showing with 101 additions and 69 deletions.
  1. +94 −0 Gruntfile.js
  2. +0 −69 grunt.js
  3. +7 −0 package.json
View
@@ -0,0 +1,94 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ // Metadata.
+ pkg: grunt.file.readJSON('package.json'),
+ banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
+ // Task configuration.
+ concat: {
+ options: {
+ banner: '<%= banner %>',
+ stripBanners: true
+ },
+ dist: {
+ src: ['lib/<%= pkg.name %>.js'],
+ dest: 'dist/<%= pkg.name %>.js'
+ }
+ },
+ uglify: {
+ options: {
+ banner: '<%= banner %>'
+ },
+ dist: {
+ src: '<%= concat.dist.dest %>',
+ dest: 'dist/<%= pkg.name %>.min.js'
+ }
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ unused: true,
+ boss: true,
+ eqnull: true,
+ browser: true,
+ globals: {
+ jQuery: true
+ }
+ },
+ gruntfile: {
+ src: 'Gruntfile.js'
+ },
+ lib_test: {
+ src: ['lib/**/*.js', 'test/**/*.js']
+ }
+ },
+ // qunit: {
+ // files: ['test/**/*.html']
+ // },
+ watch: {
+ gruntfile: {
+ files: '<%= jshint.gruntfile.src %>',
+ tasks: ['jshint:gruntfile']
+ },
+ lib_test: {
+ files: '<%= jshint.lib_test.src %>',
+ tasks: ['jshint:lib_test', 'qunit']
+ }
+ }
+ });
+
+ // These plugins provide necessary tasks.
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ // grunt.loadNpmTasks('grunt-contrib-nodeunit');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.registerTask('update', 'updates submodules', function (){
+ var done = this.async();
+ grunt.log.writeln('Actualizando submodulos');
+ grunt.util.spawn({
+ cmd:'/usr/bin/git',
+ args: ['submodule', 'foreach', 'git', 'pull', 'origin', 'master']
+ }, function (err, output){
+ if (err) throw err;
+ grunt.log.writelns(output.stdout);
+ done();
+ });
+ });
+ // Default task.
+ grunt.registerTask('default', ['update','concat' ]);
+
+};
View
@@ -1,69 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
-
- // Project configuration.
- grunt.initConfig({
- pkg: '<json:package.json>',
- meta: {
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
- },
- concat: {
- dist: {
- src: ['<banner:meta.banner>', '<file_strip_banner:lib/<%= pkg.name %>.js>'],
- dest: 'dist/<%= pkg.name %>.js'
- }
- },
- min: {
- dist: {
- src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
- dest: 'dist/<%= pkg.name %>.min.js'
- }
- },
- watch: {
- files: '<config:lint.files>',
- tasks: 'lint qunit'
- },
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- boss: true,
- eqnull: true,
- browser: true,
- node: true,
- laxcomma: true,
- asi: true
- },
- globals: {
- jQuery: true
- }
- },
- uglify: {}
- });
-
- grunt.registerTask('update', 'updates submodules', function (){
- var done = this.async();
- grunt.log.writeln('Actualizando submodulos');
- grunt.utils.spawn({
- cmd:'/usr/bin/git',
- args: ['submodule', 'foreach', 'git', 'pull', 'origin', 'master']
- }, function (err, output){
- if (err) throw err;
- grunt.log.writelns(output.stdout);
- done();
- });
- });
- // Default task.
- grunt.registerTask('default', 'concat min');
-
-};
View
@@ -12,5 +12,12 @@
"socket.io": "~0.9.13",
"poet": "https://github.com/jsspa/poet/tarball/master",
"rss": "0.0.4"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.0",
+ "grunt-contrib-concat": "~0.1.2",
+ "grunt-contrib-watch": "~0.2.0",
+ "grunt-contrib-jshint": "~0.1.1",
+ "grunt-contrib-uglify": "~0.1.1"
}
}

0 comments on commit fc549de

Please sign in to comment.