|
| 1 | +# prepare-api-dlls.ps1 |
| 2 | +param() |
| 3 | + |
| 4 | +# Get path of this script, resolve relative paths from here |
| 5 | +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path |
| 6 | +$ProjectDir = Join-Path $ScriptDir "../src/CPRIMA.WorkflowAnalyzerRules" | Resolve-Path -ErrorAction Stop |
| 7 | + |
| 8 | +# Where to put temp NuGet downloads |
| 9 | +$TempDir = Join-Path $ProjectDir "temp-nugets" |
| 10 | +# Where to copy extracted DLLs |
| 11 | +$OutDir = Join-Path $ProjectDir "lib-deps/UiPath.Activities.Api" |
| 12 | + |
| 13 | +# Target versions and frameworks |
| 14 | +$Targets = @( |
| 15 | + @{ Version = "23.10.3"; TFM = "net461" }, |
| 16 | + @{ Version = "24.10.1"; TFM = "net6.0" }, |
| 17 | + @{ Version = "24.10.1"; TFM = "net8.0" } |
| 18 | +) |
| 19 | + |
| 20 | +# Create temp dir |
| 21 | +New-Item -ItemType Directory -Force -Path $TempDir | Out-Null |
| 22 | + |
| 23 | +foreach ($target in $Targets) { |
| 24 | + $pkgId = "UiPath.Activities.Api" |
| 25 | + $pkgVersion = $target.Version |
| 26 | + $tfm = $target.TFM |
| 27 | + |
| 28 | + $pkgDir = Join-Path $TempDir "$pkgId.$pkgVersion" |
| 29 | + $dllSource = Join-Path $pkgDir "lib/$tfm/UiPath.Studio.Activities.Api.dll" |
| 30 | + $dllTargetDir = Join-Path $OutDir $tfm |
| 31 | + $dllTarget = Join-Path $dllTargetDir "UiPath.Studio.Activities.Api.dll" |
| 32 | + |
| 33 | + if (-Not (Test-Path $pkgDir)) { |
| 34 | + Write-Host "📦 Downloading $pkgId $pkgVersion..." |
| 35 | + dotnet nuget add source "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json" --name UiPath-Official -q |
| 36 | + nuget install $pkgId -Version $pkgVersion -OutputDirectory $TempDir -Source "UiPath-Official" |
| 37 | + } |
| 38 | + |
| 39 | + if (-Not (Test-Path $dllSource)) { |
| 40 | + throw "❌ DLL not found at: $dllSource" |
| 41 | + } |
| 42 | + |
| 43 | + New-Item -ItemType Directory -Force -Path $dllTargetDir | Out-Null |
| 44 | + Copy-Item -Path $dllSource -Destination $dllTarget -Force |
| 45 | + |
| 46 | + Write-Host "✅ Copied $tfm DLL to $dllTargetDir" |
| 47 | +} |
| 48 | + |
| 49 | +Write-Host "`nAll done." |
0 commit comments