Skip to content

Commit 07f3ae5

Browse files
committed
Update UPGRADING.md
1 parent ac517be commit 07f3ae5

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

Diff for: docs/UPGRADING.md

+89
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,95 @@ Here you can find a list of migration guides to handle breaking changes between
44

55
## Unreleased
66

7+
### Change public library interface
8+
9+
#### `github.com/arduino/arduino-cli/arduino/builder` package
10+
11+
`GenBuildPath()` function has been moved to `github.com/arduino/arduino-cli/arduino/sketch` package. The signature is
12+
unchanged.
13+
14+
`EnsureBuildPathExists` function from has been completely removed, in its place use
15+
`github.com/arduino/go-paths-helper.MkDirAll()`.
16+
17+
`SketchSaveItemCpp` function signature is changed from `path string, contents []byte, destPath string` to
18+
`path *paths.Path, contents []byte, destPath *paths.Path`. `paths` is `github.com/arduino/go-paths-helper`.
19+
20+
`SketchLoad` function has been removed, in its place use `New` from `github.com/arduino/arduino-cli/arduino/sketch`
21+
package.
22+
23+
```diff
24+
- SketchLoad("/some/path", "")
25+
+ sketch.New(paths.New("some/path))
26+
}
27+
```
28+
29+
If you need to set a custom build path you must instead set it after creating the Sketch.
30+
31+
```diff
32+
- SketchLoad("/some/path", "/my/build/path")
33+
+ s, err := sketch.New(paths.New("some/path))
34+
+ s.BuildPath = paths.new("/my/build/path")
35+
}
36+
```
37+
38+
`SketchCopyAdditionalFiles` function signature is changed from
39+
`sketch *sketch.Sketch, destPath string, overrides map[string]string` to
40+
`sketch *sketch.Sketch, destPath *paths.Path, overrides map[string]string`.
41+
42+
#### `github.com/arduino/arduino-cli/arduino/sketch` package
43+
44+
`Item` struct has been removed, use `go-paths-helper.Path` in its place.
45+
46+
`NewItem` has been removed too, use `go-paths-helper.New` in its place.
47+
48+
`GetSourceBytes` has been removed, in its place use `go-paths-helper.Path.ReadFile`. `GetSourceStr` too has been
49+
removed, in its place:
50+
51+
```diff
52+
- s, err := item.GetSourceStr()
53+
+ data, err := file.ReadFile()
54+
+ s := string(data)
55+
}
56+
```
57+
58+
`ItemByPath` type and its member functions have been removed, use `go-paths-helper.PathList` in its place.
59+
60+
`Sketch.LocationPath` has been renamed to `FullPath` and its type changed from `string` to `go-paths-helper.Path`.
61+
62+
`Sketch.MainFile` type has changed from `*Item` to `go-paths-helper.Path`. `Sketch.OtherSketchFiles`,
63+
`Sketch.AdditionalFiles` and `Sketch.RootFolderFiles` type has changed from `[]*Item` to `go-paths-helper.PathList`.
64+
65+
`New` signature has been changed from `sketchFolderPath, mainFilePath, buildPath string, allFilesPaths []string` to
66+
`path *go-paths-helper.Path`.
67+
68+
`CheckSketchCasing` function is now private, the check is done internally by `New`.
69+
70+
`InvalidSketchFoldernameError` has been renamed `InvalidSketchFolderNameError`.
71+
72+
#### `github.com/arduino/arduino-cli/arduino/sketches` package
73+
74+
`Sketch` struct has been merged with `sketch.Sketch` struct.
75+
76+
`Metadata` and `BoardMetadata` structs have been moved to `github.com/arduino/arduino-cli/arduino/sketch` package.
77+
78+
`NewSketchFromPath` has been deleted, use `sketch.New` in its place.
79+
80+
`ImportMetadata` is now private called internally by `sketch.New`.
81+
82+
`ExportMetadata` has been moved to `github.com/arduino/arduino-cli/arduino/sketch` package.
83+
84+
`BuildPath` has been removed, use `sketch.Sketch.BuildPath` in its place.
85+
86+
`CheckForPdeFiles` has been moved to `github.com/arduino/arduino-cli/arduino/sketch` package.
87+
88+
#### `github.com/arduino/arduino-cli/legacy/builder/types` package
89+
90+
`Sketch` has been removed, use `sketch.Sketch` in its place.
91+
92+
`SketchToLegacy` and `SketchFromLegacy` have been removed, nothing replaces them.
93+
94+
`Context.Sketch` types has been changed from `Sketch` to `sketch.Sketch`.
95+
796
### Change of behaviour of gRPC `Init` function
897

998
Previously the `Init` function was used to both create a new `CoreInstance` and initialize it, so that the internal

0 commit comments

Comments
 (0)