8
0

dev.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const initTask = require( './utils/dev-init' );
  7. const pluginCreateTask = require( './utils/dev-plugin-create' );
  8. const pluginInstallTask = require( './utils/dev-plugin-install' );
  9. const pluginUpdateTask = require( './utils/dev-update' );
  10. const pluginStatusTask = require( './utils/dev-status' );
  11. const boilerplateUpdateTask = require( './utils/dev-boilerplate-update' );
  12. const ckeditor5Path = process.cwd();
  13. module.exports = ( grunt ) => {
  14. const packageJSON = grunt.config.data.pkg;
  15. const workspaceRoot = grunt.config.data.workspaceRoot;
  16. grunt.registerTask( 'dev-init', function() {
  17. initTask( ckeditor5Path, packageJSON, workspaceRoot, grunt.log.writeln, grunt.log.error );
  18. } );
  19. grunt.registerTask( 'dev-plugin-create', function() {
  20. const done = this.async();
  21. pluginCreateTask( ckeditor5Path, workspaceRoot, grunt.log.writeln )
  22. .then( done )
  23. .catch( ( error ) => done( error ) );
  24. } );
  25. grunt.registerTask( 'dev-plugin-install', function() {
  26. const done = this.async();
  27. pluginInstallTask( ckeditor5Path, workspaceRoot, grunt.log.writeln )
  28. .then( done )
  29. .catch( ( error ) => done( error ) );
  30. } );
  31. grunt.registerTask( 'dev-update', function() {
  32. pluginUpdateTask( ckeditor5Path, packageJSON, workspaceRoot, grunt.log.writeln, grunt.log.error );
  33. } );
  34. grunt.registerTask( 'dev-status', function() {
  35. pluginStatusTask( ckeditor5Path, packageJSON, workspaceRoot, grunt.log.writeln, grunt.log.error );
  36. } );
  37. grunt.registerTask( 'dev-boilerplate-update', function() {
  38. boilerplateUpdateTask( ckeditor5Path, packageJSON, workspaceRoot, grunt.log.writeln, grunt.log.error );
  39. } );
  40. };