How to use the grunt.loadTasks function in grunt

To help you get started, we’ve selected a few grunt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jaubourg / grunt-update-submodules / test / unit.js View on Github external
},
			withCustomParameters: {
				options: {
					params: "--force" // specifies your own command-line parameters
				}
			},
			withNoParameter: {
				options: {
					params: false // blanks command-line parameters
				}
			}
		}
	} );

	// Load tasks
	grunt.loadTasks( path.resolve( __dirname, "../tasks" ) );

	//grunt.registerTask( "default", "update_submodules" );
	//grunt.registerTask( "withCustomParameters", "update_submodules:withCustomParameters" );
	//grunt.registerTask( "withNoParameter", "update_submodules:withNoParameter" );

	return function( task, callback ) {
		var stdout = "";
		var oldWrite = process.stdout.write;
		process.stdout.write = function( string ) {
			stdout += string;
		};
		grunt.tasks( [ task ], {
			verbose: true,
			color: false
		}, function() {
			process.stdout.write = oldWrite;
github spmjs / spm / lib / sdk / grunt.js View on Github external
// global task name should begin with grunt
      if (!/^grunt/.test(depName)) return;
      var filepath = path.join(rootdir, 'node_modules', depName);
      if (grunt.file.exists(filepath)) {
        // Load this task plugin recursively
        grunt.loadGlobalTasks(path.relative(NODE_PATH, filepath));
      }
    });
    // Load the tasks of itself
    if (grunt.file.exists(taskdir)) {
      grunt.loadTasks(taskdir);
    }
    return;
  }
  if (grunt.file.exists(taskdir)) {
    grunt.loadTasks(taskdir);
  } else {
    grunt.log.error('Global task ' + name + ' not found.');
  }
};
github prabhash1785 / NodeJS / MyPlayGround / Gruntfile.js View on Github external
/**
 * Created by prrathore on 5/23/15.
 */

'use strict';

var grunt = require('grunt');

//load tasks from tasks directory
grunt.loadTasks('./tasks');

//use grunt-config-dir only when you are not using grunt.initConfig({})
//this could be used to pass options config object from the actual tasks defined in external files
//require('grunt-config-dir')(grunt, {
//    configDir: require('path').resolve('tasks')
//});

grunt.initConfig({
    echo: {
        param1: 'hello',
        param2: 'hi'

    },
    jshint: {
        options: {
            jshintrc: true
github jesseditson / Urza / cli / build.js View on Github external
var setup = function(){
  grunt.loadTasks(__dirname + '/../node_modules/grunt/tasks');
  // load custom tasks here
  //grunt.loadTasks(__dirname + '/tasks');
  // Initialize grunt with our own grunt.js config.
  // TODO: allow overrides
  require(__dirname + '/../grunt')(grunt);
  // Hacky workaround for proper grunt initialization
  // reference: https://github.com/cowboy/grunt/issues/189
  grunt.tasks([], {'version': true});
}
github Polymer / web-component-tester / test / unit / grunt.js View on Github external
before(function() {
    grunt.initConfig({
      'wct-test': {
        'passthrough': {
          options: {foo: 1, bar: 'asdf'},
        },
        'override': {
          options: {sauce: {username: '--real-sauce--'}},
        },
      },
    });
    grunt.loadTasks(path.resolve(__dirname, '../../tasks'));
  });
github electron-archive / grunt-electron-installer / spec / installer-spec.js View on Github external
function existsFileInOutput(filename) {
      return fs.existsSync(path.join(outputDirectory, filename));
    }

    grunt.config.init({
      pkg: grunt.file.readJSON(path.join(__dirname, 'fixtures', 'app', 'resources', 'app', 'package.json')),
      'create-windows-installer': {
        config: {
          appDirectory: path.join(__dirname, 'fixtures', 'app'),
          outputDirectory: outputDirectory
        }
      }
    });

    grunt.loadTasks(path.join(__dirname, '..', 'tasks'));

    let tasksDone = false;

    grunt.registerTask('done', 'done', function () {
      tasksDone = true;
    });

    grunt.task.run(['create-windows-installer', 'done']).start();

    waitsFor(30000, function () {
      return tasksDone;
    });

    runs(function () {
      expect(existsFileInOutput('myapp-1.0.0-full.nupkg')).toBe(true);
      expect(existsFileInOutput('MyAppSetup.exe')).toBe(true);
github snowplow / aws-lambda-nodejs-example-project / Gruntfile.js View on Github external
function: 'deployLambda'
        }
    },
    associateStream: {
        default: {
            function: 'associateStream'
        }
    },
    generateEvents: {
        default: {
            function: 'generateEvents'
        }
    }
});

grunt.loadTasks('tasks');
grunt.registerTask('init', ['dynamo','createRole','kinesis']);
grunt.registerTask('role', ['attachRole','packaging']);
grunt.registerTask('deploy', ['deployLambda']);
grunt.registerTask('connect', ['associateStream']);
grunt.registerTask('events', ['generateEvents']);
github actionhero / actionhero / gruntfile.js View on Github external
var grunt = require('grunt');

grunt.loadTasks(__dirname + '/grunt');