"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;
var _runtimeManager = require("../core/runtimeManager");
var _engineManager = require("../core/engineManager");
var _migrator = require("../core/projectManager/migrator");
var _projectManager = require("../core/projectManager");
var _integrationManager = require("../core/integrationManager");
var _taskManager = require("../core/taskManager");

var _engineCore = _interopRequireDefault(require("../engine-core"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { "default": obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}

var IGNORE_MISSING_ENGINES_TASKS = ['link', 'unlink'];

var run = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(c) {var result, taskInstance;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
              (0, _engineManager.registerEngine)(c, _engineCore["default"]));case 2:_context.next = 4;return (
              (0, _runtimeManager.configureRuntimeDefaults)(c));case 4:_context.next = 6;return (
              (0, _migrator.checkAndMigrateProject)(c));case 6:_context.next = 8;return (
              (0, _runtimeManager.updateRenativeConfigs)(c));case 8:_context.next = 10;return (
              (0, _projectManager.checkAndBootstrapIfRequired)(c));case 10:_context.next = 12;return (
              (0, _integrationManager.loadIntegrations)(c));case 12:_context.next = 14;return (
              (0, _engineManager.loadEngines)(c));case 14:result = _context.sent;if (

            result) {_context.next = 18;break;}_context.next = 18;return (
              (0, _runtimeManager.updateRenativeConfigs)(c));case 18:if (!(


            !c.command && c.paths.project.configExists)) {_context.next = 21;break;}_context.next = 21;return (
              (0, _engineManager.registerMissingPlatformEngines)(c));case 21:_context.next = 23;return (

              (0, _taskManager.findSuitableTask)(c));case 23:taskInstance = _context.sent;if (!(

            c.command && !IGNORE_MISSING_ENGINES_TASKS.includes(c.command))) {_context.next = 27;break;}_context.next = 27;return (
              (0, _engineManager.registerMissingPlatformEngines)(c, taskInstance));case 27:_context.next = 29;return (



              (0, _taskManager.initializeTask)(c, taskInstance.task));case 29:case "end":return _context.stop();}}}, _callee);}));return function run(_x) {return _ref.apply(this, arguments);};}();var _default =


run;exports["default"] = _default;
//# sourceMappingURL=index.js.map