Assign some standard tasks and tasks created by third-party plugins to their task groups according to the
order of things for Checkstyle Addons.
179758
public void adjustTaskGroupAssignments()
    {
        final TaskContainer tasks = project.getTasks();
        tasks.getByName(BasePlugin.ASSEMBLE_TASK_NAME).setGroup(ARTIFACTS_GROUP_NAME);
        tasks.getByName(JavaPlugin.JAR_TASK_NAME).setGroup(ARTIFACTS_GROUP_NAME);

        final SourceSet sqSourceSet = buildUtil.getSourceSet(BuildUtil.SONARQUBE_SOURCE_SET_NAME);
        tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME).setGroup(BasePlugin.BUILD_GROUP);
        tasks.getByName(sqSourceSet.getCompileJavaTaskName()).setGroup(BasePlugin.BUILD_GROUP);
        tasks.getByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME).setGroup(BasePlugin.BUILD_GROUP);

        for (final SpotBugsTask sbTask : tasks.withType(SpotBugsTask.class)) {
            sbTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
        }
        for (final Checkstyle csTask : tasks.withType(Checkstyle.class)) {
            csTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
        }
        for (final Copy task : tasks.withType(Copy.class)) {
            if (task.getName().startsWith("process") && task.getName().endsWith("Resources")) {
                task.setGroup(LifecycleBasePlugin.BUILD_GROUP);
            }
        }
    }
650589
def add_tasks(config, tasks_file, tasks_type, priority, redundancy):
    """"""
    res = _add_tasks(config, tasks_file, tasks_type, priority, redundancy)
    click.echo(res)
1106324
function registerTasks (gulp) {
  exec(gulp)
  install(gulp)
  list(gulp)
  update(gulp)
}
1158245
def chain_tasks(tasks):
    
    # If given tasks list is not empty
    if tasks:
        # Previous task
        previous_task = None

        # For given tasks list's each task
        for task in tasks:
            # If the task is not None.
            # Task can be None to allow code like ``task if _PY2 else None``.
            if task is not None:
                # If previous task is not None
                if previous_task is not None:
                    # Set the task to run after the previous task
                    task.set_run_after(previous_task)

                # Set the task as previous task for the next task
                previous_task = task

    # Return given tasks list.
    return tasks
755898
function doConstructorTask(constructor, task) {

		var finished;

		finished = finished_constitutors.get(constructor);

		if (!finished) {
			finished = [];
			finished_constitutors.set(constructor, finished);
		}

		if (finished.indexOf(task) == -1) {
			task.call(constructor);
			finished.push(task);
		}
	}
458669
def _sync_tasks(self, tasks_json):
        """""""
        for task_json in tasks_json:
            task_id = task_json['id']
            project_id = task_json['project_id']
            if project_id not in self.projects:
                # ignore orphan tasks
                continue
            project = self.projects[project_id]
            self.tasks[task_id] = Task(task_json, project)
746460
def load_addon(username, package_name, _globals):
    '''
    '''
    addon_module = get_or_create_module_r(username)
    package_module = __import__(package_name)
    add_tasks_r(addon_module, package_module, package_name)
    _globals.update({username: addon_module})
    del package_module
    del addon_module
29789
final protected function doCommandImportSetUp()
    {
        $this->writeln('Executing <info>setup</info> tasks', true);

        // $this->updateSchema();
        $this->importManager->setUp();

        $this->writeln('Startup tasks complete.', true, true);
    }
897805
protected void processModuleOrdering() {

        Collections.sort(m_ownResourceTypes, new Comparator<CmsResourceTypeConfig>() {

            public int compare(CmsResourceTypeConfig a, CmsResourceTypeConfig b) {

                return ComparisonChain.start().compare(a.getOrder(), b.getOrder()).compare(
                    a.getTypeName(),
                    b.getTypeName()).result();
            }
        });

        Collections.sort(m_ownPropertyConfigurations, new Comparator<CmsPropertyConfig>() {

            public int compare(CmsPropertyConfig a, CmsPropertyConfig b) {

                return ComparisonChain.start().compare(a.getOrder(), b.getOrder()).compare(
                    a.getName(),
                    b.getName()).result();
            }
        });

        Collections.sort(m_functionReferences, new Comparator<CmsFunctionReference>() {

            public int compare(CmsFunctionReference a, CmsFunctionReference b) {

                return ComparisonChain.start().compare(a.getOrder(), b.getOrder()).compare(
                    a.getName(),
                    b.getName()).result();
            }
        });
    }
595529
function(extensions) {
  var
    extensions = extensions || {},
    devExts = extensions.development || [],
    testExts = extensions.test || [],
    prodExts = extensions.production || [];

  gulp.task('default', ['development']);

  gulp.task('post-install-development', [
    'karma:dev',
    'styles',
    'bundle-js:dev:clean',
    'tpl-precompile',
    'watch'
  ].concat(devExts));
  gulp.task('development', ['install-dev-dep'], function() {
    gulp.start('post-install-development');
  });

  gulp.task('post-install-test', [
    'lint',
    'karma'
  ].concat(testExts), cleanTmp);
  gulp.task('test', ['install-dev-dep'], function() {
    gulp.start('post-install-test');
  });

  gulp.task('post-install-production', [
    'styles',
    'bundle-js:clean',
    'tpl-precompile'
  ].concat(prodExts));
  gulp.task('production', ['install-dep'], function() {
    gulp.start('post-install-production');
  });
}
505124
private void assertValidOrderForChecks(List<PassFactory> checks) {
    assertPassOrder(
        checks,
        chromePass,
        checkJsDocAndEs6Modules,
        "The ChromePass must run before after JsDoc and Es6 module checking.");
    assertPassOrder(
        checks,
        closureRewriteModule,
        processDefines,
        "Must rewrite goog.module before processing @define's, so that @defines in modules work.");
    assertPassOrder(
        checks,
        closurePrimitives,
        polymerPass,
        "The Polymer pass must run after goog.provide processing.");
    assertPassOrder(
        checks,
        chromePass,
        polymerPass,
        "The Polymer pass must run after ChromePass processing.");
    assertPassOrder(
        checks,
        polymerPass,
        suspiciousCode,
        "The Polymer pass must run before suspiciousCode processing.");
    assertPassOrder(
        checks,
        dartSuperAccessorsPass,
        TranspilationPasses.es6ConvertSuper,
        "The Dart super accessors pass must run before ES6->ES3 super lowering.");

    if (checks.contains(closureGoogScopeAliases)) {
      checkState(
          checks.contains(checkVariableReferences),
          "goog.scope processing requires variable checking");
    }
    assertPassOrder(
        checks,
        checkVariableReferences,
        closureGoogScopeAliases,
        "Variable checking must happen before goog.scope processing.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        closureCheckModule,
        "Need to gather module metadata before checking closure modules.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        createModuleMapPass,
        "Need to gather module metadata before scanning modules.");

    assertPassOrder(
        checks,
        createModuleMapPass,
        rewriteCommonJsModules,
        "Need to gather module information before rewriting CommonJS modules.");

    assertPassOrder(
        checks,
        rewriteScriptsToEs6Modules,
        gatherModuleMetadataPass,
        "Need to gather module information after rewriting scripts to modules.");

    assertPassOrder(
        checks,
        checkClosureImports,
        rewriteClosureImports,
        "Closure imports must be checked before they are rewritten.");

    assertPassOrder(
        checks,
        j2clPass,
        TranspilationPasses.rewriteGenerators,
        "J2CL normalization should be done before generator re-writing.");
  }
860572
private void setupTaskDefaults(Project project, CpdExtension extension) {
        project.getTasks().withType(Cpd.class).configureEach(task -> {
            ConventionMapping taskMapping = task.getConventionMapping();
            taskMapping.map("encoding", extension::getEncoding);
            taskMapping.map("ignoreAnnotations", extension::isIgnoreAnnotations);
            taskMapping.map("ignoreIdentifiers", extension::isIgnoreIdentifiers);
            taskMapping.map("ignoreFailures", extension::isIgnoreFailures);
            taskMapping.map("ignoreLiterals", extension::isIgnoreLiterals);
            taskMapping.map("language", extension::getLanguage);
            taskMapping.map("minimumTokenCount", extension::getMinimumTokenCount);
            taskMapping.map("pmdClasspath", () -> project.getConfigurations().findByName("cpd"));
            taskMapping.map("skipDuplicateFiles", extension::isSkipDuplicateFiles);
            taskMapping.map("skipLexicalErrors", extension::isSkipLexicalErrors);
            taskMapping.map("skipBlocks", extension::isSkipBlocks);
            taskMapping.map("skipBlocksPattern", extension::getSkipBlocksPattern);

            ConventionMapping extensionMapping = ((IConventionAware) extension).getConventionMapping();
            extensionMapping.map("reportsDir", () -> project.getExtensions().getByType(ReportingExtension.class).file("cpd"));

            task.getReports().all(report -> {
                ConventionMapping reportMapping = ((IConventionAware) report).getConventionMapping();
                reportMapping.map("enabled", () -> "xml".equals(report.getName()));
                reportMapping.map("destination", () -> new File(extension.getReportsDir(), task.getName() + "." + report.getName()));
            });
        });
    }
502030
private void processResourceAssignments(Task task, List<MapRow> assignments)
   {
      for (MapRow row : assignments)
      {
         processResourceAssignment(task, row);
      }
   }
207432
function(cfg, callback) {
  // Input dir
  var inputPath = cfg.input_dir;

  if (inputPath) {
    new gear.Queue({registry: taskRegistry}) // register tasks
    .log(formatLog('Removing directory:', inputPath))
    .removeDir({input: inputPath}, callback)
    .run(callback);
  } else {
    callback();
  }
}
1238005
function Task(options) {
  if (!(this instanceof Task)) {
    return new Task(options);
  }

  utils.is(this, 'task');
  use(this);

  this.options = options || {};
  if (utils.isTask(options)) {
    this.options = {};
    this.addTargets(options);
    return this;
  }
}
1168736
function _managePkgDeps(spkg, tpkg, deps, check) {
  deps = deps||'dependencies';
  const source = spkg[deps]||{};
  const target = tpkg[deps]||{};
  _.keys(source).forEach(function(dep){
    if (!!check && !target[dep]) _state.counters.depAddUpd++;
    _log('[PACKAGE] %s: %s = %s', deps, dep, source[dep]);
    target[dep] = source[dep];
  });
}
274269
@Override
	public void setup(PactTaskContext<GenericCoGrouper<IT1, IT2, OT>, OT> context) {
		this.taskContext = context;
		this.running = true;
	}