merge in jshint fixes

This commit is contained in:
Chad Engler 2013-12-19 11:30:30 -08:00
commit ce8add7c62
158 changed files with 9855 additions and 10575 deletions

View file

@ -4,13 +4,10 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadTasks('tasks');
var root = 'src/pixi/',
debug = 'bin/pixi.dev.js',
srcFiles = [
var srcFiles = [
'<%= dirs.src %>/Intro.js',
'<%= dirs.src %>/Pixi.js',
'<%= dirs.src %>/core/Point.js',
@ -74,9 +71,9 @@ module.exports = function(grunt) {
'<%= dirs.src %>/filters/DotScreenFilter.js',
'<%= dirs.src %>/filters/CrossHatchFilter.js',
'<%= dirs.src %>/filters/RGBSplitFilter.js',
'<%= dirs.src %>/Outro.js'
], banner = [
],
banner = [
'/**',
' * @license',
' * <%= pkg.name %> - v<%= pkg.version %>',
@ -101,7 +98,7 @@ module.exports = function(grunt) {
},
files: {
srcBlob: '<%= dirs.src %>/**/*.js',
testBlob: '<%= dirs.test %>/unit/**/*.js',
testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js',
build: '<%= dirs.build %>/pixi.dev.js',
buildMin: '<%= dirs.build %>/pixi.js'
},
@ -114,6 +111,7 @@ module.exports = function(grunt) {
dest: '<%= files.build %>'
}
},
/* jshint -W106 */
concat_sourcemap: {
dev: {
files: {
@ -125,11 +123,18 @@ module.exports = function(grunt) {
}
},
jshint: {
beforeconcat: srcFiles,
test: ['<%= files.testBlob %>'],
options: {
asi: true,
smarttabs: true
jshintrc: '.jshintrc'
},
source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'),
test: {
src: ['<%= files.testBlob %>'],
options: {
jshintrc: undefined, //don't use jshintrc for tests
expr: true,
undef: false,
camelcase: false
}
}
},
uglify: {
@ -142,12 +147,6 @@ module.exports = function(grunt) {
}
},
connect: {
qunit: {
options: {
port: grunt.option('port-test') || 9002,
base: './'
}
},
test: {
options: {
port: grunt.option('port-test') || 9002,
@ -156,13 +155,6 @@ module.exports = function(grunt) {
}
}
},
qunit: {
all: {
options: {
urls: ['http://localhost:' + (grunt.option('port-test') || 9002) + '/test/index.html']
}
}
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
@ -176,23 +168,22 @@ module.exports = function(grunt) {
}
}
},
watch: {
dev: {
files: ['Gruntfile.js', 'src/**/*.js', 'examples/**/*.html'],
tasks: ['build-debug'],
// We would need to inject <script> in each HTML...
// options: {
// livereload: true
// }
karma: {
unit: {
configFile: 'test/karma.conf.js',
// browsers: ['Chrome'],
singleRun: true
}
}
});
grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify'])
grunt.registerTask('default', ['concat', 'uglify']);
grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('test', ['build', 'connect:qunit', 'qunit']);
grunt.registerTask('docs', ['yuidoc']);
grunt.registerTask('default', ['build', 'test']);
}
grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']);
grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']);
grunt.registerTask('test', ['concat', 'jshint:test', 'karma']);
grunt.registerTask('docs', ['yuidoc']);
grunt.registerTask('travis', ['test']);
};