-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Export Command] Enabling Manifest Mode #1136
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b158fe3
initial implementation
JavierMatosD 3753feb
avoid value or exit and reuse MissinOption message
JavierMatosD 31f9114
improve messaging
JavierMatosD a9a5bd2
reduce redundancy
JavierMatosD 9fa9ef1
add end2end test file
JavierMatosD faaa59e
add test cases for raw based exports in manifest mode
JavierMatosD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "my-project", | ||
"version-string": "0.1.0", | ||
"dependencies": [ | ||
{ | ||
"name": "zlib" | ||
}, | ||
{ | ||
"name": "fmt" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
. $PSScriptRoot/../end-to-end-tests-prelude.ps1 | ||
|
||
|
||
$manifestPath = "$PSScriptRoot/../e2e-projects/export-project" | ||
$outputDir = "$manifestPath/output" | ||
Run-Vcpkg install --x-manifest-root=$manifestPath | ||
Throw-IfFailed | ||
|
||
Run-Vcpkg export --zip --x-manifest-root=$manifestPath --output-dir=$outputDir | ||
Throw-IfFailed | ||
|
||
Run-Vcpkg export --nuget --x-manifest-root=$manifestPath --output-dir=$outputDir | ||
Throw-IfFailed | ||
|
||
Run-Vcpkg export --7zip --x-manifest-root=$manifestPath --output-dir=$outputDir | ||
Throw-IfFailed | ||
|
||
# Check existence of zip file(s) | ||
$zipFilesExist = Test-Path "$outputDir/*.zip" | ||
if (-Not $zipFilesExist) | ||
{ | ||
throw "No zip files found in $outputDir" | ||
} | ||
|
||
# Check existence of nuget file(s) | ||
$nugetFilesExist = Test-Path "$outputDir/*.nupkg" | ||
if (-Not $nugetFilesExist) | ||
{ | ||
throw "No nuget files found in $outputDir" | ||
} | ||
|
||
# Check existence of 7zip file(s) | ||
$sevenZipFilesExist = Test-Path "$outputDir/*.7z" | ||
if (-Not $sevenZipFilesExist) | ||
{ | ||
throw "No 7zip files found in $outputDir" | ||
} | ||
|
||
# Cleanup exported packages | ||
Get-ChildItem -Path $manifestPath | Where-Object { $_.Name -ne "vcpkg.json" -and $_.Name -ne "vcpkg_installed" } | Remove-Item -Recurse -Force | ||
|
||
# Test export with invalid <port:triplet> argument | ||
$out = Run-VcpkgAndCaptureOutput export zlib:x64-windows --zip --x-manifest-root=$manifestPath --output-dir=$manifestPath | ||
Throw-IfNotFailed | ||
if ($out -notmatch "unexpected argument: zlib:x64-windows") | ||
{ | ||
throw "Expected to fail and print warning about unexpected argument" | ||
} | ||
|
||
# Test export with missing --output-dir argument | ||
$out = Run-VcpkgAndCaptureOutput export --zip --x-manifest-root=$manifestPath | ||
Throw-IfNotFailed | ||
if ($out -notmatch "This command requires --output-dir") | ||
{ | ||
throw "Expected to fail and print warning about missing argument" | ||
} | ||
|
||
# Test export with empty export plan | ||
Remove-Item -Path "$manifestPath/vcpkg_installed" -Recurse -Force | ||
$out = Run-VcpkgAndCaptureOutput export --zip --x-manifest-root=$manifestPath --output-dir=$manifestPath | ||
Throw-IfNotFailed | ||
if ($out -notmatch "Refusing to create an export of zero packages. Install packages before exporting.") | ||
{ | ||
throw "Expected to fail and print warning about empty export plan." | ||
} | ||
|
||
|
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.