From ab9b01444ff04024bc921f95f29dfd721d6835bf Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Thu, 1 Aug 2013 15:13:00 +0530 Subject: [PATCH] Update to latest grunt Change-Id: I69701a230426af9fa22d3cd312cb24bdc6cf5072 --- Gruntfile.js | 32 ++++++++++++++++ grunt.js | 99 ------------------------------------------------- package.json | 8 ++-- test/index.html | 2 +- 4 files changed, 38 insertions(+), 103 deletions(-) create mode 100644 Gruntfile.js delete mode 100644 grunt.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..82347c1 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,32 @@ +/*! + * Grunt file + * + * @package jquery.i18n + */ +'use strict'; +/*jshint node:true */ +module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-contrib-qunit' ); + + grunt.initConfig( { + pkg: grunt.file.readJSON( 'package.json' ), + jshint: { + options: JSON.parse( grunt.file.read( '.jshintrc' ) + .replace( /\/\*(?:(?!\*\/)[\s\S])*\*\//g, '' ).replace( /\/\/[^\n\r]*/g, '' ) ), + all: ['src/jquery.uls.core.js', + 'src/jquery.uls.lcd.js', + 'src/jquery.uls.data.utils.js', + 'src/jquery.uls.languagefilter.js', + 'src/jquery.uls.regionfilter.js' ] + }, + qunit: { + all: ['test/index.html'] + } + } ); + + grunt.registerTask( 'lint', ['jshint'] ); + grunt.registerTask( 'unit', ['qunit'] ); + grunt.registerTask( 'test', ['lint', 'unit'] ); + grunt.registerTask( 'default', ['test'] ); +}; diff --git a/grunt.js b/grunt.js deleted file mode 100644 index 811756a..0000000 --- a/grunt.js +++ /dev/null @@ -1,99 +0,0 @@ -/* global module:false */ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-css'); - grunt.loadNpmTasks('grunt-contrib-copy'); - // Project configuration. - grunt - .initConfig({ - pkg : '', - 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 : { - js : { - src: [ '','src/jquery.uls.data.js', - 'src/jquery.uls.data.utils.js', 'src/jquery.uls.lcd.js', - 'src/jquery.uls.languagefilter.js', 'src/jquery.uls.regionfilter.js', - 'src/jquery.uls.core.js'], - dest : 'dist/<%= pkg.name %>/<%= pkg.name %>.js' - }, - css: { - src: [ 'css/jquery.uls.css', 'css/jquery.uls.grid.css', - 'css/jquery.uls.lcd.css', 'css/jquery.uls.compact.css' ], - dest : 'dist/<%= pkg.name %>/css/<%= pkg.name %>.css' - } - }, - copy: { - dist: { - files: { - 'dist/jquery.uls/i18n/': 'i18n/**', - 'dist/jquery.uls/images/': 'images/**' - } - } - }, - min : { - dist : { - src : [ '', - '' ], - dest : 'dist/<%= pkg.name %>/<%= pkg.name %>.min.js' - } - }, - qunit : { - files : [ 'test/**/*.html' ] - }, - cssmin : { - dist: { - src : '', - dest : 'dist/<%= pkg.name %>/css/<%= pkg.name %>.min.css' - } - }, - lint : { - files : [ 'src/**/*.js', 'test/**/*.js' ] - }, - csslint : { - file: [ 'css/**/*.css' ] - }, - watch : { - files : '', - tasks : 'lint' - }, - jshint : { - options : { - curly : true, - eqeqeq : true, - immed : true, - latedef : true, - newcap : true, - noarg : true, - sub : true, - undef : true, - boss : true, - eqnull : true, - browser : true, - smarttabs : true, - laxbreak : true, - multistr: true - }, - globals : { - jQuery : true, - QUnit : true, - pluralRuleParser : true, - _ : true, - module : true, - test : true - } - }, - uglify : { - src : [ '', '' ], - dest : 'dist/<%= pkg.name %>.min.js' - } - }); - // Default task. - grunt.registerTask('default', 'lint cssmin concat min copy csslint'); - grunt.registerTask('test', 'lint qunit'); - -}; diff --git a/package.json b/package.json index aec2924..09b69be 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,11 @@ "jQuery": "~1.7.3" }, "devDependencies": { - "grunt": "~0.3.9", - "grunt-compare-size": ">=0.1.4", - "grunt-css": ">0.0.0", + "grunt": "~0.4.1", + "grunt-cli": "~0.1", + "grunt-contrib-jshint": "~0.5.4", + "grunt-contrib-qunit": "~0.2.1", + "grunt-contrib-jasmine": "~0.4", "grunt-contrib-copy": ">0.0.0" }, "repository": { diff --git a/test/index.html b/test/index.html index 35b7920..883d372 100644 --- a/test/index.html +++ b/test/index.html @@ -5,7 +5,7 @@ jQuery ULS Test Suite - +