|
7 | 7 |
|
8 | 8 | function ContinuousDelivery([string] $deliveryTarget) {
|
9 | 9 | $settingsName = "DeliverTo$deliveryTarget"
|
10 |
| - if ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) { |
| 10 | + if ($deliveryTarget -eq 'AppSource' -and $settings.type -eq "AppSource App") { |
| 11 | + # For multi-project repositories, ContinuousDelivery can be set on the projects |
| 12 | + foreach($project in ($projectsJson | ConvertFrom-Json)) { |
| 13 | + $projectSettings = ReadSettings -project $project |
| 14 | + if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) { |
| 15 | + Write-Host "Project $project is setup for Continuous Delivery to AppSource" |
| 16 | + return $true |
| 17 | + } |
| 18 | + } |
| 19 | + return $false |
| 20 | + } |
| 21 | + elseif ($settings.Contains($settingsName) -and $settings."$settingsName".Contains('ContinuousDelivery')) { |
11 | 22 | return $settings."$settingsName".ContinuousDelivery
|
12 | 23 | }
|
13 | 24 | else {
|
@@ -44,14 +55,7 @@ function IncludeDeliveryTarget([string] $deliveryTarget) {
|
44 | 55 | $settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable -recurse
|
45 | 56 | $deliveryTargets = @('GitHubPackages','NuGet','Storage')
|
46 | 57 | if ($settings.type -eq "AppSource App") {
|
47 |
| - # For multi-project repositories, we will add deliveryTarget AppSource if any project has AppSourceContinuousDelivery set to true |
48 |
| - ($projectsJson | ConvertFrom-Json) | ForEach-Object { |
49 |
| - $projectSettings = ReadSettings -project $_ |
50 |
| - if ($projectSettings.deliverToAppSource.ContinuousDelivery -or ($projectSettings.Contains('AppSourceContinuousDelivery') -and $projectSettings.AppSourceContinuousDelivery)) { |
51 |
| - Write-Host "Project $_ is setup for Continuous Delivery to AppSource" |
52 |
| - $deliveryTargets += @("AppSource") |
53 |
| - } |
54 |
| - } |
| 58 | + $deliveryTargets += @("AppSource") |
55 | 59 | }
|
56 | 60 | # Include custom delivery targets
|
57 | 61 | $namePrefix = 'DeliverTo'
|
|
0 commit comments