MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / execBuildStep

Method execBuildStep

src/plugins/builder/mainframe/buildmanager.cpp:354–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void BuildManager::execBuildStep(QList<BuildMenuType> menuTypelist)
355{
356 // save all modified files before build.
357 dpfGetService(EditorService)->saveAll();
358
359 if (!canStartBuild()) {
360 QMetaObject::invokeMethod(this, "message",
361 Q_ARG(QString, "The builder is running, please try again later!"));
362 return;
363 }
364
365 auto &ctx = dpfInstance.serviceContext();
366 ProjectService *projectService = ctx.service<ProjectService>(ProjectService::name());
367 if (!projectService || !projectService->getProjectInfo)
368 return;
369
370 ProjectInfo projectInfo = projectService->getProjectInfo(d->activedKitName, d->activedWorkingDir);
371 if (!projectInfo.isVaild())
372 return;
373
374 auto builderService = ctx.service<BuilderService>(BuilderService::name());
375 if (builderService) {
376 auto generator = builderService->create<BuilderGenerator>(d->activedKitName);
377 if (generator) {
378 emit sigResetBuildUI();
379 generator->appendOutputParser(d->outputParser);
380 QList<BuildCommandInfo> list;
381 foreach (auto menuType, menuTypelist) {
382 BuildCommandInfo info = generator->getMenuCommand(menuType, projectInfo);
383 QString retMsg;
384 bool ret = generator->checkCommandValidity(info, retMsg);
385 if (!ret) {
386 outputLog(retMsg, OutputPane::OutputFormat::StdErr);
387 continue;
388 }
389 list.append(info);
390 }
391 execCommands(list, false);
392 } else {
393 auto windowService = dpfGetService(WindowService);
394 windowService->notify(1, tr("Warning"), tr("The project does not have an associated build kit. Please reopen the project and select the corresponding build tool."), {});
395 }
396 }
397}
398
399CompileOutputPane *BuildManager::getCompileOutputPane() const
400{

Callers

nothing calls this directly

Calls 5

nameFunction · 0.50
saveAllMethod · 0.45
getProjectInfoMethod · 0.45
appendOutputParserMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected