summaryrefslogtreecommitdiff
path: root/Build-ProjectSet.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'Build-ProjectSet.ps1')
-rw-r--r--Build-ProjectSet.ps138
1 files changed, 38 insertions, 0 deletions
diff --git a/Build-ProjectSet.ps1 b/Build-ProjectSet.ps1
new file mode 100644
index 00000000..57c4ac32
--- /dev/null
+++ b/Build-ProjectSet.ps1
@@ -0,0 +1,38 @@
+param(
+ [hashtable]$ProjectSet,
+ [string]$Configuration = $env:Configuration,
+ [string]$Platform = $env:Platform
+)
+
+#TODO validate params
+
+$exclusionsSet = @{}
+$failSet = @()
+Import-Csv 'exclusions.csv' | ForEach-Object {
+ $exclusionsSet[$_.Path.Replace($root, '').Trim('\').Replace('\', '.').ToLower()] = $_.Reason
+}
+
+$ProjectSet.GetEnumerator() | ForEach-Object {
+ $projectName = $_.Key
+ if ($exclusionsSet.ContainsKey($projectName))
+ {
+ Write-Output "[$projectName] ⏩ Excluded and skipped. Reason: $($exclusionsSet[$projectName])"
+ return;
+ }
+ $directory = $_.Value
+ .\Build-Project -Directory $directory -ProjectName $ProjectName -Configuration $Configuration -Platform $Platform
+ if ($LASTEXITCODE -ne 0)
+ {
+ $failSet += $ProjectName
+ }
+}
+
+if ($failSet.Count -gt 0)
+{
+ Write-Output "Some projects were built with errors:"
+ foreach ($failedProject in $failSet)
+ {
+ Write-Output "$failedProject"
+ }
+ Write-Error "Some projects were built with errors."
+} \ No newline at end of file