From: James Friend Date: Thu, 28 Aug 2014 01:32:08 +0000 (+0800) Subject: Merge remote-tracking branch 'upstream/master' into node-requirable X-Git-Tag: v3.3.0~38^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9aeaf19b1dca68ee71e916ae415a0c270a47d301;p=thirdparty%2Fbootstrap.git Merge remote-tracking branch 'upstream/master' into node-requirable Conflicts: Gruntfile.js --- 9aeaf19b1dca68ee71e916ae415a0c270a47d301 diff --cc Gruntfile.js index 3fc645fafe,486b0417fd..60262ab87c --- a/Gruntfile.js +++ b/Gruntfile.js @@@ -17,11 -17,15 +17,16 @@@ module.exports = function (grunt) var fs = require('fs'); var path = require('path'); - var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js'); + var npmShrinkwrap = require('npm-shrinkwrap'); var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js'); + var getLessVarsData = function () { + var filePath = path.join(__dirname, 'less/variables.less'); + var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' }); + var parser = new BsLessdocParser(fileContent); + return { sections: parser.parseFile() }; + }; var generateRawFiles = require('./grunt/bs-raw-files-generator.js'); + var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js'); - var updateShrinkwrap = require('./grunt/shrinkwrap.js'); // Project configuration. grunt.initConfig({ @@@ -460,12 -462,26 +463,31 @@@ generateRawFiles(grunt, banner); }); - grunt.registerTask('build-commonjs', 'Build CommonJS entrypoint module for JS.', function () { ++ grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () { + var files = grunt.config.get('concat.bootstrap.src'); + generateCommonJSModule(grunt, files); + }); + - // Task for updating the npm packages used by the Travis build. - grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']); - grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); }); + // Docs task. + grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']); + grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']); + grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); + grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); + grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-customizer']); + + // Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json). + // This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. + grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']); + grunt.registerTask('_update-shrinkwrap', function () { + var done = this.async(); + npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) { + if (err) { + grunt.fail.warn(err); + } + var dest = 'test-infra/npm-shrinkwrap.json'; + fs.renameSync('npm-shrinkwrap.json', dest); + grunt.log.writeln('File ' + dest.cyan + ' updated.'); + done(); + }); + }); };