var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));
var _runtimeManager=require("../core/runtimeManager");
var _engineManager=require("../core/engineManager");
var _migrator=require("../core/projectManager/migrator");
var _integrationManager=require("../core/integrationManager");
var _taskManager=require("../core/taskManager");

var _engineCore=_interopRequireDefault(require("../engine-core"));

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

var run=function run(c){var result,taskInstance;return _regenerator.default.async(function run$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return _regenerator.default.awrap(
(0,_engineManager.registerEngine)(c,_engineCore.default));case 2:_context.next=4;return _regenerator.default.awrap(
(0,_runtimeManager.configureRuntimeDefaults)(c));case 4:_context.next=6;return _regenerator.default.awrap(
(0,_migrator.checkAndMigrateProject)(c));case 6:_context.next=8;return _regenerator.default.awrap(
(0,_runtimeManager.updateRenativeConfigs)(c));case 8:_context.next=10;return _regenerator.default.awrap(
(0,_integrationManager.loadIntegrations)(c));case 10:_context.next=12;return _regenerator.default.awrap(
(0,_engineManager.loadEngines)(c));case 12:result=_context.sent;if(

result){_context.next=16;break;}_context.next=16;return _regenerator.default.awrap(
(0,_runtimeManager.updateRenativeConfigs)(c));case 16:if(


c.command){_context.next=19;break;}_context.next=19;return _regenerator.default.awrap(
(0,_engineManager.registerMissingPlatformEngines)(c,taskInstance));case 19:_context.next=21;return _regenerator.default.awrap(

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

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



(0,_taskManager.initializeTask)(c,taskInstance.task));case 27:case"end":return _context.stop();}}},null,null,null,Promise);};var _default=


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