aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_install.cpp
diff options
context:
space:
mode:
authorDaniel Shaw <danielshaw1212@gmail.com>2017-07-24 16:11:22 -0700
committerGitHub <noreply@github.com>2017-07-24 16:11:22 -0700
commitb277b4dda3a2793fd59a6cca5de96f8bc65f1357 (patch)
tree67299d7ae4d032948d4d65a2f494b61fac025b0a /toolsrc/src/commands_install.cpp
parent3c841c6128ebfe8e99a372f2907bd985b533a799 (diff)
parent59389ca236b005922cf1101f66c957d2396f6371 (diff)
downloadvcpkg-b277b4dda3a2793fd59a6cca5de96f8bc65f1357.tar.gz
vcpkg-b277b4dda3a2793fd59a6cca5de96f8bc65f1357.zip
Merge pull request #1461 from Microsoft/create_install_tests
feature packages graph algorithm
Diffstat (limited to 'toolsrc/src/commands_install.cpp')
-rw-r--r--toolsrc/src/commands_install.cpp40
1 files changed, 37 insertions, 3 deletions
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp
index 73b3e9eab..2ce5b6c62 100644
--- a/toolsrc/src/commands_install.cpp
+++ b/toolsrc/src/commands_install.cpp
@@ -16,6 +16,8 @@ namespace vcpkg::Commands::Install
using Dependencies::InstallPlanAction;
using Dependencies::RequestType;
using Dependencies::InstallPlanType;
+ using Dependencies::RemovePlanAction;
+ using Dependencies::RemovePlanType;
InstallDir InstallDir::from_destination_root(const fs::path& destination_root,
const std::string& destination_subdirectory,
@@ -290,7 +292,7 @@ namespace vcpkg::Commands::Install
return BuildResult::SUCCEEDED;
}
- if (plan_type == InstallPlanType::BUILD_AND_INSTALL)
+ if (plan_type == InstallPlanType::BUILD_AND_INSTALL && !g_feature_packages)
{
if (use_head_version)
System::println("Building package %s from HEAD... ", display_name);
@@ -318,7 +320,36 @@ namespace vcpkg::Commands::Install
return BuildResult::SUCCEEDED;
}
- if (plan_type == InstallPlanType::INSTALL)
+ if (plan_type == InstallPlanType::BUILD_AND_INSTALL && g_feature_packages)
+ {
+ if (use_head_version)
+ System::println("Building package %s from HEAD... ", display_name);
+ else
+ System::println("Building package %s... ", display_name);
+
+ const Build::BuildPackageConfig build_config{
+ *action.any_paragraph.source_control_file.value_or_exit(VCPKG_LINE_INFO),
+ action.spec.triplet(),
+ paths.port_dir(action.spec),
+ build_package_options,
+ action.feature_list};
+ const auto result = Build::build_package(paths, build_config, status_db);
+ if (result.code != Build::BuildResult::SUCCEEDED)
+ {
+ System::println(System::Color::error, Build::create_error_message(result.code, action.spec));
+ return result.code;
+ }
+ System::println("Building package %s... done", display_name);
+
+ const BinaryParagraph bpgh =
+ Paragraphs::try_load_cached_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO);
+ System::println("Installing package %s... ", display_name);
+ install_package(paths, bpgh, &status_db);
+ System::println(System::Color::success, "Installing package %s... done", display_name);
+ return BuildResult::SUCCEEDED;
+ }
+
+ if (plan_type == InstallPlanType::INSTALL && !g_feature_packages)
{
if (use_head_version && is_user_requested)
{
@@ -359,7 +390,10 @@ namespace vcpkg::Commands::Install
// create the plan
StatusParagraphs status_db = database_load_check(paths);
- std::vector<InstallPlanAction> install_plan = Dependencies::create_install_plan(paths, specs, status_db);
+
+ Dependencies::PathsPortFile paths_port_file(paths);
+ 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");
// log the plan