diff --git a/Gruntfile.js b/Gruntfile.js index 88a973a4e8d..dfd78dee937 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,7 +4,7 @@ var getTestTasks = function() { var suite = process.env.TEST_SUITE; var testTasks = ['testee']; if(suite === 'loaders') { - testTasks = ['testee:steal', 'testee:amd']; + testTasks = ['simplemocha', 'testee:steal', 'testee:amd']; } else if(suite === 'dists') { testTasks = [ 'testee:dist', 'testee:dev', 'testee:compatibility' ]; } else if(suite === 'individuals') { @@ -18,11 +18,6 @@ module.exports = function (grunt) { var _ = grunt.util._; var builderJSON = grunt.file.readJSON('builder.json'); var pkg = grunt.file.readJSON('package.json'); - var banner = _.template(builderJSON.banner, { - pkg: pkg, - ids: [ 'CanJS default build' ], - url: pkg.homepage - }); var testifyDist = { template: 'test/templates/__configuration__-dist.html.ejs', builder: builderJSON, @@ -228,6 +223,21 @@ module.exports = function (grunt) { "export-helpers": require("./build/config_meta_defaults")() } }, + usebanner: { + taskName: { + options: { + position: 'top', + banner: _.template(builderJSON.banner, { + pkg: pkg, + ids: [ 'CanJS default build' ] + }), + linebreak: true + }, + files: { + src: [ 'dist/**/*.js' ] + } + } + }, testee: { options: { timeout: 10000, @@ -268,13 +278,15 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-jsbeautifier'); grunt.loadNpmTasks('grunt-docco2'); grunt.loadNpmTasks('grunt-plato'); + grunt.loadNpmTasks('grunt-banner'); grunt.loadNpmTasks('steal-tools'); grunt.loadNpmTasks('grunt-simple-mocha'); grunt.loadNpmTasks('testee'); grunt.registerTask('default', ['build']); - grunt.registerTask('build', ['clean', 'steal-export', 'string-replace:version', 'browserify-package']); + grunt.registerTask('build', ['clean', 'steal-export', + 'string-replace:version', 'browserify-package', 'usebanner']); grunt.registerTask('build:amd',[ 'clean:build', 'steal-export:amd', @@ -287,8 +299,7 @@ module.exports = function (grunt) { ]); - grunt.registerTask('test', ['jshint', 'build', 'testify', 'simplemocha'] - .concat(getTestTasks())); + grunt.registerTask('test', ['jshint', 'build', 'testify'].concat(getTestTasks())); grunt.registerTask('test:compatibility', ['build', 'testify', 'testee:compatibility']); grunt.registerTask('test:steal', ['testee:steal']); grunt.registerTask('test:amd', ['build:amd', 'testify', 'testee:amd']); diff --git a/builder.json b/builder.json index 46d1af2cdb5..a5ea68f59e1 100644 --- a/builder.json +++ b/builder.json @@ -1,6 +1,6 @@ { "filename": "can.custom.js", - "banner": "/*!\n * <%= pkg.title || pkg.name %> - <%= pkg.version %>\n * <%= pkg.homepage %>\n * Copyright (c) <%= new Date().getFullYear() %> <%= pkg.author.name %>\n * <%= new Date().toUTCString() %>\n * Licensed <%= pkg.licenses[0].type %><% if(typeof url !== \"undefined\") { %>\n * Includes: <%= ids %>\n * Download from: <%= url %>\n<% } %> */\n", + "banner": "/*!\n * <%= pkg.title || pkg.name %> - <%= pkg.version %>\n * <%= pkg.homepage %>\n * Copyright (c) <%= new Date().getFullYear() %> <%= pkg.author.name %>\n * <%= new Date().toUTCString() %>\n * Licensed <%= pkg.licenses[0].type %>\n<% if(typeof url !== \"undefined\") { %>\n * Includes: <%= ids %>\n * Download from: <%= url %>\n<% } %> */\n", "modules": { "can/component/component": { "name": "can.Component", diff --git a/package.json b/package.json index 0e43e28a469..746b442d4f5 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "can", + "title": "CanJS", "description": "MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.", "version": "2.2.0-alpha.10", "author": { @@ -22,6 +23,7 @@ "browserify": "~8.1.0", "connect": "^2.14.4", "grunt": "~0.4.0", + "grunt-banner": "^0.3.1", "grunt-cli": "~0.1.7", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-connect": "~0.3.0",