Skip to content

Commit

Permalink
Freddydk/dependencies (#3685)
Browse files Browse the repository at this point in the history
Bug fix for bug found when fixing
microsoft/AL-Go#1215

When using compilerFolder or FilesOnly Container, the dependencies
artifact doesn't get generated when specifying
GenerateDependencyArtifact = true.

---------

Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk authored Sep 27, 2024
1 parent 81f7c66 commit 3a37a0f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
35 changes: 16 additions & 19 deletions AppHandling/Run-AlPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,12 @@ if ($buildArtifactFolder) {
New-Item $buildArtifactFolder -ItemType Directory | Out-Null
}
}
if ($generateDependencyArtifact) {
$dependenciesFolder = Join-Path $buildArtifactFolder "Dependencies"
if (!(Test-Path $dependenciesFolder)) {
New-Item -ItemType Directory -Path $dependenciesFolder | Out-Null
}
}

if (!($appFolders)) {
Write-Host "WARNING: No app folders found"
Expand Down Expand Up @@ -1231,9 +1237,6 @@ Measure-Command {
Write-Host -ForegroundColor Yellow "Installing apps for additional country $testCountry"
}

if ($generateDependencyArtifact) {
$dependenciesFolder = Join-Path $buildArtifactFolder "Dependencies"
}
$tmpAppFolder = Join-Path ([System.IO.Path]::GetTempPath()) ([guid]::NewGuid().ToString())
$tmpAppFiles = @()
$installApps | ForEach-Object{
Expand Down Expand Up @@ -1261,9 +1264,6 @@ Measure-Command {
Write-Host -NoNewline "Copying $($_.SubString($packagesFolder.Length+1)) to symbols folder"
if ($generateDependencyArtifact) {
Write-Host -NoNewline " and dependencies folder"
if (!(Test-Path $dependenciesFolder)) {
New-Item -ItemType Directory -Path $dependenciesFolder | Out-Null
}
Copy-Item -Path $_ -Destination $dependenciesFolder -Force
}
Write-Host
Expand Down Expand Up @@ -1348,7 +1348,7 @@ Measure-Command {
}
if ($generateDependencyArtifact -and !($testCountry)) {
$parameters += @{
"CopyInstalledAppsToFolder" = Join-Path $buildArtifactFolder "Dependencies"
"CopyInstalledAppsToFolder" = $dependenciesFolder
}
}
Invoke-Command -ScriptBlock $InstallMissingDependencies -ArgumentList $Parameters
Expand Down Expand Up @@ -1837,18 +1837,15 @@ Write-Host -ForegroundColor Yellow @'
}

if ($generateDependencyArtifact -and !$filesOnly -and !$useCompilerFolder) {
$depFolder = Join-Path $buildArtifactFolder "Dependencies"
Write-Host "Copying dependencies from $depFolder to $appPackagesFolder"
if (Test-Path $depFolder) {
Get-ChildItem -Path $depFolder -Recurse -file -Filter '*.app' | ForEach-Object {
$destName = Join-Path $appPackagesFolder $_.Name
if (Test-Path $destName) {
Write-Host "- $destName already exists"
}
else {
Write-Host "+ Copying $($_.FullName) to $destName"
Copy-Item -Path $_.FullName -Destination $destName -Force
}
Write-Host "Copying dependencies from $dependenciesFolder to $appPackagesFolder"
Get-ChildItem -Path $dependenciesFolder -Recurse -file -Filter '*.app' | ForEach-Object {
$destName = Join-Path $appPackagesFolder $_.Name
if (Test-Path $destName) {
Write-Host "- $destName already exists"
}
else {
Write-Host "+ Copying $($_.FullName) to $destName"
Copy-Item -Path $_.FullName -Destination $destName -Force
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions NuGet/Download-BcNuGetPackageToFolder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ try {
$appFiles = Get-Item -Path (Join-Path $package "*.app")
}
foreach($appFile in $appFiles) {
Write-Host "Copying $($appFile.Name) to $folder"
Copy-Item $appFile.FullName -Destination $folder -Force
if ($copyInstalledAppsToFolder) {
Write-Host "Copying $($appFile.Name) to $copyInstalledAppsToFolder"
Copy-Item $appFile.FullName -Destination $copyInstalledAppsToFolder -Force
}
}
Expand Down
1 change: 1 addition & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
6.0.25
Fix issue where generateDependencyArtifact doesn't result in dependencies if useCompilerFolder is true or filesonly containers are used in Run-AlPipeline

6.0.24
Use pre-release altool when running alcops (to be able to get runtime version of nextmajor)
Expand Down

0 comments on commit 3a37a0f

Please sign in to comment.