8
0

gruntfile.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* jshint node: true, esnext: true, varstmt: true */
  2. 'use strict';
  3. const tools = require( './dev/tasks/utils/tools' );
  4. module.exports = ( grunt ) => {
  5. // First register the "default" task, so it can be analyzed by other tasks.
  6. grunt.registerTask( 'default', [ 'jshint:git', 'jscs:git' ] );
  7. // Files that will be ignored by the "jscs" and "jshint" tasks.
  8. const ignoreFiles = [
  9. // Automatically loaded from .gitignore. Add more if necessary.
  10. 'lib/**'
  11. ];
  12. // Basic configuration which will be overloaded by the tasks.
  13. grunt.initConfig( {
  14. pkg: grunt.file.readJSON( 'package.json' ),
  15. workspaceRoot: '..',
  16. jshint: {
  17. options: {
  18. ignores: ignoreFiles
  19. }
  20. },
  21. jscs: {
  22. options: {
  23. excludeFiles: ignoreFiles
  24. }
  25. },
  26. replace: {
  27. copyright: {
  28. src: [ '**/*.*', '**/*.frag' ].concat( tools.getGitIgnore( grunt ).map( i => '!' + i ) ) ,
  29. overwrite: true,
  30. replacements: [
  31. {
  32. from: /\@license Copyright \(c\) 2003-\d{4}, CKSource - Frederico Knabben\./,
  33. to: '@license Copyright (c) 2003-<%= grunt.template.today("yyyy") %>, CKSource - Frederico Knabben.'
  34. }
  35. ]
  36. }
  37. }
  38. } );
  39. // Finally load the tasks.
  40. grunt.loadTasks( 'dev/tasks' );
  41. grunt.loadNpmTasks( 'grunt-text-replace' );
  42. };