Skip to content

Commit b25d0c6

Browse files
committed
chore: restructure project for local UiPath API DLL reference
- Added `tools/prepare-api-dlls.ps1` for downloading and extracting UiPath.Activities.Api DLLs per target framework - Updated `.csproj` to use local DLL references instead of NuGet dependency - Updated `.gitignore` to exclude extracted DLLs and temp artifacts
1 parent e82fd2d commit b25d0c6

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ UiPath.Studio.RulesLibrary/
6262
*.DS_Store
6363
Thumbs.db
6464
desktop.ini
65+
66+
# --- Added for UiPath API DLL prep ---
67+
/src/**/temp-nugets/
68+
/src/**/lib-deps/

src/CPRIMA.WorkflowAnalyzerRules/CPRIMA.WorkflowAnalyzerRules.csproj

+14-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,28 @@
2929
</PropertyGroup>
3030

3131
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
32-
<PackageReference Include="UiPath.Activities.Api" Version="23.10.3" />
32+
<PackageReference Include="UiPath.Activities.Api" Version="23.10.3">
33+
<ExcludeAssets>runtime</ExcludeAssets>
34+
<PrivateAssets>all</PrivateAssets>
35+
</PackageReference>
3336
</ItemGroup>
3437

3538
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
36-
<PackageReference Include="UiPath.Activities.Api" Version="24.10.1" />
39+
<PackageReference Include="UiPath.Activities.Api" Version="24.10.1">
40+
<ExcludeAssets>runtime</ExcludeAssets>
41+
<PrivateAssets>all</PrivateAssets>
42+
</PackageReference>
3743
</ItemGroup>
3844

3945
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
40-
<PackageReference Include="UiPath.Activities.Api" Version="24.10.1" />
46+
<PackageReference Include="UiPath.Activities.Api" Version="24.10.1">
47+
<ExcludeAssets>runtime</ExcludeAssets>
48+
<PrivateAssets>all</PrivateAssets>
49+
</PackageReference>
4150
</ItemGroup>
4251

52+
53+
4354
<ItemGroup>
4455
<Compile Update="LocalizationResources\Strings.Designer.cs">
4556
<DesignTime>True</DesignTime>

tools/prepare-api-dlls.ps1

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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

Comments
 (0)