From 684206c255d5871e69ac73085140760627ff2bc2 Mon Sep 17 00:00:00 2001 From: Andrea Lanfranchi Date: Tue, 27 Jul 2021 13:21:37 +0200 Subject: [PATCH] Build multiple targets (#2450) --- wmake.ps1 | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/wmake.ps1 b/wmake.ps1 index dae77a4a1..ce06c0d3f 100644 --- a/wmake.ps1 +++ b/wmake.ps1 @@ -19,11 +19,36 @@ Param( [Parameter(Position=0, HelpMessage="Enter the build target")] [Alias("target")] - [AllowEmptyString()] [ValidateSet("all", "clean", "test", "erigon","rpcdaemon","rpctest", "hack", "state", "integration", "db-tools", "sentry")] - [string]$BuildTarget="erigon" + [string[]]$BuildTargets=@("erigon","rpcdaemon","sentry","integration") ) +# Sanity checks on $BuildTargets +if ($BuildTargets.Count -gt 1) { + + # "all" target must be alone + if ($BuildTargets.Contains("all")) { + Write-Host @" + + Error ! Target "all" must be set alone. + +"@ + exit 1 + } + + # "clean" target must be alone + if ($BuildTargets.Contains("clean")) { + Write-Host @" + + Error ! Target "clean" must be set alone. + +"@ + exit 1 + } + +} + + # ==================================================================== # Messages texts # ==================================================================== @@ -31,7 +56,7 @@ Param( $headerText = @" ------------------------------------------------------------------------------ - Erigon's wmake.ps1 : Selected target $($BuildTarget) + Erigon's wmake.ps1 : Selected target(s) $($BuildTargets -join " ") ------------------------------------------------------------------------------ "@ @@ -334,6 +359,7 @@ if (!($?)) { # return # } + # Build erigon binaries Set-Variable -Name "Erigon" -Value ([hashtable]::Synchronized(@{})) -Scope Script $Erigon.Commit = [string]@(git.exe rev-list -1 HEAD) @@ -362,6 +388,7 @@ Write-Host @" "@ +foreach($BuildTarget in $BuildTargets) { ## Choco components for building db-tools if ($BuildTarget -eq "all" -or $BuildTarget -eq "db-tools") { if(!(Test-choco-Installed)) { @@ -526,6 +553,6 @@ if ($BuildTarget -eq "clean") { } } } - +} # Return to source folder Set-Location $MyContext.Directory