From 9a3999d8e29c535ed7fd304a1db5eb2805313416 Mon Sep 17 00:00:00 2001 From: seanyen Date: Wed, 12 Jun 2019 00:29:51 -0700 Subject: add dependencies. --- toolsrc/src/vcpkg/export.chocolatey.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'toolsrc/src') diff --git a/toolsrc/src/vcpkg/export.chocolatey.cpp b/toolsrc/src/vcpkg/export.chocolatey.cpp index aa10ec71d..3e6acd34e 100644 --- a/toolsrc/src/vcpkg/export.chocolatey.cpp +++ b/toolsrc/src/vcpkg/export.chocolatey.cpp @@ -13,6 +13,19 @@ namespace vcpkg::Export::Chocolatey using Dependencies::ExportPlanType; using Install::InstallDir; + static std::string create_nuspec_dependencies(const BinaryParagraph& binary_paragraph) + { + static constexpr auto CONTENT_TEMPLATE = + R"()"; + + std::string nuspec_dependencies; + for (const std::string& depend: binary_paragraph.depends) + { + nuspec_dependencies += Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_ID@", depend); + } + return nuspec_dependencies; + } + static std::string create_nuspec_file_contents(const std::string& exported_root_dir, const BinaryParagraph& binary_paragraph) { @@ -25,6 +38,9 @@ namespace vcpkg::Export::Chocolatey + + @PACKAGE_DEPENDENCIES@ + @@ -45,6 +61,8 @@ namespace vcpkg::Export::Chocolatey Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_DESCRIPTION@", binary_paragraph.description); nuspec_file_content = Strings::replace_all(std::move(nuspec_file_content), "@EXPORTED_ROOT_DIR@", exported_root_dir); + nuspec_file_content = + Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_DEPENDENCIES@", create_nuspec_dependencies(binary_paragraph)); return nuspec_file_content; } -- cgit v1.2.3