Skip to content

Commit e0e3506

Browse files
committed
Updated UPGRADING.md
1 parent 61f198d commit e0e3506

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/UPGRADING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,53 @@ Here you can find a list of migration guides to handle breaking changes between
44

55
## 0.22.0
66

7+
### package `github.com/arduino/arduino-cli/httpclient` has been moved to `github.com/arduino/arduino-cli/arduino/httpclient`
8+
9+
The old import must be updated to the new one.
10+
11+
### `commands.DownloadProgressCB` and `commands.TaskProgressCB` have been moved to package `github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1`
12+
13+
All references to these types must be updated with the new import.
14+
15+
### `commands.GetDownloaderConfig` has been moved to package `github.com/arduino/arduino-cli/arduino/httpclient`
16+
17+
All references to this function must be updated with the new import.
18+
19+
### `commands.Download` has been removed and replaced by `github.com/arduino/arduino-cli/arduino/httpclient.DownloadFile`
20+
21+
The old function must be replaced by the new one that is much more versatile.
22+
23+
### `packagemanager.PackageManager.DownloadToolRelease`, `packagemanager.PackageManager.DownloadPlatformRelease`, and `resources.DownloadResource.Download` functions now require `label` and `progressCB` parameters
24+
25+
The following functions:
26+
27+
```go
28+
func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config) (*downloader.Downloader, error)
29+
func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config) (*downloader.Downloader, error)
30+
func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config) (*downloader.Downloader, error)
31+
```
32+
33+
now requires a progress callback:
34+
35+
```go
36+
func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error
37+
func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error
38+
func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config, label string, downloadCB rpc.DownloadProgressCB) error
39+
```
40+
41+
The new parameters must be added to legacy code. If progress reports are not needed an empty stub for `label` and
42+
`progressCB` must be provided, for example:
43+
44+
```go
45+
err := pm.DownloadPlatformRelease(platformToDownload, config)
46+
```
47+
48+
becomes:
49+
50+
```go
51+
err := pm.DownloadPlatformRelease(platformToDownload, config, "", func(progress *rpc.DownloadProgress) {})
52+
```
53+
754
### `packagemanager.Load*` functions now returns `error` instead of `*status.Status`
855

956
The following functions signature:

0 commit comments

Comments
 (0)