| 352 | } |
| 353 | |
| 354 | void 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 | |
| 399 | CompileOutputPane *BuildManager::getCompileOutputPane() const |
| 400 | { |
nothing calls this directly
no test coverage detected