<commit_before>library build;

import 'dart:async';
import "dart:io";

import "package:grinder/grinder.dart";
import 'package:yaml/yaml.dart';

part 'docgen.dart';
part 'utils.dart';
part 'version.dart';
part 'analyze.dart';
part 'config.dart';

void main(List<String> args) {
  init();

  task("docs", createDocGenTask(".", out_dir: parse_config_value(getvar("docs.output"))));
  task("analyze", createAnalyzerTask(getvar("analyzer.files").map(parse_config_value)));
  task("test", (context) {
    runDartScript(context, getvar("test.file", "test/run.dart"));
  });
  task("version", createVersionTask());
  task("publish", (context) {
    runSdkBinary(context, "pub", arguments: ["publish", "-f"]);
  }, depends: ["version"]);
  task("check", (_) {}, depends: getvar("check.tasks").map(parse_config_value).toList());

  startGrinder(args);
}

void task(String name, TaskFunction function, {List<String> depends}) => defineTask(name, taskFunction: function, depends: depends);<commit_msg>Fix Bug in Build System<commit_after>#!/usr/bin/env dart

library build;

import 'dart:async';
import "dart:io";

import "package:grinder/grinder.dart";
import 'package:yaml/yaml.dart';

part 'docgen.dart';
part 'utils.dart';
part 'version.dart';
part 'analyze.dart';
part 'config.dart';

void main(List<String> args) {
  init();

  task("docs", createDocGenTask(".", out_dir: parse_config_value(getvar("docs.output", "out/docs"))));
  
  task("analyze", createAnalyzerTask(getvar("analyzer.files", []).map(parse_config_value)));
  
  task("test", (context) {
    runDartScript(context, getvar("test.file", "test/run.dart"));
  });
  
  task("version", createVersionTask());
  
  task("publish", (context) {
    runSdkBinary(context, "pub", arguments: ["publish", "-f"]);
  }, depends: ["version"]);
  
  task("check", (_) {}, depends: getvar("check.tasks", []).map(parse_config_value).toList());

  startGrinder(args);
}

void task(String name, TaskFunction function, {List<String> depends: const []}) {
  defineTask(name, taskFunction: function, depends: depends);
}
{'fraction_non_alphanumeric': 0.19931939718035974, 'fraction_numerical': 0.0, 'mean_word_length': 6.221052631578948, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2920544', 'n_tokens_mistral': 711, 'n_tokens_neox': 704, 'n_words': 133}