Skip to content

Commit e9d34e6

Browse files
committed
use xcopy
1 parent 7bd0fd9 commit e9d34e6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.xcopyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vagrant

tests/Vagrantfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ Vagrant.configure("2") do |config|
3131
vb.customize ['modifyvm', :id, '--vram', '128']
3232
end
3333
config.vm.provider "hyperv" do |h|
34-
h.memory = 4096
35-
h.cpus = 2
34+
h.memory = ENV['VM_MEMORY'] ? ENV['VM_MEMORY'].to_i : 4096
35+
h.maxmemory = nil
36+
h.cpus = ENV['VM_CPU'] ? ENV['VM_CPU'].to_i : 2
3637
h.linked_clone = true
3738
h.enable_checkpoints = false
3839
end
@@ -45,18 +46,18 @@ Vagrant.configure("2") do |config|
4546
iex (irm https://community.chocolatey.org/install.ps1)
4647
4748
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) We are going to install some prerequisites now. This could take some time"
48-
$null = choco install git pester visualstudio2022community visualstudio2022-workload-manageddesktop netfx-4.8-devpack -y
49+
choco install git pester visualstudio2022community visualstudio2022-workload-manageddesktop netfx-4.8-devpack -y --no-progress
4950
Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1
5051
Update-SessionEnvironment
5152
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Done installing software, now copying files"
5253
# If you try to build on macOS, then run this, there are attributes on some files that cause the build to fail inside of the vagrant environment.
53-
$null = robocopy c:/chocoRoot c:/code/choco /e /copy:dt
54+
xcopy c:\\chocoroot\\* c:\\code\\choco /s /f /exclude:c:\\chocoroot\\.xcopyignore /i /y /h
5455
SHELL
5556
config.vm.provision "shell", name: "build", inline: <<-SHELL
56-
$null = robocopy c:/chocoRoot c:/code/choco /e /copy:dt /purge
57+
xcopy c:\\chocoroot\\* c:\\code\\choco /s /f /exclude:c:\\chocoroot\\.xcopyignore /i /y /h
5758
Push-Location c:/code/choco
5859
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Files have been copied, beginning build process."
59-
$CakeOutput = ./build.bat --verbosity=diagnostic --target=CI --testExecutionType=none --shouldRunalyze=false --shouldRunNuGet=false 2>&1
60+
./build.bat --verbosity=diagnostic --target=CI --testExecutionType=none --shouldRunalyze=false --shouldRunNuGet=false 2>&1 | Tee-Object CakeOutput
6061
6162
if ($LastExitCode -ne 0) {
6263
Set-Content c:/vagrant/buildOutput.log -Value $CakeOutput
@@ -72,10 +73,10 @@ Vagrant.configure("2") do |config|
7273
Remove-Item "$env:TEMP/chocolateyTests/all-packages" -Recurse -Force -ErrorAction SilentlyContinue
7374
SHELL
7475
config.vm.provision "shell", name: "test", inline: <<-SHELL
75-
# Copy changed files.
76-
$null = robocopy c:/chocoRoot c:/code/choco /e /copy:dt
76+
xcopy c:\\chocoroot\\* c:\\code\\choco /s /f /exclude:c:\\chocoroot\\.xcopyignore /i /y /h
7777
# Purge any tests files that have been removed.
78-
$null = robocopy c:/chocoRoot/tests c:/code/choco/tests /e /copy:dt /purge
78+
rm -re -fo c:\\code\\choco\\tests
79+
xcopy c:\\chocoroot\\tests\\* c:\\code\\choco\\tests /s /f /exclude:c:\\chocoroot\\.xcopyignore /i /y /h
7980
Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Starting Test Execution"
8081
Push-Location c:/code/choco
8182
# $env:TEST_KITCHEN = 1

0 commit comments

Comments
 (0)