forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
export
: Reorganize export folder to have the same layout as a norma…
…l vcpkg enlistment
- Loading branch information
1 parent
d22cbe7
commit e51fa89
Showing
1 changed file
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,8 @@ namespace vcpkg::Commands::Export | |
</metadata> | ||
<files> | ||
<file src="@RAW_EXPORTED_DIR@\installed\**" target="installed" /> | ||
<file src="@RAW_EXPORTED_DIR@\scripts\**" target="scripts" /> | ||
<file src="@RAW_EXPORTED_DIR@\.vcpkg-root" target="" /> | ||
<file src="@RAW_EXPORTED_DIR@\msbuild\applocal.ps1" target="build\native\msbuild\applocal.ps1" /> | ||
<file src="@RAW_EXPORTED_DIR@\msbuild\vcpkg.targets" target="build\native\msbuild\vcpkg.targets" /> | ||
<file src="@RAW_EXPORTED_DIR@\vcpkg.cmake" target="build\native\vcpkg.cmake" /> | ||
<file src="@RAW_EXPORTED_DIR@\vcpkg.targets" target="build\native\@[email protected]" /> | ||
</files> | ||
</package> | ||
|
@@ -280,17 +278,30 @@ namespace vcpkg::Commands::Export | |
} | ||
|
||
// Copy files needed for integration | ||
fs.copy_file(paths.root / ".vcpkg-root", raw_exported_dir_path / ".vcpkg-root", fs::copy_options::overwrite_existing, ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
fs.create_directories(raw_exported_dir_path / "msbuild", ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
fs.copy_file(paths.buildsystems / "msbuild" / "applocal.ps1", raw_exported_dir_path / "msbuild" / "applocal.ps1", fs::copy_options::overwrite_existing, ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
fs.copy_file(paths.buildsystems / "msbuild" / "vcpkg.targets", raw_exported_dir_path / "msbuild" / "vcpkg.targets", fs::copy_options::overwrite_existing, ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
fs.copy_file(paths.buildsystems / "vcpkg.cmake", raw_exported_dir_path / "vcpkg.cmake", fs::copy_options::overwrite_existing, ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
const std::string targets_redirect_content = create_targets_redirect("msbuild/vcpkg.targets"); | ||
const std::vector<fs::path> integration_files_relative_to_root = | ||
{ | ||
{ ".vcpkg-root" }, | ||
{ fs::path{ "scripts" } / "buildsystems" / "msbuild" / "applocal.ps1" }, | ||
{ fs::path{ "scripts" } / "buildsystems" / "msbuild" / "vcpkg.targets" }, | ||
{ fs::path{ "scripts" } / "buildsystems" / "vcpkg.cmake" }, | ||
{ fs::path{ "scripts" } / "cmake" / "vcpkg_get_windows_sdk.cmake" }, | ||
{ fs::path{ "scripts" } / "cmake" / "vcpkg_get_windows_sdk.cmake" }, | ||
{ fs::path{ "scripts" } / "getWindowsSDK.ps1" }, | ||
{ fs::path{ "scripts" } / "getProgramFilesPlatformBitness.ps1" }, | ||
}; | ||
|
||
for (const fs::path& file : integration_files_relative_to_root) | ||
{ | ||
const fs::path source = paths.root / file; | ||
const fs::path destination = raw_exported_dir_path / file; | ||
fs.create_directories(destination.parent_path(), ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
fs.copy_file(source, destination, fs::copy_options::overwrite_existing, ec); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
} | ||
|
||
// This file will be placed in "build\native" in the nuget package. Therefore, go up two dirs. | ||
const std::string targets_redirect_content = create_targets_redirect("../../scripts/buildsystems/msbuild/vcpkg.targets"); | ||
const fs::path targets_redirect = raw_exported_dir_path / "vcpkg.targets"; | ||
fs.write_contents(targets_redirect, targets_redirect_content); | ||
Checks::check_exit(VCPKG_LINE_INFO, !ec); | ||
|