aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-07-31 11:53:42 -0700
committerGitHub <noreply@github.com>2020-07-31 11:53:42 -0700
commit56fffbe49dfb4dd8fae0940f272c5fd2b86be991 (patch)
tree089a1e7d10c178d5f5aa916bd7127304b6aa9378 /toolsrc/src
parent37f7d69757d7e52e21a391710fdbd3ef17f2540a (diff)
downloadvcpkg-56fffbe49dfb4dd8fae0940f272c5fd2b86be991.tar.gz
vcpkg-56fffbe49dfb4dd8fae0940f272c5fd2b86be991.zip
[vcpkg] Refactor Commands: Part 1 (#12585)
* Rename commands.exportifw.cpp -> export.ifw.cpp * move DryRun from commands.h -> commands.interface.h * move vcpkgcmdarguments and vcpkgpaths over to commands.interface.h * move vcpkg::Commands::BuildExternal -> commands.buildexternal.h * add commands.*.h for the commands.*.cpp * move vcpkg::Commands::* to commands.*.h * move vcpkg::Commands::{Hash,Fetch} to their own files * change include commands.h -> commands.*.h in commands.*.cpp * remove commands.*.h from commands.h * join vcpkg::Commands::* into one namespace line * fix vcxproj build
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg-test/commands.create.cpp2
-rw-r--r--toolsrc/src/vcpkg.cpp2
-rw-r--r--toolsrc/src/vcpkg/build.cpp1
-rw-r--r--toolsrc/src/vcpkg/commands.autocomplete.cpp5
-rw-r--r--toolsrc/src/vcpkg/commands.buildexternal.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.cache.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.ci.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.ciclean.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.contact.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.cpp74
-rw-r--r--toolsrc/src/vcpkg/commands.create.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.dependinfo.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.edit.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.env.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.fetch.cpp24
-rw-r--r--toolsrc/src/vcpkg/commands.format-manifest.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.hash.cpp34
-rw-r--r--toolsrc/src/vcpkg/commands.integrate.cpp108
-rw-r--r--toolsrc/src/vcpkg/commands.list.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.owns.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.porthistory.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.portsdiff.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.search.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.setinstalled.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.upgrade.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.version.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.xvsinstances.cpp2
-rw-r--r--toolsrc/src/vcpkg/export.ifw.cpp (renamed from toolsrc/src/vcpkg/commands.exportifw.cpp)0
-rw-r--r--toolsrc/src/vcpkg/help.cpp9
-rw-r--r--toolsrc/src/vcpkg/install.cpp2
-rw-r--r--toolsrc/src/vcpkg/metrics.cpp1
-rw-r--r--toolsrc/src/vcpkg/vcpkgcmdarguments.cpp1
32 files changed, 173 insertions, 128 deletions
diff --git a/toolsrc/src/vcpkg-test/commands.create.cpp b/toolsrc/src/vcpkg-test/commands.create.cpp
index 4d8b2fd50..0cc93bd57 100644
--- a/toolsrc/src/vcpkg-test/commands.create.cpp
+++ b/toolsrc/src/vcpkg-test/commands.create.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/files.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.create.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 40ccb1668..2bfa3f508 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -8,7 +8,9 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/system.process.h>
+#include <vcpkg/commands.contact.h>
#include <vcpkg/commands.h>
+#include <vcpkg/commands.version.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
#include <vcpkg/input.h>
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index bcd0a7f89..83d596473 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -16,6 +16,7 @@
#include <vcpkg/build.h>
#include <vcpkg/buildenvironment.h>
#include <vcpkg/commands.h>
+#include <vcpkg/commands.version.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp
index 17d38f395..05499988d 100644
--- a/toolsrc/src/vcpkg/commands.autocomplete.cpp
+++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp
@@ -2,7 +2,10 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.autocomplete.h>
+#include <vcpkg/commands.edit.h>
+#include <vcpkg/commands.integrate.h>
+#include <vcpkg/commands.upgrade.h>
#include <vcpkg/install.h>
#include <vcpkg/metrics.h>
#include <vcpkg/paragraphs.h>
diff --git a/toolsrc/src/vcpkg/commands.buildexternal.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp
index 79a8dd3c4..ccd477a07 100644
--- a/toolsrc/src/vcpkg/commands.buildexternal.cpp
+++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp
@@ -3,7 +3,7 @@
#include <vcpkg/binarycaching.h>
#include <vcpkg/build.h>
#include <vcpkg/cmakevars.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.buildexternal.h>
#include <vcpkg/help.h>
#include <vcpkg/input.h>
diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp
index e7802498c..70d88bcd3 100644
--- a/toolsrc/src/vcpkg/commands.cache.cpp
+++ b/toolsrc/src/vcpkg/commands.cache.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/binaryparagraph.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.cache.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp
index 50336a4c1..92f25c806 100644
--- a/toolsrc/src/vcpkg/commands.ci.cpp
+++ b/toolsrc/src/vcpkg/commands.ci.cpp
@@ -9,7 +9,7 @@
#include <vcpkg/binarycaching.h>
#include <vcpkg/build.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.ci.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp
index 980e17da8..3152be7d9 100644
--- a/toolsrc/src/vcpkg/commands.ciclean.cpp
+++ b/toolsrc/src/vcpkg/commands.ciclean.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/files.h>
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.ciclean.h>
#include <vcpkg/vcpkgcmdarguments.h>
using namespace vcpkg;
diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp
index ce83fab80..14e78c92b 100644
--- a/toolsrc/src/vcpkg/commands.contact.cpp
+++ b/toolsrc/src/vcpkg/commands.contact.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/system.process.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.contact.h>
#include <vcpkg/help.h>
#include <vcpkg/userconfig.h>
diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp
index be6d55304..f8b67de74 100644
--- a/toolsrc/src/vcpkg/commands.cpp
+++ b/toolsrc/src/vcpkg/commands.cpp
@@ -1,10 +1,32 @@
#include "pch.h"
-#include <vcpkg/base/hash.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/build.h>
+#include <vcpkg/commands.autocomplete.h>
+#include <vcpkg/commands.buildexternal.h>
+#include <vcpkg/commands.cache.h>
+#include <vcpkg/commands.ci.h>
+#include <vcpkg/commands.ciclean.h>
+#include <vcpkg/commands.contact.h>
+#include <vcpkg/commands.create.h>
+#include <vcpkg/commands.dependinfo.h>
+#include <vcpkg/commands.edit.h>
+#include <vcpkg/commands.env.h>
+#include <vcpkg/commands.fetch.h>
+#include <vcpkg/commands.format-manifest.h>
#include <vcpkg/commands.h>
+#include <vcpkg/commands.hash.h>
+#include <vcpkg/commands.integrate.h>
+#include <vcpkg/commands.list.h>
+#include <vcpkg/commands.owns.h>
+#include <vcpkg/commands.porthistory.h>
+#include <vcpkg/commands.portsdiff.h>
+#include <vcpkg/commands.search.h>
+#include <vcpkg/commands.setinstalled.h>
+#include <vcpkg/commands.upgrade.h>
+#include <vcpkg/commands.version.h>
+#include <vcpkg/commands.xvsinstances.h>
#include <vcpkg/export.h>
#include <vcpkg/help.h>
#include <vcpkg/install.h>
@@ -64,53 +86,3 @@ namespace vcpkg::Commands
return t;
}
}
-
-namespace vcpkg::Commands::Fetch
-{
- const CommandStructure COMMAND_STRUCTURE = {
- Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")),
- 1,
- 1,
- {},
- nullptr,
- };
-
- void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
- {
- Util::unused(args.parse_arguments(COMMAND_STRUCTURE));
-
- const std::string tool = args.command_arguments[0];
- const fs::path tool_path = paths.get_tool_exe(tool);
- System::print2(tool_path.u8string(), '\n');
- Checks::exit_success(VCPKG_LINE_INFO);
- }
-}
-
-namespace vcpkg::Commands::Hash
-{
- const CommandStructure COMMAND_STRUCTURE = {
- Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")),
- 1,
- 2,
- {},
- nullptr,
- };
-
- void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
- {
- Util::unused(args.parse_arguments(COMMAND_STRUCTURE));
-
- const fs::path file_to_hash = args.command_arguments[0];
-
- auto algorithm = vcpkg::Hash::Algorithm::Sha512;
- if (args.command_arguments.size() == 2)
- {
- algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO);
- }
-
- const std::string hash =
- vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm);
- System::print2(hash, '\n');
- Checks::exit_success(VCPKG_LINE_INFO);
- }
-}
diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp
index 83d2e109d..9ea265f29 100644
--- a/toolsrc/src/vcpkg/commands.create.cpp
+++ b/toolsrc/src/vcpkg/commands.create.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/files.h>
#include <vcpkg/buildenvironment.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.create.h>
#include <vcpkg/help.h>
namespace vcpkg::Commands::Create
diff --git a/toolsrc/src/vcpkg/commands.dependinfo.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp
index ba6da1aa3..e1cf0643f 100644
--- a/toolsrc/src/vcpkg/commands.dependinfo.cpp
+++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.dependinfo.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/help.h>
#include <vcpkg/input.h>
diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp
index a433af8ec..32d0723b1 100644
--- a/toolsrc/src/vcpkg/commands.edit.cpp
+++ b/toolsrc/src/vcpkg/commands.edit.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/system.process.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.edit.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
diff --git a/toolsrc/src/vcpkg/commands.env.cpp b/toolsrc/src/vcpkg/commands.env.cpp
index bcde99166..204bbd622 100644
--- a/toolsrc/src/vcpkg/commands.env.cpp
+++ b/toolsrc/src/vcpkg/commands.env.cpp
@@ -5,7 +5,7 @@
#include <vcpkg/build.h>
#include <vcpkg/cmakevars.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.env.h>
#include <vcpkg/help.h>
namespace vcpkg::Commands::Env
diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp
new file mode 100644
index 000000000..d20db7aac
--- /dev/null
+++ b/toolsrc/src/vcpkg/commands.fetch.cpp
@@ -0,0 +1,24 @@
+#include "pch.h"
+
+#include <vcpkg/commands.fetch.h>
+
+namespace vcpkg::Commands::Fetch
+{
+ const CommandStructure COMMAND_STRUCTURE = {
+ Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")),
+ 1,
+ 1,
+ {},
+ nullptr,
+ };
+
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
+ {
+ Util::unused(args.parse_arguments(COMMAND_STRUCTURE));
+
+ const std::string tool = args.command_arguments[0];
+ const fs::path tool_path = paths.get_tool_exe(tool);
+ System::print2(tool_path.u8string(), '\n');
+ Checks::exit_success(VCPKG_LINE_INFO);
+ }
+}
diff --git a/toolsrc/src/vcpkg/commands.format-manifest.cpp b/toolsrc/src/vcpkg/commands.format-manifest.cpp
index f23472245..4cbe964d6 100644
--- a/toolsrc/src/vcpkg/commands.format-manifest.cpp
+++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp
@@ -5,7 +5,7 @@
#include <vcpkg/base/json.h>
#include <vcpkg/base/system.debug.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.format-manifest.h>
#include <vcpkg/portfileprovider.h>
namespace vcpkg::Commands::FormatManifest
diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp
new file mode 100644
index 000000000..c43c5a6b4
--- /dev/null
+++ b/toolsrc/src/vcpkg/commands.hash.cpp
@@ -0,0 +1,34 @@
+#include "pch.h"
+
+#include <vcpkg/base/hash.h>
+
+#include <vcpkg/commands.hash.h>
+
+namespace vcpkg::Commands::Hash
+{
+ const CommandStructure COMMAND_STRUCTURE = {
+ Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")),
+ 1,
+ 2,
+ {},
+ nullptr,
+ };
+
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
+ {
+ Util::unused(args.parse_arguments(COMMAND_STRUCTURE));
+
+ const fs::path file_to_hash = args.command_arguments[0];
+
+ auto algorithm = vcpkg::Hash::Algorithm::Sha512;
+ if (args.command_arguments.size() == 2)
+ {
+ algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO);
+ }
+
+ const std::string hash =
+ vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm);
+ System::print2(hash, '\n');
+ Checks::exit_success(VCPKG_LINE_INFO);
+ }
+}
diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp
index a7ef5a012..5a9b4b594 100644
--- a/toolsrc/src/vcpkg/commands.integrate.cpp
+++ b/toolsrc/src/vcpkg/commands.integrate.cpp
@@ -7,7 +7,7 @@
#include <vcpkg/base/system.process.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.integrate.h>
#include <vcpkg/metrics.h>
#include <vcpkg/userconfig.h>
@@ -16,10 +16,10 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32)
static std::string create_appdata_shortcut(const std::string& target_path) noexcept
{
- return Strings::format(R"###(
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Condition="Exists('%s') and '$(VCPkgLocalAppDataDisabled)' == ''" Project="%s" />
-</Project>
+ return Strings::format(R"###(
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Condition="Exists('%s') and '$(VCPkgLocalAppDataDisabled)' == ''" Project="%s" />
+</Project>
)###",
target_path,
target_path);
@@ -29,15 +29,15 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32)
static std::string create_system_targets_shortcut() noexcept
{
- return R"###(
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- version 1 -->
- <PropertyGroup>
- <VCLibPackagePath Condition="'$(VCLibPackagePath)' == ''">$(LOCALAPPDATA)\vcpkg\vcpkg.user</VCLibPackagePath>
- </PropertyGroup>
- <Import Condition="'$(VCLibPackagePath)' != '' and Exists('$(VCLibPackagePath).props')" Project="$(VCLibPackagePath).props" />
- <Import Condition="'$(VCLibPackagePath)' != '' and Exists('$(VCLibPackagePath).targets')" Project="$(VCLibPackagePath).targets" />
-</Project>
+ return R"###(
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- version 1 -->
+ <PropertyGroup>
+ <VCLibPackagePath Condition="'$(VCLibPackagePath)' == ''">$(LOCALAPPDATA)\vcpkg\vcpkg.user</VCLibPackagePath>
+ </PropertyGroup>
+ <Import Condition="'$(VCLibPackagePath)' != '' and Exists('$(VCLibPackagePath).props')" Project="$(VCLibPackagePath).props" />
+ <Import Condition="'$(VCLibPackagePath)' != '' and Exists('$(VCLibPackagePath).targets')" Project="$(VCLibPackagePath).targets" />
+</Project>
)###";
}
#endif
@@ -47,13 +47,13 @@ namespace vcpkg::Commands::Integrate
{
const std::string as_string = msbuild_vcpkg_targets_file.string();
- return Strings::format(R"###(
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="%s" Condition="Exists('%s')" />
- <Target Name="CheckValidPlatform" BeforeTargets="Build">
- <Error Text="Unsupported architecture combination. Remove the 'vcpkg' nuget package." Condition="'$(VCPkgEnabled)' != 'true' and '$(VCPkgDisableError)' == ''"/>
- </Target>
-</Project>
+ return Strings::format(R"###(
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="%s" Condition="Exists('%s')" />
+ <Target Name="CheckValidPlatform" BeforeTargets="Build">
+ <Error Text="Unsupported architecture combination. Remove the 'vcpkg' nuget package." Condition="'$(VCPkgEnabled)' != 'true' and '$(VCPkgDisableError)' == ''"/>
+ </Target>
+</Project>
)###",
as_string,
as_string);
@@ -63,12 +63,12 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32)
static std::string create_nuget_props_file_contents() noexcept
{
- return R"###(
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <VCPkgLocalAppDataDisabled>true</VCPkgLocalAppDataDisabled>
- </PropertyGroup>
-</Project>
+ return R"###(
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VCPkgLocalAppDataDisabled>true</VCPkgLocalAppDataDisabled>
+ </PropertyGroup>
+</Project>
)###";
}
#endif
@@ -93,21 +93,21 @@ namespace vcpkg::Commands::Integrate
const std::string& nuget_id,
const std::string& nupkg_version)
{
- static constexpr auto CONTENT_TEMPLATE = R"(
-<package>
- <metadata>
- <id>@NUGET_ID@</id>
- <version>@VERSION@</version>
- <authors>vcpkg</authors>
- <description>
- This package imports all libraries currently installed in @VCPKG_DIR@. This package does not contain any libraries and instead refers to the folder directly (like a symlink).
- </description>
- </metadata>
- <files>
- <file src="vcpkg.nuget.props" target="build\native\@NUGET_ID@.props" />
- <file src="vcpkg.nuget.targets" target="build\native\@NUGET_ID@.targets" />
- </files>
-</package>
+ static constexpr auto CONTENT_TEMPLATE = R"(
+<package>
+ <metadata>
+ <id>@NUGET_ID@</id>
+ <version>@VERSION@</version>
+ <authors>vcpkg</authors>
+ <description>
+ This package imports all libraries currently installed in @VCPKG_DIR@. This package does not contain any libraries and instead refers to the folder directly (like a symlink).
+ </description>
+ </metadata>
+ <files>
+ <file src="vcpkg.nuget.props" target="build\native\@NUGET_ID@.props" />
+ <file src="vcpkg.nuget.targets" target="build\native\@NUGET_ID@.targets" />
+ </files>
+</package>
)";
std::string content = Strings::replace_all(CONTENT_TEMPLATE, "@NUGET_ID@", nuget_id);
@@ -301,18 +301,18 @@ namespace vcpkg::Commands::Integrate
const fs::path cmake_toolchain = paths.buildsystems / "vcpkg.cmake";
#if defined(_WIN32)
System::printf(
- R"(
-All MSBuild C++ projects can now #include any installed libraries.
-Linking will be handled automatically.
-Installing new libraries will make them instantly available.
-
-CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s"
+ R"(
+All MSBuild C++ projects can now #include any installed libraries.
+Linking will be handled automatically.
+Installing new libraries will make them instantly available.
+
+CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s"
)",
cmake_toolchain.generic_u8string());
#else
System::printf(
- R"(
-CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s"
+ R"(
+CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s"
)",
cmake_toolchain.generic_u8string());
#endif
@@ -394,10 +394,10 @@ CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=%s"
auto source_path = buildsystems_dir.u8string();
source_path = Strings::replace_all(std::move(source_path), "`", "``");
- System::printf(R"(
-With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste:
- Install-Package %s -Source "%s"
-
+ System::printf(R"(
+With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste:
+ Install-Package %s -Source "%s"
+
)",
nuget_id,
source_path);
diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp
index f65ba9497..006dfb040 100644
--- a/toolsrc/src/vcpkg/commands.list.cpp
+++ b/toolsrc/src/vcpkg/commands.list.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.list.h>
#include <vcpkg/help.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/versiont.h>
diff --git a/toolsrc/src/vcpkg/commands.owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp
index a71a56ed3..839298eb8 100644
--- a/toolsrc/src/vcpkg/commands.owns.cpp
+++ b/toolsrc/src/vcpkg/commands.owns.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.owns.h>
#include <vcpkg/help.h>
#include <vcpkg/vcpkglib.h>
diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp
index b1bf29f5f..1fdbc8287 100644
--- a/toolsrc/src/vcpkg/commands.porthistory.cpp
+++ b/toolsrc/src/vcpkg/commands.porthistory.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/system.process.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.porthistory.h>
#include <vcpkg/help.h>
namespace vcpkg::Commands::PortHistory
diff --git a/toolsrc/src/vcpkg/commands.portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp
index 94c6e490b..a4547323e 100644
--- a/toolsrc/src/vcpkg/commands.portsdiff.cpp
+++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp
@@ -5,7 +5,7 @@
#include <vcpkg/base/system.process.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.portsdiff.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/versiont.h>
diff --git a/toolsrc/src/vcpkg/commands.search.cpp b/toolsrc/src/vcpkg/commands.search.cpp
index b78420b4d..5c9070ca4 100644
--- a/toolsrc/src/vcpkg/commands.search.cpp
+++ b/toolsrc/src/vcpkg/commands.search.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.search.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
diff --git a/toolsrc/src/vcpkg/commands.setinstalled.cpp b/toolsrc/src/vcpkg/commands.setinstalled.cpp
index 82e1c763f..2c42ff6a3 100644
--- a/toolsrc/src/vcpkg/commands.setinstalled.cpp
+++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp
@@ -3,7 +3,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/binarycaching.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.setinstalled.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
#include <vcpkg/input.h>
diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp
index 25fb0de98..3092f0bba 100644
--- a/toolsrc/src/vcpkg/commands.upgrade.cpp
+++ b/toolsrc/src/vcpkg/commands.upgrade.cpp
@@ -4,7 +4,7 @@
#include <vcpkg/base/util.h>
#include <vcpkg/binarycaching.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.upgrade.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp
index 273b4f10a..fab43e116 100644
--- a/toolsrc/src/vcpkg/commands.version.cpp
+++ b/toolsrc/src/vcpkg/commands.version.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.version.h>
#include <vcpkg/help.h>
#include <vcpkg/metrics.h>
diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp
index 718c73ec0..279f59674 100644
--- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp
+++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp
@@ -2,7 +2,7 @@
#include <vcpkg/base/system.print.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.xvsinstances.h>
#include <vcpkg/help.h>
#include <vcpkg/visualstudio.h>
diff --git a/toolsrc/src/vcpkg/commands.exportifw.cpp b/toolsrc/src/vcpkg/export.ifw.cpp
index 8356313cf..8356313cf 100644
--- a/toolsrc/src/vcpkg/commands.exportifw.cpp
+++ b/toolsrc/src/vcpkg/export.ifw.cpp
diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp
index d341b32ab..87436e01c 100644
--- a/toolsrc/src/vcpkg/help.cpp
+++ b/toolsrc/src/vcpkg/help.cpp
@@ -3,7 +3,14 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/binarycaching.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.create.h>
+#include <vcpkg/commands.dependinfo.h>
+#include <vcpkg/commands.edit.h>
+#include <vcpkg/commands.env.h>
+#include <vcpkg/commands.integrate.h>
+#include <vcpkg/commands.list.h>
+#include <vcpkg/commands.owns.h>
+#include <vcpkg/commands.search.h>
#include <vcpkg/export.h>
#include <vcpkg/help.h>
#include <vcpkg/install.h>
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp
index da4248c39..51682e18b 100644
--- a/toolsrc/src/vcpkg/install.cpp
+++ b/toolsrc/src/vcpkg/install.cpp
@@ -8,7 +8,7 @@
#include <vcpkg/binarycaching.h>
#include <vcpkg/build.h>
#include <vcpkg/cmakevars.h>
-#include <vcpkg/commands.h>
+#include <vcpkg/commands.setinstalled.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/help.h>
diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp
index f348e32c0..7ce4646e2 100644
--- a/toolsrc/src/vcpkg/metrics.cpp
+++ b/toolsrc/src/vcpkg/metrics.cpp
@@ -8,6 +8,7 @@
#include <vcpkg/base/system.process.h>
#include <vcpkg/commands.h>
+#include <vcpkg/commands.version.h>
#include <vcpkg/metrics.h>
#if defined(_WIN32)
diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp
index 280faae0d..40782cc61 100644
--- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp
+++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp
@@ -4,6 +4,7 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/commands.h>
+#include <vcpkg/commands.integrate.h>
#include <vcpkg/globalstate.h>
#include <vcpkg/metrics.h>
#include <vcpkg/vcpkgcmdarguments.h>