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

UiPath / uipathcli / 12594758457

03 Jan 2025 08:13AM UTC coverage: 90.328% (-0.1%) from 90.453%
12594758457

Pull #135

github

thschmitt
Add support to analyze and package studio projects

Integrated uipathcli with UiPath Studio to build, package and analyze
studio projects.

Added two new plugin commands:

- `uipath studio package analyze`
- `uipath studio package pack`

Implementation:

- Created infrastructure to download external plugins like the uipcli.
  The studio commands download the uipcli to the user cache dir
  and use it for packaging any studio project. Depending on the
  targetFramework the uipathcli either downloads the tool chain for
  building and packaging cross-platform or windows Studio projects.

- Added `ExecCmd` abstraction which is used to start processes and
  can easily be faked in unit tests in order to validate the behavior with
  different exit codes

- Refactored the existing browser launcher to use the `ExecCmd`
  abstraction

- Extended the progress bar rendering to allow displaying a simple bar
  without any percentage or bytes indicator so that the build process
  can be visualized without knowing the total time in advance.

- Increment the uipathcli version to 2.0.
  There are no backwards-incompatible changes. The major version increase
  only indicates that an important new feature has been added.

Examples:

`uipath studio package analyze --source plugin/studio/projects/crossplatform`

```
analyzing...        |██████████          |
```

```
{
  "error": null,
  "status": "Succeeded",
  "violations": [
    ...
  ]
}
```

`uipath studio package pack --source plugin/studio/projects/crossplatform --destination . --debug`

```
uipcli Information: 0 : Packing project(s) at path plugin\studio\projects\crossplatform\project.json...
uipcli Information: 0 : Orchestrator information is not provided, hence, orchestrator feeds will not be used.
uipcli Information: 0 : Proceeding with the local feeds...
uipcli Information: 0 : Detected schema version 4.0
...
uipcli Information: 0 : Packaged project MyProcess v1.0.2 saved to MyProcess.1.0.2.nupkg.
```

```
{
  "... (continued)
Pull Request #135: Add support to analyze and package studio projects

698 of 818 new or added lines in 25 files covered. (85.33%)

2 existing lines in 1 file now uncovered.

4931 of 5459 relevant lines covered (90.33%)

1.01 hits per line

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

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

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

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

14
const uipcliVersion = "24.12.9111.31003"
15
const uipcliUrl = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_apis/packaging/feeds/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/packages/UiPath.CLI/versions/" + uipcliVersion + "/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
type uipcli struct {
21
        Exec   utils.ExecProcess
22
        Logger log.Logger
23
}
24

25
func (c uipcli) Execute(targetFramework TargetFramework, args ...string) (utils.ExecCmd, error) {
1✔
26
        if targetFramework == TargetFrameworkWindows {
1✔
NEW
27
                return c.execute("uipcli-win", uipcliWindowsUrl, args)
×
NEW
28
        }
×
29
        return c.execute("uipcli", uipcliUrl, args)
1✔
30
}
31

32
func (c uipcli) execute(name string, url string, args []string) (utils.ExecCmd, error) {
1✔
33
        uipcliPath, err := c.getPath(name, url)
1✔
34
        if err != nil {
1✔
NEW
35
                return nil, err
×
NEW
36
        }
×
37

38
        path := uipcliPath
1✔
39
        if filepath.Ext(uipcliPath) == ".dll" {
2✔
40
                path, err = exec.LookPath("dotnet")
1✔
41
                if err != nil {
1✔
NEW
42
                        return nil, fmt.Errorf("Could not find dotnet runtime to run command: %v", err)
×
NEW
43
                }
×
44
                args = append([]string{uipcliPath}, args...)
1✔
45
        }
46

47
        cmd := c.Exec.Command(path, args...)
1✔
48
        return cmd, nil
1✔
49
}
50

51
func (c uipcli) getPath(name string, url string) (string, error) {
1✔
52
        externalPlugin := plugin.NewExternalPlugin(c.Logger)
1✔
53
        executable := "tools/uipcli.dll"
1✔
54
        if c.isWindows() {
1✔
NEW
55
                executable = "tools/uipcli.exe"
×
NEW
56
        }
×
57
        return externalPlugin.GetTool(name, url, executable)
1✔
58
}
59

60
func (c uipcli) isWindows() bool {
1✔
61
        return runtime.GOOS == "windows"
1✔
62
}
1✔
63

64
func newUipcli(exec utils.ExecProcess, logger log.Logger) *uipcli {
1✔
65
        return &uipcli{exec, logger}
1✔
66
}
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