Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
47645e9b
Unverified
Commit
47645e9b
authored
Jan 18, 2024
by
Cristian Maglie
Committed by
GitHub
Jan 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[breaking] Removed `Profile` protoc message in favor of `SketchProfile` (#2507)
parent
96b411fd
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
547 additions
and
616 deletions
+547
-616
commands/instances.go
commands/instances.go
+1
-5
docs/UPGRADING.md
docs/UPGRADING.md
+15
-0
internal/cli/compile/compile.go
internal/cli/compile/compile.go
+1
-1
internal/cli/instance/instance.go
internal/cli/instance/instance.go
+3
-3
internal/cli/monitor/monitor.go
internal/cli/monitor/monitor.go
+1
-1
internal/cli/upload/upload.go
internal/cli/upload/upload.go
+1
-1
rpc/cc/arduino/cli/commands/v1/commands.pb.go
rpc/cc/arduino/cli/commands/v1/commands.pb.go
+461
-461
rpc/cc/arduino/cli/commands/v1/commands.proto
rpc/cc/arduino/cli/commands/v1/commands.proto
+1
-1
rpc/cc/arduino/cli/commands/v1/common.pb.go
rpc/cc/arduino/cli/commands/v1/common.pb.go
+63
-136
rpc/cc/arduino/cli/commands/v1/common.proto
rpc/cc/arduino/cli/commands/v1/common.proto
+0
-7
No files found.
commands/instances.go
View file @
47645e9b
...
@@ -145,11 +145,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro
...
@@ -145,11 +145,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro
profile
=
p
profile
=
p
responseCallback
(
&
rpc
.
InitResponse
{
responseCallback
(
&
rpc
.
InitResponse
{
Message
:
&
rpc
.
InitResponse_Profile
{
Message
:
&
rpc
.
InitResponse_Profile
{
Profile
:
&
rpc
.
Profile
{
Profile
:
profile
.
ToRpc
(),
Name
:
req
.
GetProfile
(),
Fqbn
:
profile
.
FQBN
,
// TODO: Other profile infos may be provided here...
},
},
},
})
})
}
}
...
...
docs/UPGRADING.md
View file @
47645e9b
...
@@ -4,6 +4,21 @@ Here you can find a list of migration guides to handle breaking changes between
...
@@ -4,6 +4,21 @@ Here you can find a list of migration guides to handle breaking changes between
## 0.36.0
## 0.36.0
### The gRPC `cc.arduino.cli.commands.v1.Profile` message has been removed in favor of `SketchProfile`
The message
`Profile`
has been replaced with
`SketchProfile`
in the
`InitResponse.profile`
field:
```
proto
message
InitResponse
{
oneof
message
{
Progress
init_progress
=
1
;
google.rpc.Status
error
=
2
;
// Selected profile information
SketchProfile
profile
=
3
;
}
}
```
### The gRPC `cc.arduino.cli.commands.v1.LoadSketchResponse` message has been changed.
### The gRPC `cc.arduino.cli.commands.v1.LoadSketchResponse` message has been changed.
Previously the
`LoadSketchResponse`
containted all the information about the sketch:
Previously the
`LoadSketchResponse`
containted all the information about the sketch:
...
...
internal/cli/compile/compile.go
View file @
47645e9b
...
@@ -166,7 +166,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
...
@@ -166,7 +166,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
feedback
.
WarnAboutDeprecatedFiles
(
sk
)
feedback
.
WarnAboutDeprecatedFiles
(
sk
)
var
inst
*
rpc
.
Instance
var
inst
*
rpc
.
Instance
var
profile
*
rpc
.
Profile
var
profile
*
rpc
.
Sketch
Profile
if
profileArg
.
Get
()
==
""
{
if
profileArg
.
Get
()
==
""
{
inst
,
profile
=
instance
.
CreateAndInitWithProfile
(
sk
.
GetDefaultProfile
()
.
GetName
(),
sketchPath
)
inst
,
profile
=
instance
.
CreateAndInitWithProfile
(
sk
.
GetDefaultProfile
()
.
GetName
(),
sketchPath
)
...
...
internal/cli/instance/instance.go
View file @
47645e9b
...
@@ -37,7 +37,7 @@ func CreateAndInit() *rpc.Instance {
...
@@ -37,7 +37,7 @@ func CreateAndInit() *rpc.Instance {
// CreateAndInitWithProfile returns a new initialized instance using the given profile of the given sketch.
// CreateAndInitWithProfile returns a new initialized instance using the given profile of the given sketch.
// If Create fails the CLI prints an error and exits since to execute further operations a valid Instance is mandatory.
// If Create fails the CLI prints an error and exits since to execute further operations a valid Instance is mandatory.
// If Init returns errors they're printed only.
// If Init returns errors they're printed only.
func
CreateAndInitWithProfile
(
profileName
string
,
sketchPath
*
paths
.
Path
)
(
*
rpc
.
Instance
,
*
rpc
.
Profile
)
{
func
CreateAndInitWithProfile
(
profileName
string
,
sketchPath
*
paths
.
Path
)
(
*
rpc
.
Instance
,
*
rpc
.
Sketch
Profile
)
{
instance
,
err
:=
create
()
instance
,
err
:=
create
()
if
err
!=
nil
{
if
err
!=
nil
{
feedback
.
Fatal
(
tr
(
"Error creating instance: %v"
,
err
),
feedback
.
ErrGeneric
)
feedback
.
Fatal
(
tr
(
"Error creating instance: %v"
,
err
),
feedback
.
ErrGeneric
)
...
@@ -67,7 +67,7 @@ func Init(instance *rpc.Instance) {
...
@@ -67,7 +67,7 @@ func Init(instance *rpc.Instance) {
// InitWithProfile initializes instance by loading libraries and platforms specified in the given profile of the given sketch.
// InitWithProfile initializes instance by loading libraries and platforms specified in the given profile of the given sketch.
// In case of loading failures return a list of errors for each platform or library that we failed to load.
// In case of loading failures return a list of errors for each platform or library that we failed to load.
// Required Package and library indexes files are automatically downloaded.
// Required Package and library indexes files are automatically downloaded.
func
InitWithProfile
(
instance
*
rpc
.
Instance
,
profileName
string
,
sketchPath
*
paths
.
Path
)
*
rpc
.
Profile
{
func
InitWithProfile
(
instance
*
rpc
.
Instance
,
profileName
string
,
sketchPath
*
paths
.
Path
)
*
rpc
.
Sketch
Profile
{
downloadCallback
:=
feedback
.
ProgressBar
()
downloadCallback
:=
feedback
.
ProgressBar
()
taskCallback
:=
feedback
.
TaskProgress
()
taskCallback
:=
feedback
.
TaskProgress
()
...
@@ -76,7 +76,7 @@ func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *pat
...
@@ -76,7 +76,7 @@ func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *pat
initReq
.
SketchPath
=
sketchPath
.
String
()
initReq
.
SketchPath
=
sketchPath
.
String
()
initReq
.
Profile
=
profileName
initReq
.
Profile
=
profileName
}
}
var
profile
*
rpc
.
Profile
var
profile
*
rpc
.
Sketch
Profile
err
:=
commands
.
Init
(
initReq
,
func
(
res
*
rpc
.
InitResponse
)
{
err
:=
commands
.
Init
(
initReq
,
func
(
res
*
rpc
.
InitResponse
)
{
if
st
:=
res
.
GetError
();
st
!=
nil
{
if
st
:=
res
.
GetError
();
st
!=
nil
{
feedback
.
Warning
(
tr
(
"Error initializing instance: %v"
,
st
.
GetMessage
()))
feedback
.
Warning
(
tr
(
"Error initializing instance: %v"
,
st
.
GetMessage
()))
...
...
internal/cli/monitor/monitor.go
View file @
47645e9b
...
@@ -93,7 +93,7 @@ func runMonitorCmd(
...
@@ -93,7 +93,7 @@ func runMonitorCmd(
var
(
var
(
inst
*
rpc
.
Instance
inst
*
rpc
.
Instance
profile
*
rpc
.
Profile
profile
*
rpc
.
Sketch
Profile
fqbn
string
fqbn
string
defaultPort
,
defaultProtocol
string
defaultPort
,
defaultProtocol
string
)
)
...
...
internal/cli/upload/upload.go
View file @
47645e9b
...
@@ -100,7 +100,7 @@ func runUploadCommand(args []string, uploadFieldsArgs map[string]string) {
...
@@ -100,7 +100,7 @@ func runUploadCommand(args []string, uploadFieldsArgs map[string]string) {
}
}
var
inst
*
rpc
.
Instance
var
inst
*
rpc
.
Instance
var
profile
*
rpc
.
Profile
var
profile
*
rpc
.
Sketch
Profile
if
profileArg
.
Get
()
==
""
{
if
profileArg
.
Get
()
==
""
{
inst
,
profile
=
instance
.
CreateAndInitWithProfile
(
sketch
.
GetDefaultProfile
()
.
GetName
(),
sketchPath
)
inst
,
profile
=
instance
.
CreateAndInitWithProfile
(
sketch
.
GetDefaultProfile
()
.
GetName
(),
sketchPath
)
...
...
rpc/cc/arduino/cli/commands/v1/commands.pb.go
View file @
47645e9b
This diff is collapsed.
Click to expand it.
rpc/cc/arduino/cli/commands/v1/commands.proto
View file @
47645e9b
...
@@ -237,7 +237,7 @@ message InitResponse {
...
@@ -237,7 +237,7 @@ message InitResponse {
Progress
init_progress
=
1
;
Progress
init_progress
=
1
;
google.rpc.Status
error
=
2
;
google.rpc.Status
error
=
2
;
// Selected profile information
// Selected profile information
Profile
profile
=
3
;
Sketch
Profile
profile
=
3
;
}
}
}
}
...
...
rpc/cc/arduino/cli/commands/v1/common.pb.go
View file @
47645e9b
This diff is collapsed.
Click to expand it.
rpc/cc/arduino/cli/commands/v1/common.proto
View file @
47645e9b
...
@@ -173,13 +173,6 @@ message Board {
...
@@ -173,13 +173,6 @@ message Board {
string
fqbn
=
2
;
string
fqbn
=
2
;
}
}
message
Profile
{
// Name used to identify the profile within the sketch.
string
name
=
1
;
// FQBN specified in the profile.
string
fqbn
=
2
;
}
message
HelpResources
{
message
HelpResources
{
// A URL provided by the author of the platform's package, intended to point
// A URL provided by the author of the platform's package, intended to point
// to their online help service.
// to their online help service.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment