• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

UiPath / uipathcli / 13285657222

12 Feb 2025 12:41PM UTC coverage: 90.092% (-0.4%) from 90.522%
13285657222

push

github

thschmitt
Download .NET runtime for cross-platform Studio Projects

- Downloading the required .NET runtime when the user builds
  cross-platform Studio projects which allows the uipathcli to work
  without any additional dependencies

- Added support to for tar.gz archives which is needed to extract
  dotnet runtime archives on Linux and MacOS

88 of 121 new or added lines in 5 files covered. (72.73%)

4 existing lines in 2 files now uncovered.

5074 of 5632 relevant lines covered (90.09%)

1.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.8
/plugin/studio/uipcli.go
1
package studio
2

3
import (
4
        "fmt"
5
        "path/filepath"
6
        "runtime"
7
        "strings"
8

9
        "github.com/UiPath/uipathcli/log"
10
        "github.com/UiPath/uipathcli/plugin"
11
        "github.com/UiPath/uipathcli/utils/process"
12
)
13

14
const uipcliCrossPlatformVersion = "24.12.9111.31003"
15
const uipcliCrossPlatformUrl = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_apis/packaging/feeds/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/packages/UiPath.CLI/versions/" + uipcliCrossPlatformVersion + "/content"
16

17
const uipcliWindowsVersion = "24.12.9111.31003"
18
const uipcliWindowsUrl = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_apis/packaging/feeds/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/packages/UiPath.CLI.Windows/versions/" + uipcliWindowsVersion + "/content"
19

20
const dotnetLinuxX64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-linux-x64.tar.gz"
21
const dotnetMacOsX64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-osx-x64.tar.gz"
22
const dotnetWindowsX64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-win-x64.zip"
23

24
const dotnetLinuxArm64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-linux-arm64.tar.gz"
25
const dotnetMacOsArm64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-osx-arm64.tar.gz"
26
const dotnetWindowsArm64Url = "https://aka.ms/dotnet/8.0/dotnet-runtime-win-arm64.zip"
27

28
type uipcli struct {
29
        Exec   process.ExecProcess
30
        Logger log.Logger
31
        path   string
32
        args   []string
33
}
34

35
func (c *uipcli) Initialize(targetFramework TargetFramework) error {
1✔
36
        uipcliPath, err := c.getUipcliPath(targetFramework)
1✔
37
        if err != nil {
1✔
38
                return err
×
39
        }
×
40
        c.path = uipcliPath
1✔
41

1✔
42
        if filepath.Ext(c.path) == ".dll" {
2✔
43
                dotnetPath, err := c.getDotnetPath()
1✔
44
                if err != nil {
1✔
NEW
45
                        return err
×
46
                }
×
47
                c.path = dotnetPath
1✔
48
                c.args = []string{uipcliPath}
1✔
49
        }
50
        return nil
1✔
51
}
52

53
func (c uipcli) Execute(args ...string) (process.ExecCmd, error) {
1✔
54
        args = append(c.args, args...)
1✔
55
        cmd := c.Exec.Command(c.path, args...)
1✔
56
        return cmd, nil
1✔
57
}
1✔
58

59
func (c uipcli) getUipcliPath(targetFramework TargetFramework) (string, error) {
1✔
60
        externalPlugin := plugin.NewExternalPlugin(c.Logger)
1✔
61
        name := "uipcli"
1✔
62
        url := uipcliCrossPlatformUrl
1✔
63
        executable := "tools/uipcli.dll"
1✔
64
        if targetFramework.IsWindowsOnly() {
1✔
NEW
65
                name = "uipcli-win"
×
NEW
66
                url = uipcliWindowsUrl
×
67
                executable = "tools/uipcli.exe"
×
68
        }
×
69
        return externalPlugin.GetTool(name, url, plugin.ArchiveTypeZip, executable)
1✔
70
}
71

72
func (c uipcli) getDotnetPath() (string, error) {
1✔
73
        externalPlugin := plugin.NewExternalPlugin(c.Logger)
1✔
74
        name := fmt.Sprintf("dotnet8-%s-%s", runtime.GOOS, runtime.GOARCH)
1✔
75
        url, archiveType, executable := c.dotnetUrl()
1✔
76
        return externalPlugin.GetTool(name, url, archiveType, executable)
1✔
77
}
1✔
78

79
func (c uipcli) dotnetUrl() (string, plugin.ArchiveType, string) {
1✔
80
        if c.isArm() {
1✔
NEW
81
                switch runtime.GOOS {
×
NEW
82
                case "windows":
×
NEW
83
                        return dotnetWindowsArm64Url, plugin.ArchiveTypeZip, "dotnet.exe"
×
NEW
84
                case "darwin":
×
NEW
85
                        return dotnetMacOsArm64Url, plugin.ArchiveTypeTarGz, "dotnet"
×
NEW
86
                default:
×
NEW
87
                        return dotnetLinuxArm64Url, plugin.ArchiveTypeTarGz, "dotnet"
×
88
                }
89
        }
90
        switch runtime.GOOS {
1✔
NEW
91
        case "windows":
×
NEW
92
                return dotnetWindowsX64Url, plugin.ArchiveTypeZip, "dotnet.exe"
×
NEW
93
        case "darwin":
×
NEW
94
                return dotnetMacOsX64Url, plugin.ArchiveTypeTarGz, "dotnet"
×
95
        default:
1✔
96
                return dotnetLinuxX64Url, plugin.ArchiveTypeTarGz, "dotnet"
1✔
97
        }
98
}
99

100
func (c uipcli) isArm() bool {
1✔
101
        return strings.HasPrefix(strings.ToLower(runtime.GOARCH), "arm")
1✔
102
}
1✔
103

104
func newUipcli(exec process.ExecProcess, logger log.Logger) *uipcli {
1✔
105
        return &uipcli{exec, logger, "", []string{}}
1✔
106
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc