diff options
Diffstat (limited to 'toolsrc/src/commands_ci.cpp')
| -rw-r--r-- | toolsrc/src/commands_ci.cpp | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index ca5e8a9a9..75ff65556 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -41,57 +41,19 @@ namespace vcpkg::Commands::CI StatusParagraphs status_db = database_load_check(paths); const auto& paths_port_file = Dependencies::PathsPortFile(paths); - const std::vector<InstallPlanAction> install_plan = + std::vector<InstallPlanAction> install_plan = Dependencies::create_install_plan(paths_port_file, specs, status_db); Checks::check_exit(VCPKG_LINE_INFO, !install_plan.empty(), "Install plan cannot be empty"); - std::vector<BuildResult> results; - std::vector<std::string> timing; - const ElapsedTime timer = ElapsedTime::create_started(); - size_t counter = 0; - const size_t package_count = install_plan.size(); const Build::BuildPackageOptions install_plan_options = {Build::UseHeadVersion::NO, Build::AllowDownloads::YES}; - for (const InstallPlanAction& action : install_plan) - { - const ElapsedTime build_timer = ElapsedTime::create_started(); - counter++; - const std::string display_name = action.spec.to_string(); - System::println("Starting package %d/%d: %s", counter, package_count, display_name); + const std::vector<Dependencies::AnyAction> action_plan = + Util::fmap(install_plan, [](InstallPlanAction& install_action) { + return Dependencies::AnyAction(std::move(install_action)); + }); - timing.push_back("0"); - results.push_back(BuildResult::NULLVALUE); - - const BuildResult result = - Install::perform_install_plan_action(paths, action, install_plan_options, status_db); - timing.back() = build_timer.to_string(); - results.back() = result; - System::println("Elapsed time for package %s: %s", action.spec, build_timer.to_string()); - } - - System::println("Total time taken: %s", timer.to_string()); - - for (size_t i = 0; i < results.size(); i++) - { - System::println("%s: %s: %s", install_plan[i].spec, Build::to_string(results[i]), timing[i]); - } - - std::map<BuildResult, int> summary; - for (const BuildResult& v : Build::BuildResult_values) - { - summary[v] = 0; - } - - for (const BuildResult& r : results) - { - summary[r]++; - } - - System::println("\n\nSUMMARY"); - for (const std::pair<const BuildResult, int>& entry : summary) - { - System::println(" %s: %d", Build::to_string(entry.first), entry.second); - } + Install::perform_and_exit( + action_plan, install_plan_options, Install::KeepGoing::YES, Install::PrintSummary::YES, paths, status_db); Checks::exit_success(VCPKG_LINE_INFO); } |
