This commit is contained in:
freddydk 2022-10-25 08:59:21 +02:00
Родитель f8c6b3d9d7
Коммит 9b5e2ffa1c
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -9,6 +9,8 @@
If specified, all appFolders in the array are subFolders to this folder.
.Parameter unknownDependencies
If specified, this reference parameter will contain unresolved dependencies after sorting
.Parameter knownApps
If specified, this reference parameter will contain all known appids
.Example
$folders = Sort-AppFoldersByDependencies -appFolders @($folder1, $folder2)
#>
@ -19,7 +21,9 @@ function Sort-AppFoldersByDependencies {
[Parameter(Mandatory=$false)]
[string] $baseFolder = "",
[Parameter(Mandatory=$false)]
[ref] $unknownDependencies
[ref] $unknownDependencies,
[Parameter(Mandatory=$false)]
[ref] $knownApps
)
$telemetryScope = InitTelemetryScope -name $MyInvocation.InvocationName -parameterValues $PSBoundParameters -includeParameters @()
@ -49,8 +53,11 @@ try {
if ($appJson.psobject.Members | Where-Object name -eq "dependencies") {
if ($appJson.dependencies) {
$appJson.dependencies = @($appJson.dependencies | % {
if ($_.psobject.Members | where-object membertype -like 'noteproperty' | Where-Object name -eq "id") {
New-Object psobject -Property ([ordered]@{ "appId" = $_.id; "publisher" = $_.publisher; "name" = $_.name; "version" = $_.version })
$_ | ConvertTo-Json -Compress | Out-Host
if ($_.PSObject.Properties.Name -eq "id") {
$name = "$(if ($_.PSObject.Properties.Name -eq "name") { $_.Name })"
$publisher = "$(if ($_.PSObject.Properties.Name -eq "publisher") { $_.Publisher })"
New-Object psobject -Property ([ordered]@{ "appId" = $_.id; "publisher" = $publisher; "name" = $name; "version" = $_.version })
}
else {
$_
@ -122,6 +129,11 @@ try {
$script:sortedApps | ForEach-Object {
($folders["$($_.id):$($_.version)"]).SubString($baseFolder.Length)
}
if ($knownApps) {
$knownApps.value += @($script:sortedApps | ForEach-Object {
$_.Id
})
}
if ($unknownDependencies) {
$unknownDependencies.value += @($script:unresolvedDependencies | ForEach-Object { if ($_) {
"$(if ($_.PSObject.Properties.name -eq 'AppId') { $_.AppId } else { $_.Id }):" + $("$($_.publisher)_$($_.name)_$($_.version).app".Split([System.IO.Path]::GetInvalidFileNameChars()) -join '')

Просмотреть файл

@ -7,6 +7,7 @@ Issue #2718 Add setting NoOfSecondsToSleepAfterPublishBcContainerApp to be able
AL-Go issue https://github.com/microsoft/AL-Go/issues/228
Issue #2745 Support for Windows 10 22H2
Add parameter TreatTestFailuresAsWarnings to Run-AlPipeline
Add parameter knownApps to Sort-AppFoldersByDependencies, to return all known apps in sorted folders
4.0.5
Issue #2697 Run-AlValidation does not fail validation, but validation fails in Partner Center when submitting the app for NextMajor