Selaa lähdekoodia

Added replace:copyright task.

Szymon Kupś 10 vuotta sitten
vanhempi
commit
a5afb296eb
2 muutettua tiedostoa jossa 17 lisäystä ja 1 poistoa
  1. 15 0
      gruntfile.js
  2. 2 1
      package.json

+ 15 - 0
gruntfile.js

@@ -1,6 +1,7 @@
 /* jshint node: true, esnext: true, varstmt: true */
 
 'use strict';
+const tools = require( './dev/tasks/utils/tools' );
 
 module.exports = ( grunt ) => {
 	// First register the "default" task, so it can be analyzed by other tasks.
@@ -27,9 +28,23 @@ module.exports = ( grunt ) => {
 			options: {
 				excludeFiles: ignoreFiles
 			}
+		},
+
+		replace: {
+			copyright: {
+				src: [ '**/*.*', '**/*.frag' ].concat( tools.getGitIgnore( grunt ).map( i => '!' + i ) )  ,
+				overwrite: true,
+				replacements: [
+					{
+						from: /\@license Copyright \(c\) 2003-\d{4}, CKSource - Frederico Knabben\./,
+						to: '@license Copyright (c) 2003-<%= grunt.template.today("yyyy") %>, CKSource - Frederico Knabben.'
+					}
+				]
+			}
 		}
 	} );
 
 	// Finally load the tasks.
 	grunt.loadTasks( 'dev/tasks' );
+	grunt.loadNpmTasks( 'grunt-text-replace' );
 };

+ 2 - 1
package.json

@@ -23,9 +23,10 @@
     "chai": "^1.10.0",
     "del": "^2.0.2",
     "grunt": "^0",
-    "grunt-jscs": "^2.0.0",
     "grunt-contrib-jshint": "^0",
     "grunt-githooks": "^0",
+    "grunt-jscs": "^2.0.0",
+    "grunt-text-replace": "^0.4.0",
     "inquirer": "^0.11.0",
     "mocha": "^2.2.5",
     "ncp": "^2.0.0",