{"size": 2322, "ext": "js", "max_stars_repo_path": "src/example/core-example.js", "max_stars_repo_name": "morsik/hawtio-core", "max_stars_repo_stars_event_min_datetime": "2015-02-06T15:16:49.000Z", "max_stars_repo_stars_event_max_datetime": "2017-10-26T02:36:32.000Z", "max_issues_repo_path": "src/example/core-example.js", "max_issues_repo_name": "morsik/hawtio-core", "max_issues_repo_issues_event_min_datetime": "2015-04-14T20:46:36.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-03T05:28:59.000Z", "max_forks_repo_path": "src/example/core-example.js", "max_forks_repo_name": "morsik/hawtio-core", "max_forks_repo_forks_event_min_datetime": "2015-01-23T15:07:29.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-19T08:37:12.000Z"}
{"max_stars_count": 11, "max_issues_count": 47, "max_forks_count": 19, "avg_line_length": 25.2391304348, "max_line_length": 106, "alphanum_fraction": 0.6920757967}
var log = Logger.get('test-code');
log.setLevel(Logger.DEBUG);

// Simple task that's just a function, no name, no dependencies
hawtioPluginLoader.registerPreBootstrapTask(function (next) {
  next();
});

// A task that requires some other task to run first
hawtioPluginLoader.registerPreBootstrapTask({
  name: "AsyncDependantTask",
  depends: ["AsyncTask"],
  task: function (next) {
    log.info("Async task ran...");
    next();
  }
});

// setBootstrapElement can be used to change what element will be passed to angular.bootstrap
hawtioPluginLoader.registerPreBootstrapTask({
  name: "ChangeBootstrapEl",
  task: function (next) {
    hawtioPluginLoader.setBootstrapElement(document.body);
    next();
  }
});

// another simple task, does nothing, not sure why there's a duplicate here :-)
hawtioPluginLoader.registerPreBootstrapTask(function (next) {
  next();
}, true);

// Another dependent task, this one is async, the task list continues once the timeout completes
hawtioPluginLoader.registerPreBootstrapTask({
  name: "AsyncTask",
  depends: ["ParentTask1"],
  task: function (next) {
    log.info("Async task loading");
    setTimeout(function () {
      log.info("Async task executing");
      next();
    }, 1000);
    log.info("Async task exiting");
  }
});

// Task that depends on a couple other tasks
hawtioPluginLoader.registerPreBootstrapTask({
  name: 'other-child',
  depends: ['child-task', 'unnamed-task-2'],
  task: function (next) {
    next();
  }
});

// Task that depends on another task that isn't actually defined, winds up being orphaned and not executed
hawtioPluginLoader.registerPreBootstrapTask({
  name: "Bunk Task 1",
  depends: ['pastry'],
  task: function (next) {
    next();
  }
});
hawtioPluginLoader.registerPreBootstrapTask({
  name: "child-task",
  depends: ["ParentTask1"],
  task: function (next) {
    next();
  }
});
hawtioPluginLoader.registerPreBootstrapTask({
  name: "Named Task",
  task: function (next) {
    next();
  }
});
hawtioPluginLoader.registerPreBootstrapTask({
  name: "ParentTask1",
  task: function (next) {
    next();
  }
});
// these won't get executed, they depend on tasks that
// haven't been registered
hawtioPluginLoader.registerPreBootstrapTask({
  name: "Bunk Task 2",
  depends: ['foo', 'bar'],
  task: function (next) {
    next();
  }
});
